port forwarding + masquarading + firewall

Pilat

New Member
Aug 21, 2010
29
0
1
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!