* [LARTC] Layer jump in Linux?
@ 2002-04-23 23:36 Jose Celestino
2002-04-24 19:21 ` Julian Anastasov
0 siblings, 1 reply; 2+ messages in thread
From: Jose Celestino @ 2002-04-23 23:36 UTC (permalink / raw)
To: lartc
First of all sorry if this is not the right list for this question/doubt.
I noticed a while ago that I can ping a machine on a diferent network, with no
IP on that network, if I have a network interface on the same broadcast domain
as that machine's interface if I add a route to that IP through the local IP in
the same broadcast domain.
Did I make myself clear ? :)
Well, what I have is this:
/--------\
| | /--------\
| Linux1 |-- aaa.bbb.ccc.ddd/24 -----| Switch |
| | \--------/
\--------/ |
|
eee.fff.ggg.hhh/24
|
/---------\
| |
| Linux2 |
\___________/
(aaa.bbb.ccc.0) != (eee.fff.ggg.0)
Linux1 should not be able to ping Linux2 except through a gw, right?
(They're not on the same network so the packet should go through the
default gw if a less generic route isn't defined, of course)
And the packet should go on until it reached a router/gw with a IP
on the eee.fff.ggg.0/24 net and it would then be delivered to
eee.fff.ggg.hhh.
The problem is that the linux stack seems to completely "short circuit"
from layer 3 to layer 2 if I add a gw to eee.fff.ggg.hhh through
aaa.bbb.ccc.ddd (route add -host eee.fff.ggg.hhh gw aaa.bbb.ccc.ddd);
it issues an arp request regardless if the destination
IP is on the local network or not.
Is this a correct behaviour? Am I missing something?
Note: this only happens between 2 linuxes, I tried between 2 FreeBSDs
but the IP stack behaves diferently.
TIA.
--
Jose Celestino <japc@co.sapo.pt> Systems::SAPO.pt http://www.sapo.pt
---------------------------------------------------------------------
Titanic 1912 / Hindenburg Zeppelin 1937 / Microsoft Windows 2000
OpenBSD claudia 3.0 GENERIC#94 i386
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [LARTC] Layer jump in Linux?
2002-04-23 23:36 [LARTC] Layer jump in Linux? Jose Celestino
@ 2002-04-24 19:21 ` Julian Anastasov
0 siblings, 0 replies; 2+ messages in thread
From: Julian Anastasov @ 2002-04-24 19:21 UTC (permalink / raw)
To: lartc
Hello,
On Wed, 24 Apr 2002, Jose Celestino wrote:
> I noticed a while ago that I can ping a machine on a diferent network, with no
> IP on that network, if I have a network interface on the same broadcast domain
> as that machine's interface if I add a route to that IP through the local IP in
> the same broadcast domain.
Yes, if you are using a gateway for some network the gateway
can send you ICMP redirect to tell you that this network is directly
reachable and you better to talk directly instead of using me (the
gateway).
> Linux1 should not be able to ping Linux2 except through a gw, right?
Only if:
1. You stop the ICMP redirects in your gateway
2. You stop accepting these redirects in your host
But for the hosts and networks that you use route via
local IP on interface you don't use gateway, so no ICMP redirects
should be received. You are probing these IPs via ARP.
> (They're not on the same network so the packet should go through the
> default gw if a less generic route isn't defined, of course)
Until you are redirected from the gateway
> And the packet should go on until it reached a router/gw with a IP
> on the eee.fff.ggg.0/24 net and it would then be delivered to
> eee.fff.ggg.hhh.
If your host does not believe to these ICMP redirects.
> The problem is that the linux stack seems to completely "short circuit"
> from layer 3 to layer 2 if I add a gw to eee.fff.ggg.hhh through
> aaa.bbb.ccc.ddd (route add -host eee.fff.ggg.hhh gw aaa.bbb.ccc.ddd);
> it issues an arp request regardless if the destination
> IP is on the local network or not.
In this case your host will probe via ARP only .hhh but the
packets to the other hosts from eee.fff.ggg/24 net should go
to gateway until redirected.
> Is this a correct behaviour? Am I missing something?
Looks correct.
> Note: this only happens between 2 linuxes, I tried between 2 FreeBSDs
> but the IP stack behaves diferently.
May be different settings. It is completely valid one
host to be able to talk with networks without using IP from them.
You need the help from routes or from gateway.
> TIA.
Regards
--
Julian Anastasov <ja@ssi.bg>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-24 19:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-23 23:36 [LARTC] Layer jump in Linux? Jose Celestino
2002-04-24 19:21 ` Julian Anastasov
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.