I have two NIC Ethernet card (eth1 and eth2) on the same computer (linux) connected by a cross cable.

The two interfaces are on the same subnet :

eth1 : 192.168.200.1 255.255.255.0 

eth2 : 192.168.200.2 255.255.255.0 

Then i add a route for each interface :

route add -net 192.168.200.0 netmask 255.255.255.0 eth1 

route add -net 192.168.200.0 netmask 255.255.255.0 eth2

Finally,i'm trying to ping :

ping 192.168.200.1 -I eth2 or ping 192.168.200.2 -I eth1

Ping command reaches error : Destination Host Unreachable

Can anyone help me to fix this issue?

Thank you.

link|improve this question
Have you tried adding -r to the ping command? – ezpz Jul 6 '11 at 10:28
Are the interfaces UP? – Keith Jul 6 '11 at 11:24
Yes both interface are up and i also try option -r on the ping command.But unfortunately ping reach same error. – Monu Jul 6 '11 at 11:56
Why did you specify a route? Are you using a subnet that is configured elsewhere within your network? – cwawak Jul 6 '11 at 14:33
Did you run the route commands as root? Are those ping commands separate, as in, ping 192.168.200.1 -I eth2, then you ran ping 192.168.200.2 -I eth1, not ping 192.168.200.1 -I eth2 or ping 192.168.200.2 -I eth1? Try running ping like this ping -I eth1 192.168.200.2. – emb1995 Jul 6 '11 at 14:33
show 3 more comments
feedback

migrated from stackoverflow.com Jul 6 '11 at 14:22

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

To fix this issue, i use two virtual machine. And i can ping eth1 or eth2, with eth2 or eth1.

Thank you,all for yours comments and help.

link|improve this answer
feedback

Basically when u ping from your system, the source IP is set to INADDR_ANY. And when the kernel finds the destination IP to be on the same system, it will simply loopback it. Its using loopback (lo) interface.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.