Proxmox - port forwarding
Published by Vitaly Musin on June 8th, 2017
On host machine run
echo 1 > /proc/sys/net/ipv4/ip_forward && \
iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE && \
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 10022 -j DNAT --to 192.168.1.3:22 && \
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 10080 -j DNAT --to 192.168.1.3:80
How persist changes
service iptables-persistent save
if need update
dpkg-reconfigure iptables-persistent
1. If required changes may be done through the web interface, do them that way.
2. If not, copy /etc/network/interfaces to /etc/network/interfaces.new and edit this one with the required changes.
3. Run /etc/init.d/pvenetcommit start
4. Run /etc/init.d/networking restart