Dalam postingan ini, kita akan melihat cara menonaktifkan pemrosesan pengalihan ICMP, yang dapat membantu menjaga konektivitas jaringan dalam situasi di mana sakelar yang membingungkan atau server jaringan mengalihkan lalu lintas dari jalur yang dipilih.
Nonaktifkan Pengalihan ICMP Dari Baris Perintah
Pemrosesan Redirect ICMP dapat dimatikan hingga reboot berikutnya melalui baris perintah, seperti yang ditunjukkan di bawah ini.
Untuk semua antarmuka jaringan:
# /sbin/sysctl -w net.ipv4.conf.all.accept_redirects = 0 # /sbin/sysctl -w net.ipv4.conf.all.send_redirects = 0 # /sbin/sysctl -w net.ipv6.conf.all.accept_redirects = 0 # /sbin/sysctl -w net.ipv6.conf.all.send_redirects = 0
Untuk antarmuka jaringan yang dipilih, seperti eth0:
# /sbin/sysctl -w net.ipv4.conf.eth0.accept_redirects = 0 # /sbin/sysctl -w net.ipv4.conf.eth0.send_redirects = 0 # /sbin/sysctl -w net.ipv6.conf.eth0.accept_redirects = 0 # /sbin/sysctl -w net.ipv6.conf.eth0.send_redirects = 0
Nonaktifkan ICMP Redirect Secara Persisten
Buat file /etc/sysctl.d/50-icmp_redirect.conf dengan baris:
# Uncomment the lines below as needed. # Disable ICMP Redirect Globally # net.ipv4.conf.all.accept_redirects = 0 # net.ipv4.conf.all.send_redirects = 0 # net.ipv6.conf.all.accept_redirects = 0 # net.ipv6.conf.all.send_redirects = 0 # Disable ICMP Redirect For A Selected NIC # net.ipv4.conf.eth0.accept_redirects = 0 # net.ipv4.conf.eth0.send_redirects = 0 # net.ipv6.conf.eth0.accept_redirects = 0 # net.ipv6.conf.eth0.send_redirects = 0
Batalkan komentar pada baris yang sesuai untuk penerapan Anda. Perubahan akan tetap ada selama reboot.
Terapkan pengaturan di lingkungan saat ini:
# sysctl --system ## for CentOS/RHEL 7 and above # sysctl -p ## for CentOS/RHEL 6
Cara Menambahkan Stempel Waktu Ke dmesg Kernel Boot Log di CentOS/RHEL
Akun Direktori Aktif Windows Menampilkan UID/GID yang Tidak Konsisten Di Berbagai Klien SSSD Linux (CentOS/RHEL)