-1

when I try to ping my newly created server it shows:

vasanth@vasanth-client:~$ ping -c 4 server.ip.name
PING server.ip.name (server.ip.address ) 56(84) bytes of data.

--- server.ip.name ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3055ms

when I check ICMP is allowed it shows:

[root@vasanth-server ~]$ firewall-cmd --query-icmp-block=echo-request
no

firewall zone status:

[root@vasanth-server ~]$ firewall-cmd --list-all-zones
....
....

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources: 
  services: cockpit dhcpv6-client http https ssh
  ports: 3306/tcp 33060/tcp 8082/tcp 6666/tcp 7777/tcp 4444/tcp 12345/tcp
  protocols: 
  forward: yes
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

....
....

can somebody explain why I can't ping my server?

  • 1
    Assuming that your server is indeed online either the server itself blocks pings (firewall, `/proc/sys/net/ipv4/icmp_echo_ignore_all` kernel sysctl tunable) or something along the path (your firewall, provider firewall or similar cloud providers security groups) blocks ping/ICMP echo reply requests. – HBruijn Mar 23 '23 at 15:03

1 Answers1

0

Hey, can you ping from the server to another domain like google.com? If not, please double-check your network settings. Check lists:

  • Your IP and gateway must have a valid subnet mask in the nmtui settings or any other tool or configuration file you use.

Alternatively, use the following commands to enable ICMP:

  • iptables -A {INPUT|OUTPUT} -p icmp -j {ACCEPT|REJECT|DROP}
  • iptables -A {INPUT|OUTPUT} -p icmp --icmp-type {0|8} -j {ACCEPT|REJECT|DROP}
  • iptables -A {INPUT|OUTPUT} -p icmp --icmp-type {echo-reply|echo-request} -j {ACCEPT|REJECT|DROP}
  • iptables -A {INPUT|OUTPUT} -p icmp --icmp-type {echo-reply|echo-request} -m state --state NEW,ESTABLISHED,RELATED -j {ACCEPT|REJECT|DROP}

Note: Make sure you check your internet connection of server or your device. If it is VM check your network adapter setting (VMWare/OracleVB) or Virtual switch (Hyper-V)

  • Hi @Masab Bin Zahid Yes I can ping from the server to another domain like google. – Vasanth Vel Mar 23 '23 at 07:43
  • Then its your firewall issue. allow icmp or try to telnet any port which is open. You can scan network using nmap to check if ports are allowing any connection. – Masab Bin Zahid Mar 24 '23 at 11:15