I have the following situation on my host:      veth5     10.0.0.3        o          |   ------------    -----------------                    eth0   |   br0    |----|--o         o--|----o           o------o------ internet   ------------    | veth3   veth6 | veth7         ppp0                   |               |            192.168.0.2                    |   namespace   |                   -----------------The routing configuration has been made using policy based routing.According to that, a packet sent from the host to the Internet (e.g., using ping) enters into my network through veth5, then goes in the namespace. From here, it is forwarded to veth7, then to ppp0 and reaches the Internet. I want to configure a NAT rule that masquerades all the internal IP address using the ppp0 IP (192.168.0.2).I have then added the rule using iptables$ iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADEHowever, my packets reaches eth0 without being masqueraded by the rule above.EDITThe output of tcmpdump of vethW and eth0 is:Output of ip link:Output of ip -4 addr:Output of conntrack -L:pinging Internet from the hostpinging Internet from the namespacepinging Internet from the host,after adding a nat rule into the namespaceDoes someone know the reason?Thanks in advance for the help.
NAT rule doesn't work
networking;routing;nat