Ubuntu – Cannot ping static ip on eth1

11.04networking

I am trying to ping the network interface I have set up for eth1. This is my config:

auto eth1
iface eth1 inet static
  address 192.168.1.2
  netmask 255.255.255.0
  gateway 192.168.1.1
  broadcast 192.168.1.255

If I ping 192.168.1.2, I get:

Ping 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
From 192.168.1.3 icmp_seq=3 Destination Host Unreachable

Results of ifconfig tell me that the IPv4 address is 192.168.1.3. I can ping this ip. Bcast and Mask are as expected (same as in definition).

I can ping 192.168.1.3 from my macbook. I cannot ping 192.168.1.2 locally or from my macbook. Any ideas why?

Best Answer

ping is an application, considering this it needs an existing connection between the sender and receiver, in other words a routing path; since you specify a gateway in your setup it means that everything that is send or received by 192.168.1.2 has to pass through 192.168.1.1, and if 192.168.1.1 it's not present in your topology you simply do not will have any connection at all from 192.168.1.2 .

Related Question