iptables SNAT failing to work on second gateway.
admin at isawgodtoday.info
Sun Jan 11 04:34:05 UTC 2009
i have two gateways.
gateway 1 == eth1
gateway 2 == ppp0
lan == eth0
eth1 is the deafault gateway(i do not want to change the deafault gateway)
SNAT works fine if i use eth1 and it's ip.
It fails when i try to use ppp0 and it's ip.
here is a screenshot that shows what is not working
how ever i kinda get it working when i do this(trying to force it's hand)
iptables -A PREROUTING -t mangle -i eth0 -s 192.168.1.102 -j MARK
iptables -t nat -A POSTROUTING -s 192.168.1.102 -o ppp0 -j SNAT
ip rule add fwmark 1 table TPG
ICMP echo req (60 bytes) from 192.168.1.102 to 220.127.116.11 on eth0
ICMP echo req (60 bytes) from 60.241.215.xxx to 18.104.22.168 on ppp0
ICMP echo rply (60 bytes) from 22.214.171.124 to 60.241.215.xxx on ppp0
so it gets close in that case but it will not forward the reply to
other info that might be of use:
root at 1:~# uname -r
i've patched kernel with http://www.ssi.bg/~ja/patch-2.6.27-ja1.diff
made no difference.
same result when useing MASQUERADE
i hope this is enough infromation
More information about the ubuntu-users