Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Ard van Breemen <ard@telegraafnet.nl>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] routing problem
Date: Tue, 05 Mar 2002 17:28:03 +0000	[thread overview]
Message-ID: <marc-lartc-101534940518510@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101530055025659@msgid-missing>

On Tue, Mar 05, 2002 at 09:25:58AM +0530, suresh wrote:
> 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
>                         |
>                         |
Rephrased: eth0 is local, eth1 is internet?
eth0: 172.16.1.1/24 and 192.168.1.1/24
eth1: w.x.y.z/28 and a.b.c.d/28

> 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
So you are really masquerading internet traffic, so that traffic from
the internet looks like local traffic?
Don't you mean:
/sbin/iptables -t nat -A POSTROUTING -o eth1 -p icmp --icmp-type ping -s  0/0 -d  0/0 -j MASQUERADE
In other words: icmp traffic going to the internet should be masqueraded?

But now for the next thing in problem solving:
1) flush your iptables.
2) start these:
tcpdump -n -e -i eth0
tcpdump -n -e -i eth1

3) ping from the 192.168.1.0 network a few times (it will not be answered).
Watch the outgoing traffic on eth1
4) ping from the 172.16.1.0 network a few times.
Watch the outgoing traffic on eth1

At this point it should start sending the icmp request to the different
routers. The *only* way to notice this is the mac address to which it
is sent!

If that is correct, then your ip stuff is correct. Your next target is
the iptables.

Enter this:
/sbin/iptables -t nat -A POSTROUTING -o eth1 -p icmp --icmp-type ping -s  0/0 -d  0/0 -j MASQUERADE

And try the pings again. Watch the mac, and the ip addresses.
You will see that masqueraded packets "arive" to times at the interface,
once masqueraded, and once demasqueraded.

If one of these steps does not do as I say, please cut and paste your
terminal output.
(That means tcpdumps etc...)
-- 
<ard@telegraafnet.nl> Telegraaf Elektronische Media  http://wwwijzer.nl
http://leerquoten.monster.org/ http://www.faqs.org/rfcs/rfc1855.html 
Let your government know you value your freedom. Sign the petition:
http://petition.eurolinux.org/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2002-03-05 17:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-05  3:55 [LARTC] routing problem suresh
2002-03-05 17:28 ` Ard van Breemen [this message]
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-101534940518510@msgid-missing \
    --to=ard@telegraafnet.nl \
    --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