Score:0

Simple stateful DHCPv6 using ISC DHCP and RADVD. Doesnt work?

gb flag

I'm trying to set a simple ipv6 network using ISC DHCPv6 on a linux machine.

Here is my dhcpd6.conf:

subnet6 beef:fade::/112 { 
   max-lease-time 3600;
   range6 beef:fade::100 beef:fade::fffe;
}

The dhcpv6 server works and assigns addresses to connected hosts in the specified range however, attached devices cant ping each other or ping the dhcpv6 server because they use 128 as netmask.

Looking online I found that this is due to the lack of RA. So I downloaded and started RADVD, enabled ipv6 forwarding and my firewall is disabled. Here is the my radvd.conf:

interface enp1s0
{
    AdvSendAdvert on;
    MinRtrAdvInterval 3;
    MaxRtrAdvInterval 10;
    prefix beef:fade::/112
    {
        AdvOnLink on;
        AdvAutonomous off;
    };

};

But this results in radvd saying: enp1s0 prefix length should be: 64. But i don't want prefix length 64. I want to be able to set it to pretty much any length as it becomes necessary.

How do i go about doing this? My only requirement is that I have to use the ISC DHCPv6 implementation.

Also, assuming i can get this to work. What rules would I have to add to my firewall for it to work when firewall is enabled on the DHCPv6 server.

Score:0
sb flag

I use debian 11. From my experience you don't need to use statefull addressing for ipv6. It's more important to use route advertising give it to you by ISP, you don't need dhcpv6. My connection is pppd. I see now, for ipv6 i don't need any setting in /etc/network/interfaces:

auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set enp2s0 up # line maintained by pppoeconf
provider dsl-provider

allow-hotplug enp3s0
iface enp3s0 inet static
    address 192.168.1.1/24

allow-hotplug enp4s0
iface enp4s0 inet static
    address 192.168.2.1/24

allow-hotplug enp5s0
iface enp5s0 inet static
    address 192.168.3.1/24

For rise ip6 in my network i use WIDE-DHCPV6 with this simple setting in /etc/wide-dhcpv6/dhcp6c.conf:

interface ppp0 {
        request domain-name-servers;
        request domain-name;
        send ia-na 1;
        send ia-pd 1;
};

id-assoc na 1 {
};

id-assoc pd 1{
        prefix ::/56 infinity;
        prefix-interface enp3s0 {
                sla-id 1;
                sla-len 8;
        };
        prefix-interface enp4s0 {
                sla-id 2;
                sla-len 8;
        };
        prefix-interface enp5s0 {
                sla-id 3;
                sla-len 8;
        };
};

reference: https://major.io/2015/09/11/time-warner-road-runner-linux-and-large-ipv6-subnets/ Now my network look like this:

root@srv1:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:e2:69:59:33:6a brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2e2:69ff:fe59:336a/64 scope link
       valid_lft forever preferred_lft forever
3: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:e2:69:59:33:6b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 2a02:2f0e:d114:4b01:2e2:69ff:fe59:336b/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::2e2:69ff:fe59:336b/64 scope link
       valid_lft forever preferred_lft forever
4: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:e2:69:59:33:6c brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet6 2a02:2f0e:d114:4b02:2e2:69ff:fe59:336c/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::2e2:69ff:fe59:336c/64 scope link
       valid_lft forever preferred_lft forever
5: enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:e2:69:59:33:6d brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.1/24 brd 192.168.3.255 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet6 2a02:2f0e:d114:4b03:2e2:69ff:fe59:336d/64 scope global tentative
       valid_lft forever preferred_lft forever
8: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp
    inet 188.27.50.191 peer 10.0.0.1/32 scope global ppp0
       valid_lft forever preferred_lft forever
    inet6 2a02:2f0e:d1ff:ffff::bc1b:32bf/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::bc1b:32bf peer fe80::1/128 scope link
       valid_lft forever preferred_lft forever

Don't forget /etc/default/wide-dhcpv6-client. Next you need RADVD service, this service make all you need for you entirelly network (/etc/radvd.conf):

interface enp3s0 {
  AdvSendAdvert on;
  MaxRtrAdvInterval 30;

  prefix ::/64 {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
  };
  RDNSS 2a02:2f0c:8000:3::1 2a02:2f0c:8000:8::1 {
    AdvRDNSSLifetime 30;
  };
};

interface enp4s0 {
  AdvSendAdvert on;
  MaxRtrAdvInterval 30;

  prefix ::/64 {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
  };
  RDNSS 2a02:2f0c:8000:3::1 2a02:2f0c:8000:8::1 {
    AdvRDNSSLifetime 30;
  };
};

interface enp5s0 {
  AdvSendAdvert on;
  MaxRtrAdvInterval 30;

  prefix ::/64 {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
  };
  RDNSS 2a02:2f0c:8000:3::1 2a02:2f0c:8000:8::1 {
    AdvRDNSSLifetime 30;
  };
};

Use your own public ipv6 DNS. NOW!!!! personally i discover RADVDUMP. This is piece of the art, it's show you all setting what you need, including prefix from you ISP. That prefix, i think, with some script, you can use inclusive with dhcpv6 server like ISC-DHCPV6-SERVER. Enjoy, and happy googleling.

cferoiu avatar
sb flag
And don't forget to try UFW for firewall. He use iptables default and have all silly setting like ICMP-TYPE default implement, and very easy to use.
Score:0
gb flag

Apparently enp1s0 prefix length should be: 64 is just a warning and not the cause of the issue.

In my particular case the reason this wasn't working was that the client wasn't accepting RAs. To accept RAs on a linux machine you have to set /proc/sys/net/net/ipv6/conf/eth0/accept_ra to 1 or 2.

Ron Maupin avatar
us flag
Using network sizes other than `/64` (with a couple of exceptions) with IPv6 can cause problems as many IPv6 features need `/64`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.