Multiple public IPs in NAT'd config

SouthSiders

Active Member
Nov 6, 2018
9
0
41
34
I have done a search and this has been asked a few times before but I haven't been able to find the answer. I have a NAT setup following this guide:

https://pve.proxmox.com/pve-docs/chapter-sysadmin.html#_choosing_a_network_configuration

The server has 10gbit public interface and I just can't get the throughput with pfSense virtualised so have opted to go for a PVE NAT config which so far works perfectly and gives the full throughput. I have been assigned a public /29 range and wish to add those to the eno2 adapter so I can use some port fowarding rules. My network config looks like this (public IP redacted):

Code:
auto lo
iface lo inet loopback

auto eno2
iface eno2 inet static
        address X.X.X.X/29
        gateway X.X.X.X

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 172.16.10.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

        post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '172.16.10.0/24' -o eno2 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '172.16.10.0/24' -o eno2 -j MASQUERADE

Would something like this be correct?

Code:
auto eno2
iface eno2 inet static
        address X.X.X.X/29
        gateway X.X.X.X
iface eno2:0 inet static
    address X.X.X.X/29
 
Last edited:
I managed to get it working after some experimenting. Here is my config if anyone finds this helpful in the future:

Code:
auto lo
iface lo inet loopback

auto eno2
auto eno2:0
auto eno2:1
auto eno2:2
auto eno2:3

iface eno2 inet static
        address X.X.X.X/29
        gateway X.X.X.X
      
iface eno2:0 inet static
        address X.X.X.X/29
        gateway X.X.X.X

iface eno2:1 inet static
        address X.X.X.X/29
        gateway X.X.X.X

iface eno2:2 inet static
        address X.X.X.X/29
        gateway X.X.X.X
      
iface eno2:3 inet static
        address X.X.X.X/29
        gateway X.X.X.X
      
iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 172.16.10.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

        post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '172.16.10.0/24' -o eno2 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '172.16.10.0/24' -o eno2 -j MASQUERADE