I have a small offic here with a few workstations and I would like to implement a small server for stuff like a proxy server, samba etc. This is the topology of said network:

+-----+   dynamic    +--------+        +-------------------+                 +--+workstation1
|     |  /56 prefix  |        |        |   Debian server   |        +--------+
| ISP +--------------+ Router +-+eth0+-+                   +-+eth1+-+ switch +--+workstation2
|     |   dynamic    |        |        | (squid,dhcp,etc.) |        +--------+
+-----+ IPv4 address +--------+        +-------------------+                 +--+workstationX

I would like to have the server assign global (maybe local as well) IPv6 addresses and private IPv4 addresses to all devices connected to eth1 via the switch. I have been able to get NAT masquerading working with dnsmasq and iptables but I can't get IPv6 traffic or even distributing IPv6 addresses to work. The router has three different settings in the IPv6 DHCP server tab:

  • assign DNS server only
  • assign DNS server and IPv6 prefix to downstream routers (what I assume should be enabled)
  • assign DNS server, IPv6 prefix to downstream routers and IPv6 address

I tried following this guide. It describes how to set up a DHCPv6 server with dnsmasq. I have a working eth0 which gets a global, unique local and a link local address. But my eth1 interface never gets a global IPv6 address, only a link-local one. The devices behind the server all have a working IPv4 address but I can't set the IP to a static one because the prefix is dynamic and changes every night. Currently I'm stuck at this point.

Here are my configuration files.

Thank you for your help.

  • 1
    Use an OpenWRT-based router, which is capable of doing this. Even a reflashed home router will do. Debian has absolutely no software included which can send IPv6 prefixes downstream. Nor, as far as I know, does any other distribution. – Michael Hampton Nov 22 '15 at 20:33
  • You appear to have two layers of routers with dynamically assigned IPv6 addresses in your setup. In order for that to work Router has to act both as DHCPv6 client and server. Router must act as DHCPv6 client to request delegation of the /56 from the ISP. It must also act as DHCPv6 server to delegate a /60 out of that /56 to the Debian server. I have no idea whether the software you are running on your routers support such a configuration. – kasperd Nov 22 '15 at 21:53

You will need to assign an IPv6 address to eth1 as it won't be able to autoconfigure. Pick an /64 address from your /56 although you may be able to use your /56. I've used the prefix 2001:0db8:a1b2:c2d3::/64 in the example below.

# This is an IPv6 interface
iface eth1 inet6 static
    address  2001:0db8:a1b2:c2d3::1
    netmask  64
  • Unfortunately the prefix changes everytime the router reconnects (reboot or every 24 hours). But the bigger problem is that even after a reboot the static ip isn't shown with ip addr. It shows the global ip and so on on eth0 and only the link-local on eth1. – Leo Nov 22 '15 at 19:41
  • 3
    @Leo Your provider should be providing a static IPv6 address with /64 or /56 range for your use. Otherwise, consider using a tunnel broker for IPv6. You should firewall your global IP addresses as you will not any protection from an NAT. – BillThor Nov 22 '15 at 19:53

I have found the way. My interface eth0 got it's IP because of the enabled net.ipv6.conf.eth0.accept_ra=2 in /etc/sysctl.conf. The wide-dhcpv6-client tried setting eth0 address again, but it has already been set by the router advertisement. So if you want wide-dhcpv6-client to set the ip only to the internal interface (eth1 in my case) you have to omit the

id-assoc na 1 {
    # id-assoc for eth1

part from the posted tutorial. Otherwise dhcp6c will stop after seeing that the address is already in use.

This is what my dhcp6c.conf looks like now

interface eth0 {
        send ia-pd 1;
        request domain-name;
        request domain-name-servers;
        script "/etc/wide-dhcpv6/dhcp6c-script";

id-assoc pd 1 {
        prefix ::/64 infinity;
        prefix-interface eth1 {
                sla-len 0;
                sla-id 1;
                ifid 1;

Now everything works like a charm. I hope this information helps anyone with a similar problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.