OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: wbk on March 18, 2023, 11:32:40 pm

Title: DHCP6 static lease advertisements have no effect
Post by: wbk on March 18, 2023, 11:32:40 pm
Hi all,

TL;WR: It's about DHCP6 on my LAN interface. I want stable IP's for either local or global name resolving.


Full version:
Am I supposed to be able to create static leases for IPv6 as you'd do for IPv4 in case you like to have stable addresses in your network? I'm quite lousy with BB-code, please bear with me for markup errors!

My goals:

These things work for their IPv4 counterparts, but I really like to move forward and get started to leave IPv4 behind me (as a part of leaving it behind us and create a better world and all that).

There may be workarounds for those goals, but static DHCP6 seems the cleanest solution with current knowledge. Unfortunately, with current knowledge, I can't get it to work.

Settings overview, please let me know if more is needed for a picture:
Code: [Select]
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 91505 - [meta sequenceId="542"] Solicit message from fe80::b2de:ebff:fe5a:2668 port 546, transaction ID 0xA1C85E00
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 75167 - [meta sequenceId="543"] Solicit message from fe80::b2de:ebff:fe5a:2668 port 546, transaction ID 0xA1C85E00
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 91505 - [meta sequenceId="544"] Advertise NA: address 2a10:3781:2d49:a:26:3:104:2668 to client with duid 00:01:00:01:28:c1:5c:be:b0:de:eb:5a:26:68 iaid = -346413464 static
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 75167 - [meta sequenceId="545"] Advertise NA: address 2a10:3781:2d49:a:26:3:104:2668 to client with duid 00:01:00:01:28:c1:5c:be:b0:de:eb:5a:26:68 iaid = -346413464 static
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 91505 - [meta sequenceId="546"] Sending Advertise to fe80::b2de:ebff:fe5a:2668 port 546
<190>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 75167 - [meta sequenceId="547"] Sending Advertise to fe80::b2de:ebff:fe5a:2668 port 546
<187>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 91505 - [meta sequenceId="548"] send_packet6: Permission denied
<187>1 2023-03-18T12:34:09+01:00 vpoort.osba.nl dhcpd 91505 - [meta sequenceId="549"] dhcpv6: send_packet6() sent -1 of 117 bytes

These blocks repeat for configured leases. Another thing you'll notice, are the last two lines: permission denied, I guess on port 546/547. In the live viewer of the firewall log, there are only 'pass' lines for those ports.

The SLAAC-addresses so far are outside of the DHCP6-range I defined, as are the static IP's I assigned client side. The IP's I want to assign via static lease are outside of the DHCP-range as well (as they should; to be sure I understood correctly, I tested creating a static lease with an IP inside of the range, and the GUI gave me an error).

I've been baning my head against this wall for most of a week now, I'm at my wits end.

Thank you for reading my lengthy post, I hope you can give me some pointers!
Title: Re: Trying to set static DHCP6 leases
Post by: YipieKaie on March 19, 2023, 01:13:33 pm
I dont use SLAAC i use managed it works perfect
There is only one problem with to use managed that is
android phones only work in SLAAC mod.

//P
Title: Re: Trying to set static DHCP6 leases
Post by: wbk on March 19, 2023, 02:58:31 pm
Hi Peter,

Thank you for reading and replying :-)

Let me match my config to your screenshots and test a bit before I post back!
Title: Re: Trying to set static DHCP6 leases
Post by: YipieKaie on March 19, 2023, 03:12:58 pm
You also have to set a range in >SERVICES: DHCPV6: [LAN]
that is in your subnet range

""""This is just an example you have to calculate your own""""
Subnet:            2001:9b1:eff:4300::
Avalible range:  2001:9b1:eff:4300:: - 2001:9b1:eff:4300:ffff:ffff:ffff:ffff
Range from:      2001:9b1:eff:4300:192:168:1:100 Range to: 2001:9b1:eff:4300:192:168:1:200


//P
Title: Re: Trying to set static DHCP6 leases
Post by: wbk on March 19, 2023, 09:40:25 pm
You also have to set a range in >SERVICES: DHCPV6: [LAN]
that is in your subnet range

Thanks for the added pointer; DHCP6 works for dynamic assignments within the DHCP6-range:
(https://online.osba.nl/blog/wp-content/uploads/2023/03/ipv6-prefix-subnet-dhcp6-range.png)

It is the static leases that fail. Here is an example of such a static assignment; note the MAC address that is visible in the logging below on the second line from below, for hostname 'test':


(https://online.osba.nl/blog/wp-content/uploads/2023/03/static-dhcp6-assignment.png)

Now when I dhclient -6 the client side, it just hangs in the terminal.


Code: [Select]
root@test:~# hostname -I
172.26.3.107
root@test:~# dhclient
root@test:~# hostname -I
172.26.3.107
root@test:~# dhclient -6
^C
root@test:~# ip a |grep ether
    link/ether 20:08:cc:b0:a8:b7 brd ff:ff:ff:ff:ff:ff link-netnsid 0
root@test:~# dhclient -6

(nothing for 10+ minutes)


At first there is a bit of activity in tail -f /var/log/dhcp/latest.log on OPNsense (this is from the last command, not the two previous 'dhclient' commands in the box above:

Code: [Select]
<190>1 2023-03-19T21:07:03+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="83"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0x520E7F00
<191>1 2023-03-19T21:07:03+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="84"] Picking pool address 2a10:3781:2d49:172:26:90:0:9148
<190>1 2023-03-19T21:07:03+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="85"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:9148 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 valid for 7200 seconds
<190>1 2023-03-19T21:07:03+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="86"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:07:05+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="87"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0x520E7F00
<191>1 2023-03-19T21:07:05+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="88"] Picking pool address 2a10:3781:2d49:172:26:90:0:9148
<190>1 2023-03-19T21:07:05+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="89"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:9148 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 valid for 7200 seconds
<190>1 2023-03-19T21:07:05+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="90"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:07:07+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="91"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0x520E7F00
<191>1 2023-03-19T21:07:07+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="92"] Picking pool address 2a10:3781:2d49:172:26:90:0:9148
<190>1 2023-03-19T21:07:07+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="93"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:9148 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 valid for 7200 seconds
<190>1 2023-03-19T21:07:07+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="94"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:07:11+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="95"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0x520E7F00
<191>1 2023-03-19T21:07:11+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="96"] Picking pool address 2a10:3781:2d49:172:26:90:0:9148
<190>1 2023-03-19T21:07:11+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="97"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:9148 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 valid for 7200 seconds
<190>1 2023-03-19T21:07:11+01:00 vpoort.osba.nl dhcpd 89600 - [meta sequenceId="98"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546

This behaviour is different than in my opening post (where there would be two simoultanous DHCP6 advertisemnets, one correct followed by one bad). Two things are particular now:

By the way, I configured my OPNsense following your screenshots, except for one : " DHCP Static Mappings    v Register DHCP static mappings
If this option is set, then DHCP static mappings will be registered in Unbound, so that their name can be resolved. You should also set the domain in System: General setup to the proper value. "

If I understand correctly, this option is part of the reason for me to jump through these hoops in the first place.
Title: Re: Trying to set static DHCP6 leases
Post by: wbk on March 19, 2023, 09:57:46 pm
On closer inspection, I notice a difference between the DUID in the screenshot of the static lease configuration, and the DUID that is announced in the log:

00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7
00:01:00:01:27:c1:02:55:20:08:cc:b0:a8:b7

Peculiar, because I used the +button on the dynamic lease to create the static lease in the first place.

I now updated the static lease condiguration, and tried again, with no success:

(https://online.osba.nl/blog/wp-content/uploads/2023/03/all-dhcp6-leases.png)

Code: [Select]
<190>1 2023-03-19T21:42:55+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="503"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:42:55+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="504"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:42:55+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="505"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:42:56+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="506"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:42:56+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="507"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:42:56+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="508"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:42:58+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="509"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:42:58+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="510"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:42:58+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="511"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:43:01+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="512"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0x8CD54000
<191>1 2023-03-19T21:43:01+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="513"] Picking pool address 2a10:3781:2d49:172:26:90:0:2962
<190>1 2023-03-19T21:43:01+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="514"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:2962 to client with duid 00:01:00:01:27:c1:02:55:20:08:cc:b0:a8:b7 iaid = -860837705 valid for 7200 seconds
<190>1 2023-03-19T21:43:01+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="515"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:43:02+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="516"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:43:02+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="517"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:43:02+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="518"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:43:10+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="519"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:43:10+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="520"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:43:10+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="521"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:43:15+01:00 vpoort.osba.nl dhcpd 86487 - [meta sequenceId="522"] DHCPREQUEST for 172.26.79.111 from 1c:cc:d6:41:b7:8b via em0
<190>1 2023-03-19T21:43:15+01:00 vpoort.osba.nl dhcpd 86487 - [meta sequenceId="523"] DHCPACK on 172.26.79.111 to 1c:cc:d6:41:b7:8b via em0
<190>1 2023-03-19T21:43:26+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="524"] Solicit message from fe80::2208:ccff:feb0:a8b7 port 546, transaction ID 0xF05C5E00
<190>1 2023-03-19T21:43:26+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="525"] Advertise NA: address 2a10:3781:2d49:172:26:3:107:0 to client with duid 00:01:00:01:27:58:cc:ce:20:08:cc:b0:a8:b7 iaid = -860837705 static
<190>1 2023-03-19T21:43:26+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="526"] Sending Advertise to fe80::2208:ccff:feb0:a8b7 port 546
<190>1 2023-03-19T21:43:29+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="527"] Solicit message from fe80::f465:9aff:fee0:18e9 port 546, transaction ID 0x7728B000
<191>1 2023-03-19T21:43:29+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="528"] Picking pool address 2a10:3781:2d49:172:26:90:0:a9ef
<190>1 2023-03-19T21:43:29+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="529"] Advertise NA: address 2a10:3781:2d49:172:26:90:0:a9ef to client with duid 00:01:00:01:26:ff:cd:f9:f6:65:9a:e0:18:e9 iaid = -1696589591 valid for 7200 seconds
<190>1 2023-03-19T21:43:29+01:00 vpoort.osba.nl dhcpd 39737 - [meta sequenceId="530"] Sending Advertise to fe80::f465:9aff:fee0:18e9 port 546


Log records and forum viewers are not a fortunate couple, sorry for that. There is a number of times a sollicit message from the updated DUID, followed by an advertisement, and *one* sollicit from the incorrect DUID, followed by an advertisement.

The client just hangs on the dhclient -6 command, and searching the leases overview above for the part of the string that is identical (namely, the MAC of the client) only reveals the one static, inactive, assignment.

I have no clue what causes this behaviour, any idea?