Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
* [LARTC] mutiple gateways problem
@ 2006-04-15 22:57 Miguel Angel Rasero (TCOR)
  0 siblings, 0 replies; only message in thread
From: Miguel Angel Rasero (TCOR) @ 2006-04-15 22:57 UTC (permalink / raw)
  To: lartc

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-15 22:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-15 22:57 [LARTC] mutiple gateways problem Miguel Angel Rasero (TCOR)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox