[CentOS] Centos 7.3.1611 - NetworkManager + dhcp + ipv6

Wed Mar 22 18:49:35 UTC 2017
Diaulas Castro <diaulas.castro at opencloudfactory.com>

Hi Patrick,

I did not disabled on grub or module because of Centos 7 FAQ tips
"Upstream employee Daniel Walsh recommends not  disabling the ipv6 module, as that can cause issues with SELinux and other components, but adding the following to /etc/sysctl.conf"

So I used only sysctl, but the dhcp client or NM or systemd overwrite sysctl settings.

About using NM I can't because the VM it's deployed from OVA template, can't connect to disable ipv6 until I get the ipv4 address.

If there's on NM conf to disable ipv6 on all NEW interfaces/connections will help me, so I can edit the OVA file.
De: CentOS <centos-bounces at centos.org> em nome de Patrick Laimbock <patrick at laimbock.com>
Enviado: quarta-feira, 22 de março de 2017 08:01:49
Para: centos at centos.org
Assunto: Re: [CentOS] Centos 7.3.1611 - NetworkManager + dhcp + ipv6
On 21-03-17 20:51, Diaulas Castro wrote:
> Used steps on sysctl from Centos7 FAQ (https://wiki.centos.org/FAQ/CentOS7) and some gathered on internet
> # cat /etc/sysctl.d/90-disable_ipv6.conf
> net.ipv6.conf.all.disable_ipv6=1
> net.ipv6.conf.default.disable_ipv6=1
> net.ipv6.conf.eth0.disable_ipv6=1
> net.ipv6.conf.eth1.disable_ipv6=1
> net.ipv6.conf.all.use_tempaddr=0
> net.ipv6.conf.all.autoconf=0
> net.ipv6.conf.all.accept_ra=0
> net.ipv6.conf.default.autoconf=0
> net.ipv6.conf.default.accept_ra=0
> net.ipv6.conf.eth0.autoconf=0
> net.ipv6.conf.eth1.autoconf=0
> But with dhcp, NetworkManager (or something) reenables ipv6 on interfaces.
> #sysctl -a | grep ipv6 | grep disable
> net.ipv6.conf.all.disable_ipv6 = 1
> net.ipv6.conf.default.disable_ipv6 = 1
> net.ipv6.conf.eth0.disable_ipv6 = 0
> net.ipv6.conf.eth1.disable_ipv6 = 1
> net.ipv6.conf.lo.disable_ipv6 = 1
> And the interface gets the ipv4 but still have temporary ipv6 on it (our dhcp doesnt support ipv6)
> # ip a s eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
>     link/ether 00:0c:29:31:5a:9d brd ff:ff:ff:ff:ff:ff
>     inet brd scope global dynamic eth0
>        valid_lft 451sec preferred_lft 451sec
>     inet6 fe80::20c:29ff:fe31:5a9d/64 scope link
>        valid_lft forever preferred_lft forever
> And this bugs  my use for ovftool with the option "--X:waitForIp" because it's returns (mostly of times) the ipv6 addr
> It's a bug, missing documentation or my

IIRC you can disable IPv6 in NetworkManager with:

# nmcli connection modify eth0 ipv6.method ignore
# systemctl restart NetworkManager

or you can disable IPv6 entirely with:

# vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 <other options>"

# grub-mkconfig -o /boot/grub2/grub.cfg
# reboot

CentOS mailing list
CentOS at centos.org