Multiple WAN IPs on bridge and forwarding traffic to VMs on LAN IPs


New Member
Oct 6, 2023
Hi, I have the following setup:

1 physical pve server with 5 WAN IPs assigned to me from my ISP (so not a complete subnet) with 1 network interface enabled.
On the server I have 2 bridges, 1 for the external traffic and 1 for LAN traffic. On the proxmox server I have ntpd and dnsmasq enabled that listen on the internal bridge to provide DNS, DHCP and NTP to potential vms in that RFC1918 space.

My network config is as follows:

auto lo
iface lo inet loopback
iface eno1 inet manual
iface eno2 inet manual

auto vmbr0
iface vmbr0 inet static
        address XX.XX.XX.141/24
        gateway XX.XX.XX.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
auto vmbr0:0
iface vmbr0:0 inet static
        address XX.XX.XX.142/24
auto vmbr0:1
iface vmbr0:1 inet static
        address XX.XX.XX.143/24
auto vmbr0:2
iface vmbr0:2 inet static
        address XX.XX.XX.144/24
auto vmbr0:3
iface vmbr0:3 inet static
        address XX.XX.XX.145/24

auto vmbr1
iface vmbr1 inet static
        bridge-ports none
        bridge-stp of
        bridge-fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -A POSTROUTING -s '' -o vmbr0 -j MASQUERADE

post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to

As far as I know, this /should/ work, except I'm not seeing any entries in iptables when this is run with a restart of the network stack, but it also doesn't give me errors when I run the iptables commands manually. In this example, I would like to be able to use the extra external IPs as well, but for the moment I would settle for at the very least being able to NAT to inside IPs.

Any ideas where I'm going wrong?


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!