What is the standard way to redirect the port to a virtual machine and masquerading?
I try the command below. They work, but if the firewall is enabled on the interface of the virtual machine, then masquerading is interrupted, if I somehow change the firewall the GUI.
iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
#or iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j SNAT --to-source abcd
iptables -A PREROUTING -t nat -i vmbr0 -p tcp -d $ ext_ip --dport 22 -j DNAT --to 192.168.1.2:22
I try the command below. They work, but if the firewall is enabled on the interface of the virtual machine, then masquerading is interrupted, if I somehow change the firewall the GUI.
iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
#or iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j SNAT --to-source abcd
iptables -A PREROUTING -t nat -i vmbr0 -p tcp -d $ ext_ip --dport 22 -j DNAT --to 192.168.1.2:22