Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: "suresh" <super772002@yahoo.com>
To: lartc@vger.kernel.org
Subject: [LARTC] routing problem
Date: Tue, 05 Mar 2002 03:55:50 +0000	[thread overview]
Message-ID: <marc-lartc-101530055025659@msgid-missing> (raw)

Hello All,

I have routing problem using Adv Routing.
Let me explain with exact flow of packets in my LAN to INTERNET

                I N T E R N E T
                /                     \
    -------------             -------------
    | a.b.c.e      |              | w.x.y.u     |
    |  router1    |              |   router2    |
    -------------             -------------
               \                   /
                \                /
                 \             /
                  -----------
                  |   Switch  |
                  -----------
                       |
                       |
                       |
                      eth1                eth1 a.b.c.d     gw a.b.c.e
                 --------------       eth1:0 w.x.y.z  gw w.x.y.u
                 |                   |
                 |    linux        |
                 |                   |
                 --------------        eth0 172.16.1.1
                    eth0                    eth0:0 192.168.1.1
                        |
                        |

I want to forward all packet from 172.16.1.0/24 Network to router 1
and from 192.168.1.0/24 Network to router2.

In the linux box i am doing advance routing and iptables.
Here i am using iptables just for masquerading
the rules are
#/sbin/iptables -t nat -A POSTROUTING -o eth0 -p icmp --icmp-type ping -s
0/0 -d  0/0 -j MASQUERADE
#/sbin/iptables -t nat -A POSTROUTING -o eth0 -p tcp -s 0/0 -d 0/0 -j
MASQUERADE

Linux box's default gw is w.x.y.u and i added only following command

#echo 200 isp1 >> /etc/iproute2/rt_tables
#ip rule add from 172.16.1.0/24 table isp1
#ip rule ls
0:      from all lookup local
32765:  from 172.16.1.0/24 lookup isp1
32766:  from all lookup main
32767:  from all lookup default

#ip route add default via a.b.c.e dev eth1 table isp1
#ip route flush cache

It is not forwarding if packet from 172.16.1.0/24 but works fine if packets
from 192.168.1.0/24.

If i delete default gw and ip rule and add a.d.c.e as default gw than
packets from both networks forwarded to router1.
#ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:06:5b:38:99:a8 brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.1/24 brd 172.16.1.255 scope global eth0
    inet 192.168.1.1/24 brd 190.190.1.255 scope global eth0:0
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:06:5b:38:99:a9 brd ff:ff:ff:ff:ff:ff
    inet a.b.c.d/28 brd *.*.*.* scope global eth1
    inet w.x.y.z/28 brd *.*.*.* scope global eth1:0

# ip route
*.*.*.*/28 dev eth1  proto kernel  scope link  src a.b.c.d
*.*.*.*/28 dev eth1  proto kernel  scope link  src w.x.y.z
172.16.1.0/24 dev eth0  proto kernel  scope link  src 172.16.1.1
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.1
127.0.0.0/8 dev lo  scope link
default via w.x.y.u dev eth0


Thanks
Suresh



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2002-03-05  3:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-05  3:55 suresh [this message]
2002-03-05 17:28 ` [LARTC] routing problem Ard van Breemen
2002-03-06  6:44 ` suresh
2002-11-20 17:31 ` [LARTC] Routing problem Mauro Cerboni
2002-11-22  0:03 ` Jose Luis Domingo Lopez
2002-11-22  0:32 ` George J. Jahchan, Eng.
2002-12-17 16:53 ` [LARTC] ROUTING Problem Andre Lorenz
2003-09-05 16:12 ` [LARTC] Routing problem gaston
2003-09-07 23:03 ` Damion de Soto
2003-09-08  6:41 ` Ronny Aasen
2003-09-08 14:46 ` gaston
2003-09-09 13:59 ` gaston
2003-11-10 12:29 ` [LARTC] routing problem Meretei Balázs
2003-11-10 23:55 ` Damion de Soto
2003-11-11  4:22 ` Martin A. Brown
2004-04-06 11:09 ` [LARTC] Routing problem huffo
2004-04-06 12:28 ` huffo
2004-04-06 23:32 ` Damion de Soto
2004-04-07  1:16 ` huffo
2004-04-07  1:26 ` huffo
2006-12-12 13:07 ` [LARTC] Routing Problem Javier A Toledano
2006-12-13 15:05 ` Taylor, Grant

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=marc-lartc-101530055025659@msgid-missing \
    --to=super772002@yahoo.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox