Two interfaces on the same network

Al Al_chane at issc.com.tw
Wed Jun 9 18:00:42 UTC 2004


What makes me interesed is why Linux does this way but Windows not.
Let me simplify my test use ping program.
 
#1 PC: two interfaces, eth0 172.20.1.30 mac addr: aa:aa:aa:aa:aa:aa
                                   eth1 172.20.1.31 mac addr: bb:bb:bb:bb:bb:bb
 
#2 PC: one one interface with IP 172.20.1.32 mac addr: cc:cc:cc:cc:cc:cc
 
When I use #1 PC to ping #2 PC (172.20.1.32), #1 PC use eth0 for 
the outbound  ping  so I assume eth0 is the "defualt" interface.
 
When I use #2 PC to ping #1 PC's eth1 IP (172.20.1.31), arp request/reply
are like this:
 
>From #2 PC: who has 172.20.1.31, tell 172.20.1.32
>From #1 PC: 172.20.1.31 is at aa:aa:aa:aa:aa:aa  (<---why??)
>From #1 PC: 172.20.1.31 is at bb:bb:bb:bb:bb:bb
 
Two arp replies sent with different mac address.
 
If  #2 PC ping 172.20.1.31, even if the eth1's wire is unplug, it still repliess
and if eth0 wire is unplug. Ping 172.20.1.31 won't reply even if eth1's wire is plug.
So I think two interfaces on the same network, Linux only use it's "default" interface no matter what.
 
Howevee, If  change Linux to Windows. It seems work fine for me. That is, when (from 172.20.1.32)
ping 172.20.1.30, unplug 172.20.1.31's wire won't affect anything, and
ping 172.20.1.31, unplug 172.20.1.30's wire won't affect anything.
So I think this confirms that when ping 172.20.1.30, it replies from NIC with IP 172.20.1.30
when ping 172.20.1.31, it replies from NIC with IP 172.20.1.31.
 
 
thanks:)
 
AL 

	
	I do not really have the knowledge about routing to help you. However, I
	can suggest that you look for a way to get packets to be sent out on the
	same interface as they came in. Alternately, you could really make it
	accessible by wired *or* wireless and detect the link status. If there is
	an Ethernet cord and a wired link active, use that interface. If that link
	goes down, use the wireless. Make the wired link take priority for
	troubleshooting and setup.
	
	Surely you're not the first guy to have this problem, so the answer must be
	out there somewhere. Look for routing issues, mailing lists, etc. Check
	what other camera manufacturers have done (there are some based on Linux).
	And so on.
	
	Just some thoughts.
	
	Cheers,
	
	
	





More information about the redhat-list mailing list