InformationAlthough IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented.
If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system.
If IPv6 is disabled through sysctl config, SSH X11forwarding may no longer function as expected. We recommend that SSH X11fowarding be disabled, but if required, the following will allow for SSH X11forwarding with IPv6 disabled through sysctl config:
Add the following line the /etc/ssh/sshd_config file:
Run the following command to re-start the openSSH server:
# service sshd restart
SolutionUse one of the two following methods to disable IPv6 on the system:
To disable IPv6 through the GRUB config:
Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines:
kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=UUID=ed90a503-bea9-4f2c-b24a-e9191f6e154b rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet audit=1 ipv6.disable=1
To disable IPv6 through sysctl settings:
Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/*.conf file:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Run the following commands to set the active kernel parameters:
# sysctl -w net.ipv6.conf.all.disable_ipv6=1
# sysctl -w net.ipv6.conf.default.disable_ipv6=1
# sysctl -w net.ipv6.route.flush=1
Disabling ipv6 via sysctl only disables (unhooks all of the calls) for the ipv6 module, but doesn't prevent it from loading.