Hi. I'm trying to set up my proxmox with one public ip. I'm trying to have webservers on 2 or more vms.
I'm trying to follow this tutorial: https://mrkmg.com/posts/2016/01/proxmox-4-with-single-public-ip-private-network/
What changes do I need to make to my router? What changes do I need to make to my host /etc/network/interfaces file?
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address X.X.X.X (public ip)
netmask 255.255.255.0
gateway X.X.X.1
broadcast X.X.X.1
network X.X.X.0
dns-nameservers 8.8.8.8 8.8.4.4
auto vmbr0
iface vmbr0 inet static
pre-up iptables-restore < /etc/iptables.rules
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
broadcast 192.168.1.255
network 192.168.1.0
bridge_ports eth0
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
#VM100
#VM101 192.168.1.101
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 120 -j DNAT --to-destination 192.168.1.101:20
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 120 -j DNAT --to-destination 192.168.1.101:20
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 121 -j DNAT --to-destination 192.168.1.101:21
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 121 -j DNAT --to-destination 192.168.1.101:21
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 122 -j DNAT --to-destination 192.168.1.101:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 122 -j DNAT --to-destination 192.168.1.101:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 125 -j DNAT --to-destination 192.168.1.101:25
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 125 -j DNAT --to-destination 192.168.1.101:25
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 153 -j DNAT --to-destination 192.168.1.101:53
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 153 -j DNAT --to-destination 192.168.1.101:53
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 180 -j DNAT --to-destination 192.168.1.101:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 180 -j DNAT --to-destination 192.168.1.101:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1110 -j DNAT --to-destination 192.168.1.101:110
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1110 -j DNAT --to-destination 192.168.1.101:110
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1143 -j DNAT --to-destination 192.168.1.101:143
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1143 -j DNAT --to-destination 192.168.1.101:143
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1443 -j DNAT --to-destination 192.168.1.101:443
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1443 -j DNAT --to-destination 192.168.1.101:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1993 -j DNAT --to-destination 192.168.1.101:993
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1993 -j DNAT --to-destination 192.168.1.101:993
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1995 -j DNAT --to-destination 192.168.1.101:995
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1995 -j DNAT --to-destination 192.168.1.101:995
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 11935 -j DNAT --to-destination 192.168.1.101:1935
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 11935 -j DNAT --to-destination 192.168.1.101:1935
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 13306 -j DNAT --to-destination 192.168.1.101:3306
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 13306 -j DNAT --to-destination 192.168.1.101:3306
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 15080 -j DNAT --to-destination 192.168.1.101:5080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 15080 -j DNAT --to-destination 192.168.1.101:5080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 18080 -j DNAT --to-destination 192.168.1.101:8080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 18080 -j DNAT --to-destination 192.168.1.101:8080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 18081 -j DNAT --to-destination 192.168.1.101:8081
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 18081 -j DNAT --to-destination 192.168.1.101:8081
#VM102 192.168.1.102
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 220 -j DNAT --to-destination 192.168.1.102:20
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 220 -j DNAT --to-destination 192.168.1.102:20
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 221 -j DNAT --to-destination 192.168.1.102:21
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 221 -j DNAT --to-destination 192.168.1.102:21
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 222 -j DNAT --to-destination 192.168.1.102:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 222 -j DNAT --to-destination 192.168.1.102:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 225 -j DNAT --to-destination 192.168.1.102:25
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 225 -j DNAT --to-destination 192.168.1.102:25
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 253 -j DNAT --to-destination 192.168.1.102:53
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 253 -j DNAT --to-destination 192.168.1.102:53
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 280 -j DNAT --to-destination 192.168.1.102:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 280 -j DNAT --to-destination 192.168.1.102:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2110 -j DNAT --to-destination 192.168.1.102:110
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2110 -j DNAT --to-destination 192.168.1.102:110
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2143 -j DNAT --to-destination 192.168.1.102:143
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2143 -j DNAT --to-destination 192.168.1.102:143
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2443 -j DNAT --to-destination 192.168.1.102:443
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2443 -j DNAT --to-destination 192.168.1.102:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2993 -j DNAT --to-destination 192.168.1.102:993
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2993 -j DNAT --to-destination 192.168.1.102:993
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2995 -j DNAT --to-destination 192.168.1.102:995
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2995 -j DNAT --to-destination 192.168.1.102:995
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 21935 -j DNAT --to-destination 192.168.1.102:1935
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 21935 -j DNAT --to-destination 192.168.1.102:1935
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 23306 -j DNAT --to-destination 192.168.1.102:3306
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 23306 -j DNAT --to-destination 192.168.1.102:3306
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 25080 -j DNAT --to-destination 192.168.1.102:5080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 25080 -j DNAT --to-destination 192.168.1.102:5080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 28080 -j DNAT --to-destination 192.168.1.102:8080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 28080 -j DNAT --to-destination 192.168.1.102:8080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 28081 -j DNAT --to-destination 192.168.1.102:8081
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 28081 -j DNAT --to-destination 192.168.1.102:8081
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 12006 -j DNAT --to-destination 192.168.1.102:2006
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 12006 -j DNAT --to-destination 192.168.1.102:2006
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 12007 -j DNAT --to-destination 192.168.1.102:2007
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 12007 -j DNAT --to-destination 192.168.1.102:2007
I'm trying to follow this tutorial: https://mrkmg.com/posts/2016/01/proxmox-4-with-single-public-ip-private-network/
What changes do I need to make to my router? What changes do I need to make to my host /etc/network/interfaces file?
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address X.X.X.X (public ip)
netmask 255.255.255.0
gateway X.X.X.1
broadcast X.X.X.1
network X.X.X.0
dns-nameservers 8.8.8.8 8.8.4.4
auto vmbr0
iface vmbr0 inet static
pre-up iptables-restore < /etc/iptables.rules
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
broadcast 192.168.1.255
network 192.168.1.0
bridge_ports eth0
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
#VM100
#VM101 192.168.1.101
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 120 -j DNAT --to-destination 192.168.1.101:20
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 120 -j DNAT --to-destination 192.168.1.101:20
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 121 -j DNAT --to-destination 192.168.1.101:21
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 121 -j DNAT --to-destination 192.168.1.101:21
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 122 -j DNAT --to-destination 192.168.1.101:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 122 -j DNAT --to-destination 192.168.1.101:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 125 -j DNAT --to-destination 192.168.1.101:25
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 125 -j DNAT --to-destination 192.168.1.101:25
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 153 -j DNAT --to-destination 192.168.1.101:53
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 153 -j DNAT --to-destination 192.168.1.101:53
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 180 -j DNAT --to-destination 192.168.1.101:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 180 -j DNAT --to-destination 192.168.1.101:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1110 -j DNAT --to-destination 192.168.1.101:110
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1110 -j DNAT --to-destination 192.168.1.101:110
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1143 -j DNAT --to-destination 192.168.1.101:143
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1143 -j DNAT --to-destination 192.168.1.101:143
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1443 -j DNAT --to-destination 192.168.1.101:443
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1443 -j DNAT --to-destination 192.168.1.101:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1993 -j DNAT --to-destination 192.168.1.101:993
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1993 -j DNAT --to-destination 192.168.1.101:993
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 1995 -j DNAT --to-destination 192.168.1.101:995
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 1995 -j DNAT --to-destination 192.168.1.101:995
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 11935 -j DNAT --to-destination 192.168.1.101:1935
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 11935 -j DNAT --to-destination 192.168.1.101:1935
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 13306 -j DNAT --to-destination 192.168.1.101:3306
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 13306 -j DNAT --to-destination 192.168.1.101:3306
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 15080 -j DNAT --to-destination 192.168.1.101:5080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 15080 -j DNAT --to-destination 192.168.1.101:5080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 18080 -j DNAT --to-destination 192.168.1.101:8080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 18080 -j DNAT --to-destination 192.168.1.101:8080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 18081 -j DNAT --to-destination 192.168.1.101:8081
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 18081 -j DNAT --to-destination 192.168.1.101:8081
#VM102 192.168.1.102
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 220 -j DNAT --to-destination 192.168.1.102:20
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 220 -j DNAT --to-destination 192.168.1.102:20
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 221 -j DNAT --to-destination 192.168.1.102:21
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 221 -j DNAT --to-destination 192.168.1.102:21
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 222 -j DNAT --to-destination 192.168.1.102:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 222 -j DNAT --to-destination 192.168.1.102:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 225 -j DNAT --to-destination 192.168.1.102:25
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 225 -j DNAT --to-destination 192.168.1.102:25
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 253 -j DNAT --to-destination 192.168.1.102:53
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 253 -j DNAT --to-destination 192.168.1.102:53
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 280 -j DNAT --to-destination 192.168.1.102:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 280 -j DNAT --to-destination 192.168.1.102:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2110 -j DNAT --to-destination 192.168.1.102:110
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2110 -j DNAT --to-destination 192.168.1.102:110
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2143 -j DNAT --to-destination 192.168.1.102:143
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2143 -j DNAT --to-destination 192.168.1.102:143
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2443 -j DNAT --to-destination 192.168.1.102:443
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2443 -j DNAT --to-destination 192.168.1.102:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2993 -j DNAT --to-destination 192.168.1.102:993
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2993 -j DNAT --to-destination 192.168.1.102:993
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 2995 -j DNAT --to-destination 192.168.1.102:995
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 2995 -j DNAT --to-destination 192.168.1.102:995
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 21935 -j DNAT --to-destination 192.168.1.102:1935
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 21935 -j DNAT --to-destination 192.168.1.102:1935
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 23306 -j DNAT --to-destination 192.168.1.102:3306
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 23306 -j DNAT --to-destination 192.168.1.102:3306
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 25080 -j DNAT --to-destination 192.168.1.102:5080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 25080 -j DNAT --to-destination 192.168.1.102:5080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 28080 -j DNAT --to-destination 192.168.1.102:8080
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 28080 -j DNAT --to-destination 192.168.1.102:8080
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 28081 -j DNAT --to-destination 192.168.1.102:8081
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 28081 -j DNAT --to-destination 192.168.1.102:8081
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 12006 -j DNAT --to-destination 192.168.1.102:2006
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 12006 -j DNAT --to-destination 192.168.1.102:2006
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 12007 -j DNAT --to-destination 192.168.1.102:2007
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp -m tcp --dport 12007 -j DNAT --to-destination 192.168.1.102:2007