*duplicate* Iptables NAT not working for vmbr with a bridged port

flexu

New Member
Nov 16, 2022
17
1
3
I have the current setup, which after two days of trying should be correct. I can't get the iptables nat config to redirect traffic from either my vlan or the interface vmbr1 at all. At this point I can't see any other option...

Code:
auto lo
iface lo inet loopback

iface enp2s0f0 inet manual

iface enp2s0f1 inet manual

iface ens2f0 inet manual

iface ens2f1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 109.230.xxx.xxx/29
        gateway 109.230.xxx.xxx
        bridge-ports enp2s0f0
        bridge-stp off
        bridge-fd 0
#        bridge-ports ens2f0

auto vmbr1
iface vmbr1 inet static
        address 10.1.0.1/16
        bridge-ports ens2f1
        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.0.0.0/16' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/16 ' -o vmbr0 -j MASQUERADE
#10 gig cluster network

auto vmbr1.10
iface vmbr1.10 inet static
        address 10.0.0.1/16


Test LXC with following config:
1668954835758.png

produces the following results:

Code:
v:~# ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: seq=0 ttl=64 time=0.126 ms
64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.098 ms
^C
--- 10.0.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.098/0.112/0.126 ms
v:~# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
I have no idea on how to proceed from here...
 
Last edited:
sorry forum mods, this post keeps appearing and disappearing, please just delete it...