2 ip adresses, different subnet, ping reply from ip in other subnet ?

2 ip adresses, different subnet, ping reply from ip in other subnet ?

Post by Tom Van Overbek » Tue, 18 Feb 2003 19:08:45



Hi,

I have a linux server with 2 nic's both in a separate subnet (172.21.3.x
and 192.168.10.x).

the 192.168.10.x is connected to another server via a crossed utp cable.
the 172.21.3 is our local lan.

if i ping the 192.168.10.x interface on the server from my local
workstation (which is in the 172.21.3.x range), i get an immediate reply.

How does this happen ? does the linux server hear the request for
192.168.10.x on his 172.21.3.x interface and thinks, "hey, that's my other
interface, i'll reply" ?

in the routing table, there is no reference to the 192.168.10.x subnet,
and our default gateway also doesn't know about this subnet.

if my assumptions are correct, is it possible to stop the linux server
from responding to icmp queries not directed to its correct (same subnet)
interface ?

I don't use iptables (yet). i noticed the same behaviour with the
/proc/sys/net/ipv4/ip_forward parameter either set to 0 or 1.

Thanks,

Tom.

 
 
 

2 ip adresses, different subnet, ping reply from ip in other subnet ?

Post by Manue » Wed, 19 Feb 2003 01:24:23




Quote:> Hi,

> I have a linux server with 2 nic's both in a separate subnet (172.21.3.x
> and 192.168.10.x).

> the 192.168.10.x is connected to another server via a crossed utp cable.
> the 172.21.3 is our local lan.

> if i ping the 192.168.10.x interface on the server from my local
> workstation (which is in the 172.21.3.x range), i get an immediate reply.

> How does this happen ? does the linux server hear the request for
> 192.168.10.x on his 172.21.3.x interface and thinks, "hey, that's my other
> interface, i'll reply" ?

I guess it's because both NICs is on the server which will also check the
192.x network before going to the default gateway.

Quote:> in the routing table, there is no reference to the 192.168.10.x subnet,
> and our default gateway also doesn't know about this subnet.

> if my assumptions are correct, is it possible to stop the linux server
> from responding to icmp queries not directed to its correct (same subnet)
> interface ?

You can use iptables to block all ICMP request or reply to a specific IP
address or IP block.
Quote:> I don't use iptables (yet). i noticed the same behaviour with the
> /proc/sys/net/ipv4/ip_forward parameter either set to 0 or 1.

> Thanks,

> Tom.