How to troubleshooting failing ping to router on a linux box?

5,618

Solution 1

It turned out that my DIR-850L was to blame, I have replaced it with a Asus RT-AC66R and everything is working correctly as expected now.

Solution 2

I'm in doubt about 10.132.168.0.3's routing table:

default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s20u4

If host is not a router I prefer that routing table has only two rows in exactly this order:

192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1

Just try to remove old and create new routes.

Share:
5,618

Related videos on Youtube

ams
Author by

ams

I love software development.

Updated on September 18, 2022

Comments

  • ams
    ams almost 2 years

    I have a home network 192.168.0.x from which I am posting this message, on this network I have a CentOS7 host 192.168.0.3 which is running a DNS server for the network.

    I can ssh into 192.168.0.3 I can do nslookup to get the IP addresses of remote machines, but I can not ping my router.

    [root@san ~]# ping -c3 192.168.0.1
    PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
    
    --- 192.168.0.1 ping statistics ---
    3 packets transmitted, 0 received, 100% packet loss, time 1999ms
    

    Here is what arp reports

    [root@san ~]# arp
    Address                  HWtype  HWaddress           Flags Mask            Iface
    192.168.0.8              ether   b8:8d:12:20:36:6c   C                     eno1
    192.168.0.13             ether   c0:3f:d5:63:4e:1a   C                     eno1
    192.168.0.10             ether   c0:3f:d5:63:52:06   C                     eno1
    192.168.0.11             ether   c0:3f:d5:61:e8:54   C                     eno1
    192.168.0.7              ether   00:50:56:61:2b:75   C                     eno1
    192.168.0.12             ether   c0:3f:d5:63:19:71   C                     eno1
    192.168.0.1              ether   c0:a0:bb:f8:1f:d4   C                     eno1
    

    I can ping other machines on the network

    [root@san ~]# ping -c3 192.168.0.13
    PING 192.168.0.13 (192.168.0.13) 56(84) bytes of data.
    64 bytes from 192.168.0.13: icmp_seq=1 ttl=64 time=0.248 ms
    64 bytes from 192.168.0.13: icmp_seq=2 ttl=64 time=0.377 ms
    64 bytes from 192.168.0.13: icmp_seq=3 ttl=64 time=0.366 ms
    
    --- 192.168.0.13 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2000ms
    rtt min/avg/max/mdev = 0.248/0.330/0.377/0.060 ms
    

    Here is what route prints

    [root@san ~]# route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s20u4
    

    here is the ifconfig output

    [root@san ~]# ifconfig
    eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.0.3  netmask 255.255.255.0  broadcast 192.168.0.255
            inet6 fe80::c23f:d5ff:fe63:d1dd  prefixlen 64  scopeid 0x20<link>
            ether c0:3f:d5:63:d1:dd  txqueuelen 1000  (Ethernet)
            RX packets 6513  bytes 1321730 (1.2 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 15991  bytes 18326750 (17.4 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 20  memory 0xf7c00000-f7c20000  
    
    enp0s20u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.0.4  netmask 255.255.255.0  broadcast 192.168.0.255
            inet6 fe80::224:9bff:fe0b:ddf2  prefixlen 64  scopeid 0x20<link>
            ether 00:24:9b:0b:dd:f2  txqueuelen 1000  (Ethernet)
            RX packets 469  bytes 36166 (35.3 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 21  bytes 4155 (4.0 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            loop  txqueuelen 0  (Local Loopback)
            RX packets 2122  bytes 642922 (627.8 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 2122  bytes 642922 (627.8 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    Trying to ping google.com also fails even though the name resolution works.

    [root@san ~]# ping -c3 google.com
    PING google.com (74.125.226.134) 56(84) bytes of data.
    
    --- google.com ping statistics ---
    3 packets transmitted, 0 received, 100% packet loss, time 1999ms
    

    The router can be pinged from other machines on the network output below is from my mac book pro 192.168.0.8

    ping -c3 192.168.0.1
    PING 192.168.0.1 (192.168.0.1): 56 data bytes
    64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=1.794 ms
    64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=2.000 ms
    64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.986 ms
    
    --- 192.168.0.1 ping statistics ---
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 1.794/1.927/2.000/0.094 ms
    

    The router in my network is a D-Link DIR-850L and I have it configured to point at 192.168.0.3 as the DNS server for 192.168.0.x network. I also have the DNS server on 192.168.0.3 configured to forward to the google DNS servers 8.8.8.8.

    Why can't I ping 192.168.0.1 from 192.168.0.3 even though 192.168.0.3 is the primary DNS server I am using to post this question from my mac 192.168.0.8 which can browse anywhere on the net going through 192.168.0.3 as the DNS but when I am logged into 192.168.0.3 I can't ping 192.168.0.1 and can't go anywhere on the internet?

    • Raza
      Raza almost 10 years
      you router might blocking ping request. are you able to ping from 192.168.0.13?
    • beginer
      beginer almost 10 years
      @ams your router is configured to block icmp packets to itself and any traffic going through it, which is why you cant ping.
    • Anthon
      Anthon almost 10 years
      Is that router the D-Link DIR-850L (while searching DIRL-850, Google insists on making that Girl-850)?
    • ams
      ams almost 10 years
      @Anthon you are correct about the router being a D-Link DIR-850L
    • ams
      ams almost 10 years
      @beginer I can ping the router from other machines such as 192.168.0.8
    • beginer
      beginer almost 10 years
      @ams are you able to telnet from 192.168.0.3 to 0.1 on port 22 ? Also try telnet google.com 80 and telnet 8.8.8.8 53 from 0.3. Also please post the blocking configurations if any on your router.
  • ams
    ams almost 10 years
    the machine has two network cards en01 and enp0o20u4 I think this is why there are three lines. enp0s20u4 is a usb ethernet adapter when I unplug it the third line is removed but I still have the same problem.