Hello this problem occurs on all our ovh servers, when we try to use ifupdown2 the iptables NAT directives are ignored. This is the typical configuration:
Code:
auto lo
iface lo inet loopback
iface enp5s0f0 inet manual
iface enp5s0f1 inet manual
iface enp7s0f3u2u2c2 inet manual
auto vmbr1
iface vmbr1 inet static
address 172.16.1.2/16
bridge-ports enp5s0f1
bridge-stp off
bridge-fd 0
pre-up ifconfig enp5s0f1 mtu 9000
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '172.16.1.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '172.16.1.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
# Allow NAT working with the built-in firewall
auto vmbr0
iface vmbr0 inet dhcp
bridge-ports enp5s0f0
bridge-stp off
bridge-fd 0