First of all, I have not much experience in network configuration. This is my first time configuring dedicated server.
I'm using dedicated server on Contabo and I purchased 4 additional IP addresses for my server (5 in total).
My requirement is to seperate to 5 public IP addresses into multiple containers (1 public IP for many containers)
All container can connect to public internet and use port forwarding into each application inside container that need to access from internet.

From the image above, not sure this is the best way to do it or not. It's what I plan to config.
I have 5 public IP, 1 is main ip of the server and 4 more with different gateway (these 4 are in the same gateway which is 80.xxx.xxx.1)
Currently I configured in /etc/network/interface like this
And I config an LXC for pv1 like this and it can connect to internet just fine.

But I tried to config for pv2 like this and it can't connect to internet.

----------------------------------------------------------------
Please help me config the network for my need. I can reconfigure everything from the start if it should be.
Not sure that my requirements is clear enough, if you need more information, please let me know.
Thank you
I'm using dedicated server on Contabo and I purchased 4 additional IP addresses for my server (5 in total).
My requirement is to seperate to 5 public IP addresses into multiple containers (1 public IP for many containers)
All container can connect to public internet and use port forwarding into each application inside container that need to access from internet.

From the image above, not sure this is the best way to do it or not. It's what I plan to config.
I have 5 public IP, 1 is main ip of the server and 4 more with different gateway (these 4 are in the same gateway which is 80.xxx.xxx.1)
Currently I configured in /etc/network/interface like this
Code:
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address 173.xxx.xxx.164/24
gateway 173.xxx.xxx.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
up ip route replace 173.xxx.xxx.0/24 via 173.xxx.xxx.1 dev vmbr0
auto vmbr1
iface vmbr1 inet static
address 80.xxx.xxx.97/24
gateway 80.xxx.xxx.1
bridge-ports eth0
bridge-stp off
bridge-fd 0
up ip route replace 80.xxx.xxx.0/24 via 80.xxx.xxx.1 dev vmbr1
auto pv1
iface pv1 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
auto pv2
iface pv2 inet static
address 20.20.20.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 '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A POSTROUTING -s '20.20.20.0/24' -o vmbr1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '20.20.20.0/24' -o vmbr1 -j MASQUERADE
And I config an LXC for pv1 like this and it can connect to internet just fine.

But I tried to config for pv2 like this and it can't connect to internet.

----------------------------------------------------------------
Please help me config the network for my need. I can reconfigure everything from the start if it should be.
Not sure that my requirements is clear enough, if you need more information, please let me know.
Thank you