Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: network setup help
Date: Sun, 11 Apr 2004 00:59:05 +0100	[thread overview]
Message-ID: <200404110059.05382.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <00d001c41f54$2b238ac0$68892090@grouse>

On Sunday 11 April 2004 12:33 am, Jee J.Z. wrote:

> Hi Antony,

Thanks for getting the spelling right - lots of people round here don't :)

> > Look at the routing table of each machine the packets are going through,
> > and then the replies trying to get back again, and see if (a) there is a
> > path, and (b) it makes sense.
>
> Both PC2 and PC3's routing look like:
> Destination                Gateway                   Genmask
> Flags      Metric      Ref      Iface
> 192.168.0.0               0.0.0.0                     255.255.255.0
> U            0           0        eth1
> 144.32.xxx.0              0.0.0.0                     255.255.254.0
> U            0           0        eth0
> 127.0.0.0                  0.0.0.0                     255.0.0.0
> U            0           0         lo
> 0.0.0.0                     144.32.xxx.yyy           0.0.0.0
> UG           0           0        eth0

Okay, I'm assuming that 144.32.xxx.yyy is not the address of PC1 - it's 
something else which is connected to your switch - however that's not too 
important here.

Here's what I think is going on:

PC1 has a simple routing table saying "network 144.32.xxx.0/23 is on eth0, and 
the deafult gateway is 144.32.xxx.yyy".   That means if you ping 192.168.0.2 
from PC1 it will send the packets to the default gateway :(

Set a network route on PC1 to tell it how to find the 192.168.0.0/24 network, 
via PC2 as a router:

route add -net 192.168.0.0 netmask 255.255.255.0 gw 144.32.xxx.b

where 144.32.xxx.b is the IP address on PC2/eth0

Once you have done that I think the pings will work, however they will not 
work the way you would like them to :)

An echo request packet will come from 144.32.xxx.a (PC1/eth0) to 192.168.0.2 
and get routed (by your new routing table entry on PC1) via 144.32.xxx.b, 
where PC2 will decide "192.168.0.2? Oh, that's on my eth1", and will send it 
to PC2.

However, if PC2/eth0 is still operational and plugged in, it will think "I 
have to send an echo response packet to 144.32.xxx.a, and that's on this 
subnet connected to my eth0", so it will send the reply packet out through 
eth0.

This will actually work for pings, but it's not the way you want TCP packets 
to flow (remember that pings are ICMP packets), and it certainly won't work 
once you start doing nat on PC2 (which I assume, for some reason, that you do 
want to do?).

However, I still remain puzzled about why you have this crazy setup in the 
first place, and what you're trying to achieve by sending pings from PC1 to 
PC3 via PC2, so add the routing table entry to PC1, check whether a ping 
works (with all the cables plugged in, so all the paths shown on your 
original diagram are available), and then try to explain to us why you are 
doing things this way and what you want to achieve.

Regards,

Antony.

-- 
If at first you don't succeed, destroy all the evidence that you tried.

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-04-10 23:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-10 18:54 network setup help Jee J.Z.
2004-04-10 22:50 ` Antony Stone
2004-04-10 23:33   ` Jee J.Z.
2004-04-10 23:59     ` Antony Stone [this message]
2004-04-11  2:00       ` Jee J.Z.
2004-04-11  2:52         ` Antony Stone
2004-04-11 16:01           ` Jee J.Z.

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=200404110059.05382.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --cc=netfilter@lists.netfilter.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