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 : 

eth2 : 

Then i add a route for each interface :

route add -net netmask eth1 

route add -net netmask eth2

Finally,i'm trying to ping :

ping -I eth2 or ping -I eth1

Ping command reaches error : Destination Host Unreachable

Can anyone help me to fix this issue?

Thank you.

  • 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 -I eth2, then you ran ping -I eth1, not ping -I eth2 or ping -I eth1? Try running ping like this ping -I eth1 – evan.bovie Jul 6 '11 at 14:33

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.

| improve this answer | |

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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