All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Miguel Angel Rasero (TCOR)" <mrasero@tcor.net>
To: lartc@vger.kernel.org
Subject: [LARTC] mutiple gateways problem
Date: Sat, 15 Apr 2006 22:57:57 +0000	[thread overview]
Message-ID: <44417A75.4050208@tcor.net> (raw)

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

                 reply	other threads:[~2006-04-15 22:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44417A75.4050208@tcor.net \
    --to=mrasero@tcor.net \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.