GNU/Linux >> Linux Esercitazione >  >> Cent OS

ping non funziona su un server CentOS/RHEL di nuova creazione

Domanda :Possiamo ssh nella macchina CentOS/RHEL 8 di nuova costruzione, ma il ping non funziona, nemmeno il ping automatico. I servizi Firewalld e Selinux sono disabilitati. Come risolvere il problema?

1. Innanzitutto, controlla il contenuto del file dinamico /proc/sys/ipv4/icmp_echo_ignore . Se questo valore è impostato su 1, in altre parole on o true, il kernel sceglie di ignorare totalmente tutte le richieste echo ICMP. Questa variabile assume un valore booleano e per impostazione predefinita è impostata su false o disattivata.

# cat /proc/sys/ipv4/icmp_echo_ignore
1

2. Puoi confermare lo stesso dai comandi "netstat -s" e "sysctl -a":

# netstat -s
...
Icmp:
  2371 ICMP messages received
  0 input ICMP message failed
  ICMP input histogram:
  echo requests: 2339
  timestamp request: 32
  40 ICMP messages sent
  0 ICMP messages failed
  ICMP output histogram:
  echo requests: 8
  timestamp replies: 32
IcmpMsg:
  InType8: 2339
  InType13: 32
  OutType8: 8
  OutType14: 32
# sysctl -a | grep icmp_echo_ignore_all
net.ipv4.icmp_echo_ignore_all = 1

3. Modifica la seguente riga in /etc/sysctl.conf come mostrato di seguito:

# vi /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all = 0

o per apportare temporaneamente le modifiche utilizzare il comando seguente:

# echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all

4. Per renderlo persistente dopo il riavvio:

# sysctl -p

Quindi puoi testare il ping localmente o da un altro computer:

$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.023 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.035 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.037 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.029 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.033 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.035 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.030 ms
^C
--- 127.0.0.1 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7000ms
rtt min/avg/max/mdev = 0.023/0.032/0.037/0.006 ms


Cent OS
  1. Come installare Puppet su CentOS 8 / RHEL 8

  2. Installa ownCloud su CentOS 6 / RHEL 6

  3. Come installare Puppet 6.x su CentOS 7 / RHEL 7

  4. CentOS / RHEL 7:come installare la GUI

  5. Installa MySQL 5.6 su CentOS 7 / RHEL 7

Come installare il server Redis su CentOS 8 / RHEL 8

Come configurare il server NFS su CentOS 8 / RHEL 8

Come installare Zabbix Server 4.x su CentOS 6 / RHEL 6

Installa la GUI di Gnome su CentOS 7 / RHEL 7

Installa Nginx su CentOS 7 / RHEL 7

Come installare Zabbix Server 5.0/4.0 su CentOS 7/RHEL 7