GNU/Linux >> Belajar Linux >  >> Cent OS

ping tidak berfungsi pada server CentOS/RHEL yang Baru Dibangun

Pertanyaan :Kami dapat ssh ke mesin CentOS/RHEL 8 yang Baru Dibangun, tetapi ping tidak berfungsi, bahkan ping sendiri. Layanan Firewalld dan Selinux dinonaktifkan. Bagaimana cara mengatasi masalah?

1. Pertama, periksa konten file dinamis /proc/sys/ipv4/icmp_echo_ignore . Jika nilai ini diset ke 1, dengan kata lain on atau true, kernel memilih untuk mengabaikan semua permintaan echo ICMP. Variabel ini mengambil nilai boolean dan secara default disetel ke false, atau nonaktif.

# cat /proc/sys/ipv4/icmp_echo_ignore
1

2. Anda dapat mengonfirmasi hal yang sama dari perintah “netstat -s” dan “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. Edit baris berikut di /etc/sysctl.conf seperti yang ditunjukkan di bawah ini:

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

atau untuk membuat perubahan sementara gunakan perintah di bawah ini:

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

4. Untuk membuatnya persisten setelah reboot:

# sysctl -p

Kemudian Anda dapat menguji ping secara lokal atau dari komputer lain:

$ 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. Cara Memasang Wayang Di CentOS 8 / RHEL 8

  2. Instal ownCloud di CentOS 6 / RHEL 6

  3. Siapkan Server SysLog di CentOS 6 / RHEL 6

  1. Cara Setup SysLog Server di CentOS 7 / RHEL 7

  2. CentOS / RHEL 7:Cara Menginstal GUI

  3. Instal MySQL 5.6 di CentOS 7 / RHEL 7

  1. Cara menginstal server vnc di RHEL 8 / CentOS 8

  2. Cara Setup Server NFS di CentOS 7 / RHEL 7

  3. Cara Install Puppet 6.x Di CentOS 7 / RHEL 7