OpenWrt Forum Archive

Topic: Bug MASQUERADE: Route sent us somewhere else.

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Are you trying to output traffic on two default routes? What are the conditions?

I have only one default route. My config is very simple:
#>ip route show
172.16.1.0/24 dev br1  proto kernel  scope link  src 172.16.1.15
192.168.10.0/24 dev tun0  proto kernel  scope link  src 192.168.10.1
default via 172.16.1.1 dev br1

NAT:
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o br1 -j MASQUERADE

Changing NAT from MASQUERADE to SNAT the problem disapear:
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o br1 -j SNAT --to 172.16.1.15

The discussion might have continued from here.