What you will need is to use source routing with iproute2. You will need to set up multiple (2) routing tables, each table having the default gateway for the chosen interface, and a route for the other public IP and the 10.0.0.0 block. Then you use rules that determine which routing table to use (and thus interface / network) based on source IP or other matches.
http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/iproute2.html -- Jon On Fri, 23 Jul 2004 11:48:51 -0300, Mariano Wahlmann <[EMAIL PROTECTED]> wrote: > 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??? > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]