Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a linux machine with 2 ethernet ports(eth0 and eth1). eth0 is connected to a router which assigns it an IP address eth1 is connected to a switch which doesn't have an IP. How do I ping eth0 from eth1?

share|improve this question

migrated from Oct 20 '10 at 15:21

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

could you explain why you want to ping one interface from another interface on the same machine? – Marcel G Oct 20 '10 at 17:44

You can use the -I parameter, eg.

# ping -I eth1
share|improve this answer
as the # suggests, one needs to be root to do that. – Andre Holzner Feb 9 '11 at 12:07

If your eth1 doesnt have an IP, it will not be able to work with IP traffic (and ping / ICMP is IP traffic). Did I misunderstood your problem ?

Edit : I am not sure that I understand your network. Could you send a schema ?

If I understood correctly, you ahve eth0 configured with DHCP and eth1 configured manually. Are you sure that the address you have on eth1 is correct ? If you configured it as, you need to have y router with an interface in the same subnet, and the router has to be configured to route trafic from your to you networks.

share|improve this answer
You understood my problem. I assigned an IP using: "ifconfig eth1 netmask up". But still I can't ping. – Nitish Oct 20 '10 at 14:18
You understood my network correctly. What happens if I configure eth1 as What more should I do to make the ping work? – Nitish Oct 20 '10 at 14:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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