Hi guys,
I have a server with 1 physical interface and 2 IPs. I'd like to use 1 bridge+NAT per public IP.
I use the following
Also here is my
Subnet 10.10.10.0/24 works while subnet 10.10.11.0/24 can't reach internet (but can ping any VM in 10.10.10.0/24 and 10.10.11.0/24).
I tried to add the gateway to alias eno1:0 => the exact same result.
How can I solve this problem?
I have a server with 1 physical interface and 2 IPs. I'd like to use 1 bridge+NAT per public IP.
I use the following
/etc/network/interface
Code:
# The primary network interface
auto eno1
iface eno1 inet static
address 193.161.118.14/24
gateway 193.161.118.1
# 2nd interface
auto eno1:0
iface eno1:0 inet static
address 193.161.118.25/24
# gateway 193.161.118.1
auto vmbr0
iface vmbr0 inet static
address 10.10.10.99/24
bridge-ports none
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
auto vmbr1
iface vmbr1 inet static
address 10.10.11.99/24
bridge-ports none
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.11.0/24' -o eno1:0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.11.0/24' -o eno1:0 -j MASQUERADE
Also here is my
/etc/ufw/before.rules
config
Code:
#NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Forward traffic through eth0 - Change to public network interface
-F POSTROUTING
-A POSTROUTING -s 10.10.10.0/24 -o eno1 -j MASQUERADE
-A POSTROUTING -s 10.10.11.0/24 -o eno1:0 -j MASQUERADE
#setup VMs port forwarding
:PREROUTING ACCEPT [0:0]
-F PREROUTING
Subnet 10.10.10.0/24 works while subnet 10.10.11.0/24 can't reach internet (but can ping any VM in 10.10.10.0/24 and 10.10.11.0/24).
I tried to add the gateway to alias eno1:0 => the exact same result.
How can I solve this problem?