From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Miguel Angel Rasero (TCOR)" Date: Sat, 15 Apr 2006 22:57:57 +0000 Subject: [LARTC] mutiple gateways problem Message-Id: <44417A75.4050208@tcor.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hello, i have had a terribe day today, why? because i have been so 4 or 5 hours trying to do work this and i have not finished it. I feel very pleased if anything can help me. I have two isp connections: eth0: dhcp ip1: 82.198.*.* gw1: 82.198.*.* and a router adsl in ip 192.168.0.253: eth1: static ip2: 192.168.0.254 gw1: 192.168.0.253 the same machine has 3 more networks cards but i am using only 4 at this time: eth0: internet connection 1 eth1: network range 1 (192.168.0.0/24) and adsl internet connection 2 eth2: network range 2 (192.168.2.0/24) eth3: network range 3 (192.168.3.0/24) well i have created two tables in rt_tables like this: ---------------------- # # reserved values # 255 local 254 main 253 default 0 unspec # # local # #1 inr.ruhep 200 aulas 201 oficinas --------------------- and i have been trying to route from source to any or another table. ip rule add from 192.168.2.0/24 table aulas ip rule add from 192.168.3.0/24 table aulas ip route add default via 192.168.0.253 dev eth1 table aulas ip route add 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.254 table aulas ip route add 192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.254 table aulas ip route add 192.168.3.0/24 dev eth3 proto kernel scope link src 192.168.3.254 table aulas ip rule add fwmark 4 table aulas (this is for dport 80 marked with iptables go from adsl too) #oficinas ip rule add from 192.168.0.0/24 table oficinas ip route add default via 82.198.*.* dev eth0 table oficinas ip route add 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.254 table oficinas ip route add 192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.254 table oficinas ip route add 192.168.3.0/24 dev eth3 proto kernel scope link src 192.168.3.254 table oficinas ip route add 82.198.*.*/25 dev eth0 proto kernel scope link src 82.198.*.* table oficinas $IPTABLES -t nat -A POSTROUTING -s 192.168.0.0/24 -d ! 192.168.0.0/16 -j MASQUERADE $IPTABLES -t nat -A POSTROUTING -s 192.168.2.0/24 -d ! 192.168.0.0/16 -j MASQUERADE $IPTABLES -t nat -A POSTROUTING -s 192.168.3.0/24 -d ! 192.168.0.0/16 -j MASQUERADE well i know the iptables can become more specific with snat but i have tried too. The rules works because if i delete the local range routes i havent get response from lan packets too so it is classified correctly but only works the gateway that its in default route in the main table, if i delete the default main no one range works, if i use the eth0 default only table oficinas works and if i use default eth1 only aulas table works. I have tried with nexthop adding the two gateways in default but it doesnt works well either. Can anyone help me please? Software Versions: Distro: Debian Testing Kernel: 2.4.32 iptables: 2.3.3 iproute2-ss051007 Thanks in advance. _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc