2

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.

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

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

  • 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. – evan.bovie Jul 6 '11 at 14:33
1

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.

1

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.

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.