Comment 0 for bug 1013597

Revision history for this message
Juha Aatrokoski (jha-kurp) wrote :

The default route cannot be provided via DHCPv6, it must be obtained from router advertisements. However, when using the dhcp method for inet6 in /etc/network/interfaces (e.g. "iface eth0 inet6 dhcp"), ifup will set net.ipv6.conf.<IFACE>.accept_ra=0, resulting in no default route for IPv6. Instead, it should explicitly set accept_ra=1.

A workaround is to set it in a post-up script. However, Linux apparently only sends router solicitations when the interface is brought up, so if unsolicited RA:s are infrequent the host will be without a default route until the next RA. This can be worked around by "blinking" the interface down-up.

Another problem is that when bringing the interface down on dual-stack hosts, there will be a long timeout. This is because bringing down IPv4 also brings the interface link down, and afterwards dhclient cannot release the DHCPv6 lease due to the link being down ("RTNETLINK answers: Cannot assign requested address"). The workaround is to bring the link back up before bringing IPv6 down.

So the workarounds (which obviously should not be needed) for a dual-stack dhcp client look like this:

iface eth0 inet dhcp
iface eth0 inet6 dhcp
    up sysctl net.ipv6.conf.$IFACE.accept_ra=1
    up ip link set dev $IFACE down
    up ip link set dev $IFACE up
    pre-down ip link set dev $IFACE up