Désactiver IPv6

Boot Linux Kernel parameter

ipv6.disable=1 # disable_ipv6=

Désactiver IPv6 sous Debian

cat > /etc/sysctl.d/70-disable-ipv6.conf <<EOF net.ipv6.conf.all.disable_ipv6 = 1 EOF sysctl -p /etc/sysctl.d/10-noipv6.conf

Si module

cat >/etc/modprobe.d/blacklist-ipv6.conf <<EOF blacklist ipv6 install ipv6 /bin/false EOF

/etc/apt/apt.conf.d/99force-ipv4

Acquire::ForceIPv4 "true";

Désactiver IPv6 sous RedHat

sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 #sysctl -w net.ipv6.conf.lo.disable_ipv6 = 1

/etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=no IPV6_DISABLED=yes
nmcli connection show nmcli connection modify Example ipv6.method disabled

/etc/default/grub

GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rhgb quiet"
grub2-mkconfig -o /boot/grub2/grub.cfg grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

/etc/ssh/sshd_config

AddressFamily inet

Java

Djava.net.preferIPv4Stack=true

Autres

/etc/systemd/system/rpcbind.socket.d/noipv6.conf

[Socket] ListenStream= ListenDatagram= ListenStream=0.0.0.0:111 ListenDatagram=0.0.0.0:111

/etc/wgetrc

# To try ipv6 addresses first: #prefer-family = IPv6

Pb

Erreur Address family not supported by protocol

Exemple

SystemD Socket

BindIPv6Only=both

Erreur Address family not supported by protocol lors de systemctl status quand IPV6 est désactivé dans sysctl.conf

RésolutionAprès avoir modifié /etc/sysctl.conf ou des fichiers dans /etc/sysctl.d/ il est nécessaire de reconstruire l'initramfs.

dracut -f -v

Pour vérifier

ifconfig | grep inet6 cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6

http://www.admin-linux.fr/?p=3674