No default route for stateful DHCPv6

Bug #1013597 reported by Juha Aatrokoski on 2012-06-15
This bug affects 18 people
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)

Bug Description

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.

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
    pre-down ip link set dev $IFACE up

Related branches

description: updated
Changed in ifupdown (Ubuntu):
status: New → Fix Committed
importance: Undecided → Medium
Changed in ifupdown (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
Launchpad Janitor (janitor) wrote :
Download full text (3.5 KiB)

This bug was fixed in the package ifupdown - 0.7ubuntu1

ifupdown (0.7ubuntu1) quantal-proposed; urgency=low

  * Resynchronise with Debian experimental. Remaining changes:
    (LP: #298488, LP: #663352)
    - ifupdown.nw: Use 100 as default route metric unless an explicit metric
      parameter is set in /etc/network/interface.
    - If the /etc/NetworkManager/NetworkManager.conf file is present
      but doesn't have the "ifupdown:managed" the previous upload instructed
      the iniparser to return -1, which evaluates to TRUE. We instead instruct
      it to return 0, as we shouldn't prevent ifupdown from managing the
      interfaces in that case, as NM won't either. (LP: #281984)
    - debian/postinst: If the loopback interface is missing from the config
      in /etc/network/interfaces, add it on upgrade.
    - Add jobs and hooks for upstart.
  * Cherry-pick commit 011d5904c09d from upstream, fixing cases where the
    error messages wouldn't be triggered (caused test failure).
  * Cherry-pick commit 7c1a226cc995 from upstream, adds support for two
    options on dhcpv6 (accept_ra and autoconf) (LP: #1013597)
  * Cherry-pick commit 5af7e814faee from upstream, fixing a failure in the
    example script (LP: #286808)
  * Cherry-pick commit a1f8efc4d93f from upstream, add --no-scripts as a
    parameter to ifup/ifdown, allowing the user to bypass the the scripts
    in /etc/network/if-*.d/ (LP: #258782)

ifupdown (0.7) unstable; urgency=low

  * Accept duplicate options in /etc/network/interfaces, join them using
    a newline as a delimiter.
  * If an interface isn't defined, but mentioned in auto or allow statement,
    don't mention it in ifquery output.
  * Change shortcut for --exclude to -X (was -e previously).
  * Make ifquery return false if the interface isn't defined.
  * Fix typos in the changelog.
  * Calculate broadcast address internally.
  * Allow concurrent netmask specification in both address (using CIDR
    notation) and netmask for IPv6 (Closes: #674775).
  * Add preferred-lifetime setting for IPv6.
  * Pass -w and -e options to sysctl so we still can configure an interface
    even if IPv6 SLAAC options can't be set for some reason.
  * Port to GNU/Hurd (thanks to Svante Signell, closes: #296115).
  * Chdir to root when executing external programs (Closes: #361964).
  * Remove updetach from PPP method (Closes: #675016).
  * Configure hotplug interfaces only if they're running (thanks to Evgeni
    Golov, closes: #673658).
  * Rewrite NEWS file (Closes: #673688).
  * Update examples (Closes: #340992).
  * Update tests.
  * Update README.

ifupdown (0.7~rc3) unstable; urgency=low

  * Upload to unstable.
  * Don't refer to README from netbase any more.
  * Internal changes:
    - Make set_variable() able to set variables conditionally.
    - Improve conversions interface.
    - Add some support for interface link configuration.
    - Don't leak memory in some functions.
  * Configure VLANs automatically (Closes: #520436).
  * Calculate netmask internally, so even if a user haven't supplied
    one or have used CIDR notation, hook scripts will have it properly
    specified in IF_NE...


Changed in ifupdown (Ubuntu):
status: Fix Committed → Fix Released
ruff (rufferson) wrote :

ii ifupdown 0.7.1ubuntu2 amd64 high level tools to configure network interfaces
The same behaviour - after ifup accept_ra is 0, on ifdown - dhcp cleint for v6 still times out

ruff (rufferson) wrote :

Ok, found new conf parameters for dhcp stanza accept_ra and autoconf - that solves RA issue. Still investigating release.

ruff (rufferson) wrote :

Ok, here's verbose dump below. Down sequence is executed in the same order as up, although should be in reverse. And to check whether list of remaining interface definitions is empty for any given interface to avoid setting link down. That way dhcp6 will be released first, then dhcp4 release and finally wpa termination and link down.
Don't know if anyone can produce a patch for that nw source file though %(

Configuring interface wlan0=wlan0 (inet)
run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/resolvconf
run-parts: executing /etc/network/if-down.d/upstart
run-parts: executing /etc/network/if-down.d/wpasupplicant
dhclient -v -r -pf /run/ -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit

Listening on LPF/wlan0/xx:xx:xx:xx:xx:xx
Sending on LPF/wlan0/xx:xx:xx:xx:xx:xx
Sending on Socket/fallback
DHCPRELEASE on wlan0 to aa.aa.aa.aa port 67
ip link set dev wlan0 down
run-parts --verbose /etc/network/if-post-down.d
run-parts: executing /etc/network/if-post-down.d/avahi-daemon
run-parts: executing /etc/network/if-post-down.d/bridge
run-parts: executing /etc/network/if-post-down.d/wireless-tools
run-parts: executing /etc/network/if-post-down.d/wpasupplicant
wpa_supplicant: terminating wpa_supplicant daemon via pidfile /var/run/
Stopped /sbin/wpa_supplicant (pid 9677).
wpa_supplicant: removing /run/sendsigs.omit.d/
Configuring interface wlan0=wlan0 (inet6)
run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/resolvconf
run-parts: executing /etc/network/if-down.d/upstart
run-parts: executing /etc/network/if-down.d/wpasupplicant
dhclient -6 -r -pf /run/ -lf /var/lib/dhcp/dhclient6.wlan0.leases wlan0
RTNETLINK answers: Cannot assign requested address
RTNETLINK answers: Cannot assign requested address
RTNETLINK answers: Cannot assign requested address

This is a important issue, hope for a fix really soon. I'm not able to use dhcpv6 :(

Ray Soucy (rps-u) wrote :

Can we change the status of this bug so it doesn't show up as "Fix Released"

It needs more attention.

> Ok, found new conf parameters for dhcp stanza accept_ra and
> autoconf - that solves RA issue. Still investigating release.

I tried adding the "accept_ra 1" option to /etc/network/interfaces and it was ignored by ifupdown:

iface eth0 inet6 dhcp
    accept_ra 1

The accept_ra option should default to 1 not 0
Also, the dhclient release bug is annoying as well. The workarounds in the description don't seem to work completely either (dhclient doesn't like seeing the interface bounce while it's making a request).

I have ifupdown listed as package version 0.7~beta2ubuntu8 for amd64

Stéphane Graber (stgraber) wrote :

The fix was pushed in Ubuntu 12.10 as 0.7ubuntu1, 0.7~beta2ubuntu8 doesn't contain the fix so it's perfectly normal for you not to have the expected behaviour.

Ray Soucy (rps-u) wrote :

So will it not be fixed in LTS?

Changed in ifupdown (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Stéphane Graber (stgraber)
Simon Leinen (simon-leinen) wrote :

I stumbled over this as well. Fortunately we use Ubuntu 12.10, so I could use the "accept_ra 1" workaround to fix the issue (missing default routes when using stateful DHCPv6 to obtain address).

But, on POLA grounds, I agree with Ray Soucy (rps-u) that

    The accept_ra option should default to 1 not 0

Matthew Hall (mhall-9) wrote :


This bug is crippling IPv6 on my machine.

Would it be possible to get this fixed for 12.04 LTS?


Matthew Hall (mhall-9) wrote :

P.S.: I just found a possible workaround for the fact that configuring accept_ra does not work. In addition to the above one, up sysctl net.ipv6.conf.$IFACE.accept_ra=1, you can install the ndisc6 package and add up /bin/rdisc6 $IFACE to cause a manual discovery from userspace. However I'm not sure if the kernel will also get the response and process it. Maybe someone who knows more on this part could comment...

Andrew Collins (bsderandrew) wrote :

I'd like to request a backport of this for 12.04 LTS as well, this issue has forced me to move to NetworkManager on my server instead of ifupdown, as DHCPv6 stateful support is seriously broken unless I manually add default routes.

ruff (rufferson) wrote :

An easy fix here will be to use following tweak
iface wlan0 inet dhcp
   <blah blah>
iface wlan0 inet6 dhcp
    accept_ra 1
    autoconf 1
    pre-down wpa_cli -i$IFACE reconnect 2>/dev/null

this way it will try pre-down before starting down action. Pre-down eventually fails since wpa is already dead.

ruff (rufferson) wrote :

ps> this will fix dhcp6 release hang, not original default route issue. srry for hijacking

This bug is till not fixed in Ubuntu 12.04 :( May you guys fix it soon? :)

Peter Silva (peter-bsqt) wrote :

Please fix for 12.04. prevents deployment of IPv6 at any organization (please don't tell me anyone with a managed network is going to do SLAAC.)

Thiago Martins (martinx) wrote :

This bug is still not fixed in Ubuntu 14.04.

It is VERY annoying.

It is almost impossible to use IPv6 (SLAAC + DHCPv6) on Ubuntu Server... Ubuntu Desktop works fine.

I'm trying it this way as a workaround:

auto eth0
iface eth0 inet6 dhcp
           accept_ra 1

But, this triggers another problem, the connectivity only begin to work, after I "ping6 IP_OF_GATEAY" first. If I try to "ping6", it does NOT work.

It is sad that we're in 2014 and Ubuntu Server (and probably Debian) isn't ready for IPv6 networks.

Thiago Martins (martinx) wrote :

This problem must have maximum priority!!!

Thiago Martins (martinx) wrote :

BTW, Debian testing also suffer from this problem.

I'm seeing 3 main problems (Ubuntu / Debian with IPv6):

1- ifupdown doesn't have support for:

  * statefull (SLAAC + DHCPv6);

 * conectivity only starts after "ping6 gateway_ip";

 * impossible to manage "IPv6 Aliases", since there is no need to "eth0:X, eth0:Y, etc"...

So, in the end of the day, if you want to use IPv6 (SLAAC + DHCPv6) with Ubuntu or Debian, it is better to configure it outside of /etc/network/interfaces. Or, don't use DHCPv6 and stick only with "SLAAC-Stateless + DNS" and forget about DHCPv6.

Again, this problem must be fixed ASAP.


Thiago Martins (martinx) wrote :

Guys, sorry if I was rude before... Too much things happening at the same time today... :-P

I just installed a PFSense 2.1 with IPv6 and, for my surprise, Debian and Ubuntu Server are the only two operating systems that doesn't work "out-of-the-box" in a IPv6-Only network...

Ubuntu Desktop, Windows 7, Mac, are okay in a IPv6-Only env... Debian and Ubuntu (during the installation process, and even after) doesn't.

I mean, I tried to Install Ubuntu using the following scenarios:

1- SLAAC Unmanaged (no RDNSS) - Ubuntu Server have IPv6 addr without DNS resolution, of course (expected) - connectivity okay;

2- SLAAC Unmanaged + RDNSS - Ubuntu Server have IPv6 but no DNS name resolution (i.e. it ignore RDNSS entries from RadvD) - connectivity okay;

3- SLAAC Managed + DHCPv6 Statefull - Ubuntu Server (or Debian) get its IPv6 addr, DNS servers too but, the connectivity only starts after "ping6 my_ipv6_gateway" - NO CONNECTIVITY UNTIL PING6 GATEWAY!!

So, I'm seeing that there is no option to install Ubuntu (or Debian) in a IPv6-Only network without suffering some issues (that can be fixed after install, I know, but it is annoying). Also, we need a IPv6-Enabled NTP server too... =P

I'm okay with SLAAC-Only deployments but, huge organizations seems to require DHCPv6 for getting more info about its network services automatically and SLAAC doesn't provides it (not designed for it)...

As I said, my IPv6 router is a brand new PFSense 2.1 with "RadvD + DHCPv6 (on LAN)" and it is working fine, since I have more machines here working smoothly with IPv6 from behind it. For each scenario above, I've reconfigured PFSense to match it (Managed - Unmanaged / with - without DHCPv6).

NOTE: There is no IPv4 on this enviroment.


Thiago Martins (martinx) wrote :

Fixed in the latest Ubuntu 14.04!

Also, it is recommend to install the package: "apt-get install rdnssd", otherwise, Ubuntu will ignore the RDNSS from your Router Advertisement.

I have right now, a perfect IPv6-Only network, powered by "Router Advertisement with RDNSS" (from PFSense 2.1) and Ubuntu Servers 14.04, no need for DHCPv6!


Please fix it also in Precise (12.04) !

This is still not working in Ubuntu 14.04. Please fix this :-)

davygrvy (davygrvy) wrote :

broke for me in current 14.04

davygrvy (davygrvy) wrote :

This seems to work for me

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
    up sysctl net.ipv6.conf.$IFACE.accept_ra=1
    up rdisc6 $IFACE

Corin Langosch (ipfo) wrote :

This is still broken on latest ubuntu server 14.04. No wonder that ipv6 gets no adoption when one needs hours (or dig through bug reports) to get a basic ipv4/ipv6 dual stack setup working.

Changed in ifupdown (Ubuntu Precise):
assignee: Stéphane Graber (stgraber) → nobody
Changed in ifupdown (Ubuntu):
assignee: Stéphane Graber (stgraber) → nobody
Thiago Martins (martinx) wrote :

So, nobody will look into this anymore (apparently), are we moving to systemd's networkd (16.04) to "fix" this? I'm so tired of ifupdown... :-P

Dan Streetman (ddstreet) on 2016-09-24
Changed in ifupdown (Ubuntu):
assignee: nobody → Dan Streetman (ddstreet)
Changed in ifupdown (Ubuntu Precise):
assignee: nobody → Dan Streetman (ddstreet)
Dan Streetman (ddstreet) on 2019-04-04
Changed in ifupdown (Ubuntu):
assignee: Dan Streetman (ddstreet) → nobody
Changed in ifupdown (Ubuntu Precise):
assignee: Dan Streetman (ddstreet) → nobody
Dan Streetman (ddstreet) on 2019-05-25
Changed in ifupdown (Ubuntu Precise):
status: Triaged → Won't Fix
Chong Eva (imessedup) wrote :

Apparently, I've done a stupid thing and forgot my Ubuntu Server in AWS is Server 14. I've upgraded the ubuntu to 16.04 a few months back, but forgot that it's supposed to be still Ubuntu Server 14.

So I followed the guide and followed the steps in Ubuntu Server 16. This got me locked out of my own server, and no matter what I tried (rebooting, assigned new private IP, tried pinging from other servers in the same subnet), I still can't get in. SSH ends up in Operation timed out. I've locked myself out.

I even tried creating an AMI and launch the image into a new instance but still it won't work, maybe because the network interfaces files are backed up into the image as well?

What can I do to regain access to my server?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers