[CentOS] can't disable tcp6 on centos 7

Sun May 3 22:33:34 UTC 2015
Alberto Rivera Laporte <arlaporte at gmail.com>

On Sun, May 3, 2015 at 4:18 PM Tim Dunphy <bluethundr at gmail.com> wrote:

>
> What am I doing wrong? I need to be able to disable tcpv6 completely!
>
>
>
Ultimately you can disable ipv6 completely by disabling the ipv6 module. On
this FAQ below also includes a reason why you may not want to do that.
http://wiki.centos.org/FAQ/CentOS7#head-8984faf811faccca74c7bcdd74de7467f2fcd8ee

Alternatively on top of what you have already done which is disabling ipv6
via sysctl,  you can set the xinet service to specifically listen on  ipv4
only.  There are other examples on that FAQ on how to accomplish that with
other services.

        flags                   = IPv4

However if you feel like you have to completely disable ipv6 and you are
not running selinux, ip6tables, this approach works on disabling ipv6.:

- Edit /etc/default/grub and append 'ipv6.disable=1'  to the
GRUB_CMDLINE_LINUX configuration variable

-  Generate the grub configuration file
grub2-mkconfig -o /boot/grub2/grub.cfg

-  Reboot