[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Advanced Routing



I need some help to solve a routing problem..

I have a firewall, using NAT , and it have 2 internet conections, i has only one NIC, with several virtual ips, the list is:
eth0: 168.96.1.35  (Internet 1)
eth0:1 157.92.1.35 (Internet 2)
eth0:2 10.0.0.1 (local net)

default gateway 168.96.1.1

I want to NAT ftp conections over Internet 2 interface, i add this rule to iptables iptables -t nat -A POSTROUTING -s 10.0.0.0/16 -p tcp -m tcp --dport 20:21 -j SNAT --to-source 157.92.1.35

with this rule i can do nothing because it transform the source address to 157.92.1.35, but it tries to go out by 168.96.1.1, so i want to add another default gateway only when src ip is 157.92.1.35, i tried the following and it doesn't work

ip ro add default via 157.92.1.99 table ftp
ip ru add from 157.92.1.35 table ftp

and sometimes works and sometimes stop working...

Does anybody have an idea???





Reply to: