環境情報
- MIRACLE LINUX release 8.9
ipv6が優先されていることを確認
# ping localhost
PING localhost(localhost (::1)) 56 data bytes
64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.106 ms
64 bytes from localhost (::1): icmp_seq=2 ttl=64 time=0.040 ms
64 bytes from localhost (::1): icmp_seq=3 ttl=64 time=0.042 ms
64 bytes from localhost (::1): icmp_seq=4 ttl=64 time=0.025 ms
grub設定でipv6を無効化
ipv6.disable=1を追加
# vim /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/ml-swap rd.lvm.lv=ml/root rd.lvm.lv=ml/swap rhgb quiet ipv6.disable=1"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
grubファイルの設定反映
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
done
サーバ再起動
# reboot
ipv4が優先されていることを確認
# ping localhost
PING localhost(localhost (127.0.0.1)) 56 data bytes
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.106 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.040 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.042 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.025 ms