Cannot get an IPv6 address on Debian

12,928

This depends on whether your provider is using stateless DHCPv6 or stateful DHCPv6.

In stateless DHCPv6, your IP addresses are actually configured via SLAAC, and the DHCPv6 server provides only the DNS server addresses, NTP server addresses, etc.

In Debian 7, this /etc/network/interfaces configuration can be used for either SLAAC or stateless DHCPv6:

iface eth0 inet6 auto

In stateful DHCPv6, the DHCPv6 server provides IPv6 address assignment as well; SLAAC is not used. This is configured with:

iface eth0 inet6 dhcp
Share:
12,928

Related videos on Youtube

Cheiron
Author by

Cheiron

Updated on September 18, 2022

Comments

  • Cheiron
    Cheiron over 1 year

    I am using Debian 7 with the newest updates.

    I have a block of IPv6 adresses from my provider and, according to the provider the DHCP server is setup so that I should get an ip automatically (I even asked them). But it does not work. I get an IPv4 automatically, so that works fine. After some googling etc. I found out that the file /etc/network/interfaces should be responsible. This was the startposition of it:

    # 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
    allow-hotplug eth0
    iface eth0 inet dhcp
    

    And this is ifconfig -a in the startposition (IPv4 adress is changed because I dont feel like dumping my real ipv4, the IPv6 is untouched):

    sudo ifconfig -a
    [sudo] password for **:
    eth0      Link encap:Ethernet  HWaddr <**>
              inet addr:188.105.484.221  Bcast:188.105.484.255  Mask:255.255.255.0
              inet6 addr: fe80::5054:ff:fe8c:3b20/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3290 errors:0 dropped:0 overruns:0 frame:0
              TX packets:304 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:407068 (397.5 KiB)  TX bytes:36628 (35.7 KiB)
    
    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:16436  Metric:1
              RX packets:8 errors:0 dropped:0 overruns:0 frame:0
              TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)
    

    A link-local Ipv6, which also isnt the one the DHCP server wants to give me, so no good. So I changed /etc/network/interfaces:

     cat /etc/network/interfaces
    # 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
    allow-hotplug eth0
    iface eth0 inet dhcp
    iface eth0 inet6 dhcp
    

    And then I flushed my firewall rules because I read that the firewall can also be annoying. So then:

    ifdown eth0 && ifup eth0
    Internet Systems Consortium DHCP Client 4.2.2
    Copyright 2004-2011 Internet Systems Consortium.
    All rights reserved.
    For info, please visit https://www.isc.org/software/dhcp/
    
    Listening on LPF/eth0/56:54:00:7b:3b:20
    Sending on   LPF/eth0/56:54:00:7b:3b:20
    Sending on   Socket/fallback
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPOFFER from 188.105.484.254
    DHCPACK from 188.105.484.254
    bound to 188.105.484.221 -- renewal in 38715 seconds.
    

    And then it just hangs and waits. It gets the IPv4 then it seems to want to start looking for the ipv6 but it doesn't or something. ifconfig -a looks the same as before. What am I doing wrong? How should I be getting an ipv6 address?

    ----EDIT----

    I got it working, using static ip: /etc/network/interfaces (Again, the ipv6 adress is not the actual one I have)

    # 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
    allow-hotplug eth0
    iface eth0 inet dhcp
    #iface eth0 inet6 auto
    #       accept_ra 1
    #iface eth0 inet6 dhcp
    #       accept_ra 1
    iface eth0 inet6 static
            address 2a01:9b8:aaf:1dg::1
            gateway 2a01:9b8:aaf::1
            netmask 48
    
  • Cheiron
    Cheiron over 10 years
    I tried the iface eth0 inet6 auto and now the ifup command no longer hangs, but I still do not get a IPv6 address.
  • Michael Hampton
    Michael Hampton over 10 years
    Time to contact your provider. They are clearly doing something unexpected.
  • Cheiron
    Cheiron over 10 years
    Allright, I will contact them again. Thank you for the tip=)
  • Cheiron
    Cheiron over 10 years
    I got it working while using static ip (I was using the wrong mask when trying static: I used /64, should have been /48). But nothing from the DHCP