Impossible to configure network interface with only IPv6 address

Bug #1352255 reported by dnmvisser
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Confirmed
Medium
Unassigned
Utopic
Fix Released
Medium
Unassigned

Bug Description

As it says on the tin.
I'm unable to configure my Ubuntu 14.04 VM to have only an IPv6 address on boot-up.
Dual stack works fine.

My /etc/networking/interfaces looks like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet6 static
        address 2001:610:188:444::55
        netmask 64
        gateway 2001:610:188:444::1
        autoconf 0
        privext 0
        accept_ra 0
        dns-search terena.org
        dns-domain terena.org
        dns-nameservers 2001:610:1:800a:192:87:106:106

After boot-up there is only a link-local address:

root@trusty-test:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:95:42:ab
          inet6 addr: fe80::250:56ff:fe95:42ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6644 (6.6 KB) TX bytes:2132 (2.1 KB)

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:65536 Metric:1
          RX packets:240 errors:0 dropped:0 overruns:0 frame:0
          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:18192 (18.1 KB) TX bytes:18192 (18.1 KB)

However, if I manually ifdown/ifup the interface, then things start working:

root@trusty-test:~# ifdown eth0
root@trusty-test:~# ifconfig
lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:65536 Metric:1
          RX packets:240 errors:0 dropped:0 overruns:0 frame:0
          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:18192 (18.1 KB) TX bytes:18192 (18.1 KB)

root@trusty-test:~# ifup eth0
Waiting for DAD... Done
root@trusty-test:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:95:42:ab
          inet6 addr: fe80::250:56ff:fe95:42ab/64 Scope:Link
          inet6 addr: 2001:610:188:444::55/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:894 errors:0 dropped:0 overruns:0 frame:0
          TX packets:652 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:168407 (168.4 KB) TX bytes:95052 (95.0 KB)

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:65536 Metric:1
          RX packets:288 errors:0 dropped:0 overruns:0 frame:0
          TX packets:288 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:21792 (21.7 KB) TX bytes:21792 (21.7 KB)

FYI, I have many 12.04 LTS VMs that work fine with the same configuration.

Many thanks!!!

Revision history for this message
dnmvisser (dnmvisser) wrote :

The workaround for now is to configure an IPv4 address:

auto eth0
iface eth0 inet static
        address 169.254.199.199
        netmask 255.255.0.0

iface eth0 inet6 static
        address 2001:610:188:444::55
        netmask 64
        gateway 2001:610:188:444::1
        autoconf 0
        privext 0
        accept_ra 0
        dns-search terena.org
        dns-domain terena.org
        dns-nameservers 2001:610:1:800a:192:87:106:106

Then remove it later from /etc/rc.local:

/sbin/ip addr del 169.254.199.199/16 dev eth0
exit 0

Not pretty but it's the only way right now to have my host properly configured ;-)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1352255/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
tags: added: trusty
Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

drive-by: setting "package" to "ifupdown"

affects: ubuntu → ifupdown (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifupdown (Ubuntu):
status: New → Confirmed
Revision history for this message
Scott Moser (smoser) wrote :

I did a fair amount of debug information including recreation with a cloud image at lp:~smoser/+junk/lp-1377005 . I'll copy the final comment here.

ok. so, i now know what happens, and why adding anything before the ipv6 address "fixes" the problem.
boot happens like this:
 * system boot
 * net-device-added fires network-interface.conf
 * net-device-added runs ifup --allow auto
 * ifup --allow auto reads /etc/network/interfaces *in order*
 * after the *first* stanza is brought up, /etc/network/if-up.d/upstart is invoked
 * /etc/network/if-up.d/upstart finds all interfaces to be up and emits static-network-up
 * /etc/init/failsafe.conf is stopped, freeing procps.conf to start
 * procps.conf runs sysctl on files in /etc/sysctl.d/*.conf
    which includes /etc/sysctl.d/10-ipv6-privacy.conf

ipv6-privacy.conf ends up killing the existing addresses.

Revision history for this message
Scott Moser (smoser) wrote :

The simple fix, then is:
  rm /etc/sysctl.d/10-ipv6-privacy.conf

Revision history for this message
Scott Moser (smoser) wrote :

i opened bug 1379427 for the incorrect static-networking bug that i found when investigating.

setting the use_tempaddr setting ends up wiping existing ipv6 addresses.

Revision history for this message
Scott Moser (smoser) wrote :

just for the record changing
  sysctl -e net.ipv6.conf.all.use_tempaddr
is what causes the problem. changing 'sysctl -e net.ipv6.conf.default.use_tempaddr' does not.
changing 0 -> 2 or 2 -> 0 deletes all existing addresses for an interface.

Changed in ifupdown (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Michael Bienia (geser) wrote :

See also bug #994931 (Altering use_tempaddr drops all IPv6 addresses).

Scott Moser (smoser)
Changed in ifupdown (Ubuntu Trusty):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

I've verified fix-released on utopic. In 2 ways:
a.) set /etc/network/interfaces with:
  auto lo
  iface lo inet loopback
  auto eth0
  iface eth0 inet6 static
    netmask 64
    address 2001:db8::1:3

  And set a local 'NoCloud' datasource, and then booted
  the system to see 'ip -6 addr' shows the configured interface.

b.) verified that bouncing the sysctl settings does not deconfigure addresses.
  $ vals() { for i in net.ipv6.conf.all.use_tempaddr net.ipv6.conf.default.use_tempaddr; do [ -n "$1" ] && { sudo sysctl $i=$1 || return; } || sysctl $i; done; }
  $ vals 0
  net.ipv6.conf.all.use_tempaddr = 0
  net.ipv6.conf.default.use_tempaddr = 0

  $ sudo ip -6 addr del 2001:db8::1:3/64 dev eth0 &>/dev/null;
  $ sudo ip -6 addr add 2001:db8::1:3/64 dev eth0

  $ vals 2
  net.ipv6.conf.all.use_tempaddr = 2
  net.ipv6.conf.default.use_tempaddr = 2
  $ ip -6 addr show dev eth0
  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:db8::1:3/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::f816:3eff:fefd:d570/64 scope link
       valid_lft forever preferred_lft forever
  $ vals 0
  net.ipv6.conf.all.use_tempaddr = 0
  net.ipv6.conf.default.use_tempaddr = 0

  $ ip -6 addr show dev eth0
  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:db8::1:3/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::f816:3eff:fefd:d570/64 scope link
       valid_lft forever preferred_lft forever

  $ uname -r
  3.16.0-21-generic

Changed in ifupdown (Ubuntu Utopic):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.