# it doest't ping my router correctly

## eleanor

I have problems with my network. This is my route -n configuration:

Destination gateway genmask flags use iface 

 192.168.1.0 0.0.0.0 255.255.255.0 U 0 eth0 

 127.0.0.0 127.0.0.1 255.0.0.0 UG 0 lo

When I tryed to ping 192.168.1.3 (my comp IP) it pinged it OK, but the problem is when I tryed to ping 192.168.1.1 (my router IP), it did not work properly. It gave me an error that the destination host is unreachable. I set everything correctly and it should work, but is don't. Does anybody know what the problem is?

----------

## smutt

As far as your Linux box is concerned there is no difference between .1 and .3.  Check to make sure there is no problem with your router.  If everything looks good there then check out your arp entries with 

```

arp -a

```

This will show you what arp entries you have.  If you know the MAC address of the interface on your router you can manually enter an arp entry with 

```
 

arp -s 192.168.1.1 (ROUTERMAC)

```

This will help if for some reason your Linux box can't arp for the MAC address of the router.

And of course you can always use a sniffer as well.

Can you ping the router from other hosts on the same subnet as your Linux box?

--Smutt

----------

## eleanor

My router work just fine. This doesn't seem to work. I did this arp -s 192.168.1.1 (ROUTERMAC)  and still don't work. Now if I use arp -a I get this:

?  (192.168.1.1) at 00:0A:CD:05:E2:82 {ETHER} PERM on eth0

Can you help me?

----------

## eleanor

Anybody?

----------

## smutt

Did you look at your arp entries before you added the permanent one?  It would be interesting to know whether the Linux box can get the MAC via arp normally.

Also have you tried pinging the router from another host on the same subnet?  

--Smutt

----------

## eleanor

Before I added the permanent one (arp), there in arp -a was nothing. I don't really know if this is normal, but can you explain it to me?

The router pings nornally when I ping it from another host in tha same subnet.

Do you have any oter idea what to do, that this will work?

----------

## befa

you got to add a default gateway in your comp route-table to your router

```
 route add default gw ip_router
```

tell us if it's the solution...

p.s: sorry for my bad english  :Wink:  i try my best to improve it!  :Smile: 

----------

## smutt

When you send IP traffic(like ping) your Linux box first arp's to get the MAC address of the device you are sending to.  It broadcasts a query to all devices locally attached asking who has the destination IP address.  Then it encapsulates the IP packet in an Ethernet frame with the MAC address it got from the arp.  If the dest device is not on the same subnet as you then it asks for its gateways MAC.

These arp entries are stored in a table in the Linux kernel and timeout after a while.  To see if your Linux box is getting a reply from your router attempt a ping first and then arp -a immediately afterwards.  If there is something in the arp table that means your Linux box got a reply from the router when it queried for the router's IP via arp.  So do you see anything in your arp table?

Some more questions:

Can you ping other devices on the same subnet from your Linux box?

What devices are between your router and your Linux box?

--Smutt

----------

## eleanor

After pimgimg my router (a92.168.1.1) there is something in arp -a (but before there wasn't). Its this:

?    192.168.1.1     at     <incomplete>      on    eth0

I can ping my computers IP (192.168.1.3) normally and I can't ping other computers in my network (because they are connected into router - all the computers in my subnet is connected directly into router and the router is the reason for failure of pinging other computers, because the command must passed router, which in this care don't seem to be working).

----------

## eleanor

I figured something. My MAC address is 00:0A:CD:05:E2:82, but in my ifconfig, there are line that is like this: HWaddr 00:0C:29:89:D8:E5. Maybe that is the problem, that the eth0 has wrong MAC address. But I entered mine real MAC address, I don't kno ehere this come from. Does this help a bit, do you know what the problem is?

----------

## OdinsDream

Is your router set to reply to pings?

----------

## eleanor

Yes it is. It ping just fine under other computers. Any idea what to do?

----------

## eleanor

Does anybody even have a clue what the problem might be, that I at least know what the problem is? A router can't be the problem, bacause it is workinig just fine!

----------

## eleanor

I just remembered one information that might help, but I am not sure. On my network, I don't run dhcp, for avtomatic configuration of IP addresses, I configured them by hand. Does this help a bit? I really need this to work!! I would appreciate some answers.

----------

## OdinsDream

Is the gateway set up correctly? I'm at a loss... sorry! Could you try using DHCP for awhile to see if it fixes your problem?

----------

## befa

can you put your 

```
 /etc/conf.d/net
```

check if you have that line [code] gateway="eth0/192.168.1.1"

if not add it then restart your network

[code]/etc/init.d./net.eth0 restart[/code]

----------

## eleanor

I have that line, still doesn't work. Any new ideas? And even the dhcp doesn't work, so that isn't the problem.

----------

## befa

is your router a gateway aswell?

----------

## eleanor

Yes it is!

----------

## befa

you have iptables on your gateway?

----------

## OdinsDream

I think this thread is lacking a solid understanding of your network layout. Can you describe it from the source to your computer? What devices do you have, and how are they plugged in to one another?

----------

## eleanor

Iptables hmmmmmm, I don't know. I don't even know, what this is! My router is working just fine and it understannds just fine with my computer, because my network on comuter is workink correctly (BTW: I run gentoo linux with vmware in this computer on whis network is working just fine).

----------

## OdinsDream

Ah! VMware may be your issue! It handles networking by acting as its own NATed network. I'm not sure if it passes pings along correctly.

----------

## eleanor

Yes I am aware of that, but it should still work. If not pinging, the WAN would have to work.

----------

## OdinsDream

I haven't used VMware in quite some time, but I'd suggest reviewing the VMware network settings, also make sure that the virtual IP address of your virtual Gentoo installation is on a different subnet from your actual private IP addresses.

----------

## eleanor

I don't understand one thing and IO hope you would explain it to me. When I booted gentoo from livecd in vmware, the network was working just fine. And when I booted gentoo (already installed) I configured the same options as in livecd and it didn't work. So why it would be that poblem: make sure that the virtual IP address of your virtual Gentoo installation is on a different subnet from your actual private IP addresses.

----------

## eleanor

Hmmm, can somebody explain it to me?

----------

## OdinsDream

I've always had bad luck with multiple NATs when they all use IP addresses in the same subnet (say, 192.168.2.X). I'm really not sure how VMware sets this up by default, but I'd guess that this has something to do with your problem. Just a thought.

----------

