The network works fine but can't ping any address?
I try to set up my Linux server's network, but the ping command doesn't work, although I could use wget, it indicated the network is fine, but I can't figure out why the ping command doesn't work as it should.
I am using centOS 7.9, here is the network setup information:
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 58.206.100.50 netmask 255.255.240.0 broadcast 58.206.111.255 inet6 fe80::ec4:7aff:fe32:9d37 prefixlen 64 scopeid 0x20<link> ether 0c:c4:7a:32:9d:37 txqueuelen 1000 (Ethernet) RX packets 2666737 bytes 4007065931 (3.7 GiB) RX errors 12 dropped 0 overruns 0 frame 7 TX packets 1749153 bytes 136913527 (130.5 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xce100000-ce17ffff
[wuzhenqun@localhost ~]$ ping 58.206.96.1
PING 58.206.96.1 (58.206.96.1) 56(84) bytes of data.
64 bytes from 58.206.96.1: icmp_seq=1 ttl=255 time=0.205 ms
64 bytes from 58.206.96.1: icmp_seq=2 ttl=255 time=0.170 ms
^C
--- 58.206.96.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.170/0.187/0.205/0.022 ms
[wuzhenqun@localhost ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 58.206.96.1 0.0.0.0 UG 100 0 0 enp5s0
58.206.96.0 0.0.0.0 255.255.240.0 U 100 0 0 enp5s0I also try the dig command, it seems the DNS server is set right.
Here is the result when I try to ping intel.com and 1.1.1.1.
[wuzhenqun@localhost ~]$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
^C
--- 1.1.1.1 ping statistics ---
144 packets transmitted, 0 received, 100% packet loss, time 142999ms
[wuzhenqun@localhost ~]$ ping intel.com
PING intel.com (13.91.95.74) 56(84) bytes of data.
^C
--- intel.com ping statistics ---
47 packets transmitted, 0 received, 100% packet loss, time 45999msHere is the result of traceroute 1.1.1.1:
[wuzhenqun@localhost ~]$ traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets 1 gateway (58.206.96.1) 17.524 ms 17.568 ms 17.630 ms 2 * * * 3 10.6.20.54 (10.6.20.54) 1.416 ms 1.631 ms 1.644 ms 4 * * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *My question is:
Why does the ping command doesn't work?
1 Answer
1.) Many big providers have ping disabled, so it's not uncommon that ping wouldn't work.
2.) You have to check your firewall if ICMP packets are allowed, and same on the router side.
3.) Check if selinux is active in enforcing mode.
4.) To start discovering a problem start first with pinging localhost, then some device IP in local network, then router IP (up to this point looks like it's working), then IP from the same network of your router, then proceed with actual domain names. If unsure of your IP (google what is my ip). And then you can ping some computers from same network (change last 3 digits of IP address).