On Wed, 22 Oct 2003 12:31:55 +0400
Selentek 24331-03 <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Network question:
> 
> I have a computer with two network devices: eth0, eth1
> 
>...
> 
> Question: Why pinging 192.168.1.12 from 5.5.5.138 is Ok ?
> 
> tcpdump of .12
> sudo /usr/sbin/tcpdump -f -i eth0 icmp
> tcpdump: listening on eth0
> 12:41:12.351814 5.5.5.138 > 192.168.1.12: icmp: echo request
> 12:41:12.351847 192.168.1.12 > 5.5.5.138: icmp: echo reply
> 
> Is it right to allow any ip on computer over any device ?
> 
> Thanks.

I believe under Linux the IP is not owned by the device, but by the host itself.
The host owns the IP address, and it may receive packets destined for it over
any interface. I do not know your network setup, and don't know why a packet
to 192.168.1.12 would be routed to 5.5.5.138.

However, the following scenario is perfectly valid:

CompA with eth0 IP 192.168.1.1 and eth1 IP 192.168.10.1
CompB with eth0 IP 192.168.1.2 and eth2 IP 192.168.10.2

192.168.1.0/24 is one subnet
and 192.168.10.0/24 is another subnet, and compA and compB are both connected
to the properly on each subnet (as determined by their IP addresses.)

Then performing a ping from say compA to compB, with default routes setup:
compA $ ping 192.168.1.2
would cause the echo request to travel from eth0 on compA to eth0 on
compB and the echo reply would take the same route back however.


However doing something like this is valid:
compA $ route add -host 192.168.1.2 gw 192.168.10.2
This would cause
compA $ ping 192.168.1.2
to send the echo request over compA eth1 to compB eth1,
but compB would echo reply from compB eth0 to compA eth0...

If Linux sees a packet come in on any interface, and it determines it
owns the IP, it will accept it.

Leendert

--
[EMAIL PROTECTED] mailing list

Reply via email to