OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: RamSense on December 01, 2021, 07:48:31 PM

Title: DHCPv6 ipv6 - static mappings [solved]
Post by: RamSense on December 01, 2021, 07:48:31 PM
My ISP has just enabled ipv6.

I followed this guide: https://homenetworkguy.com/how-to/configure-ipv6-opnsense-with-isp-such-as-comcast-xfinity/ (https://homenetworkguy.com/how-to/configure-ipv6-opnsense-with-isp-such-as-comcast-xfinity/)
and all works and I have ipv6.

under Services - DHCPv6 - leases I can see some devices and make lease type static. But why are not all ipv6 devices showing up? When I look in AdGuard Home I can see the other devices working and dns queries, but they do not automatically show up in opnsense-services-DHCPv6. Is this a bug? Or what do I have to do?
Title: Re: DHCPv6 ipv6 - static mappings
Post by: Greelan on December 01, 2021, 08:47:07 PM
You're probably seeing SLAAC generated addresses - for devices that are also receiving DHCPv6 addresses, and for devices that are not (eg Android devices)
Title: Re: DHCPv6 ipv6 - static mappings
Post by: RamSense on December 01, 2021, 09:21:37 PM
Can there be SLAAC generated addresses while I have set opnsense to [track interface]?
under opnsene-interfaces-lan-IPv6 Configuration Type -> Track interface
Title: Re: DHCPv6 ipv6 - static mappings
Post by: Greelan on December 01, 2021, 09:29:20 PM
What mode is set under services/router advertisements?
Title: Re: DHCPv6 ipv6 - static mappings
Post by: RamSense on December 01, 2021, 09:34:47 PM
Router Advertisements is set to [managed]
Title: Re: DHCPv6 ipv6 - static mappings
Post by: Greelan on December 01, 2021, 09:43:10 PM
OK. That should mean DHCPv6 only. You can check on clients that they only have the DHCPv6 address and no other IPv6 address except for link-local

It's also possible that until you set that RA setting, clients generated SLAAC addresses (by default OPN does SLAAC unless you change it) and they have not yet been deprecated. If a client has SLAAC addresses you can test this by rebooting it - the SLAAC addresses should go away

Otherwise I'm not sure what you are observing because my setup is SLAAC only (plus DNS records)
Title: Re: DHCPv6 ipv6 - static mappings
Post by: RamSense on December 01, 2021, 09:48:41 PM
thnx. sounds like a possibility. I will reboot some devices and opnsense to see what happens...
Title: Re: DHCPv6 ipv6 - static mappings
Post by: RamSense on December 02, 2021, 07:51:45 AM
I did reboot opnsense yesterday and waited until today to boot a laptop to see what happens.
And indeed, the laptop did show up in DHCPv6! so I will do that with other devices also. thnx for the depreciated hint.

I also noticed that with the reboot of opnsense my wan ipv4 stayed the same as normal. But my ipv6 did change.
Than I remembered the guide: https://homenetworkguy.com/how-to/configure-ipv6-opnsense-with-isp-such-as-comcast-xfinity/ (https://homenetworkguy.com/how-to/configure-ipv6-opnsense-with-isp-such-as-comcast-xfinity/)

interfaces - WAN - prevent release (see the attached picture from that guide website)

I can not find that setting on interfaces - wan page. Where is this setting now?
Title: Re: DHCPv6 ipv6 - static mappings
Post by: Greelan on December 02, 2021, 08:35:49 AM
Looks like it has been removed recently? Not sure exactly which version

Not sure it would help you much if your ISP stupidly changes your prefix regularly tho
Title: Re: DHCPv6 ipv6 - static mappings [solved]
Post by: RamSense on December 02, 2021, 08:40:45 AM
humm... ok. well I'll keep a watch on this setting and hoping it will show up again with the next update of opnsense :-)
Title: Re: DHCPv6 ipv6 - static mappings [solved]
Post by: marjohn56 on December 02, 2021, 08:55:58 AM
You'll find the 'no release' option in Intefaces->Settings. You'll need to reboot after you save and apply.
Title: Re: DHCPv6 ipv6 - static mappings [solved]
Post by: RamSense on December 02, 2021, 08:58:16 AM
@Marjohn56: Thanks. Found it!
Title: Re: DHCPv6 ipv6 - static mappings [solved]
Post by: RamSense on December 02, 2021, 07:52:03 PM
---
Title: Re: DHCPv6 ipv6 - static mappings [re-opened]
Post by: RamSense on December 05, 2021, 08:29:29 AM
I have IPV6 running and added the devices with the static option.
But now I noticed that the devices added to static works fine on that day, and the next day it does not get its IPV6 ip anymore......

Removing the device from static list to add again did not work, device did not get ipv6 (MacBook Pro)

I finally decided to reboot opnsense, and than ipv6 worked again. The removed device got its ipv6 ip back (although not added as static anymore) and received the same ipv6 ip as before. The static iPhones got an ipv6 fe80:. than on the iPhones After setting wifi off and on again it got its static ipv6 ip again also.
The Synology NAS got its static ipv6 ip again...
How is it that opnsense IPV6 stops working after a day? Others having problems with this? How to solve? Or has it to do with the static ipv6? config error? To me it looks like a bug in opnsense or FreeBSD

Thanks in advance for the help!
Title: Re: DHCPv6 ipv6 - static mappings [re-opened]
Post by: marjohn56 on December 05, 2021, 11:39:39 AM
This, we are pretty certain is an issue with FreeBSD12 and IPv6 multicast, it's been a pain in the a**** all the time we've been on FreeBSD12. Hopefully the move to FreeBSD13 in 22.1 will see the end of it. Currently the only solution appears to be a Cron event to restart dhcpdv6 and radvd every 12 hours or so. It doesn't happen every day and my system may run for a week or more without the issue appearing but sure as night follows day, it will happen at some point.


Franco spent a lot of time trying to resolve this, and did improve it, but sadly did not solve it.
Title: Re: DHCPv6 ipv6 - static mappings [re-opened]
Post by: RamSense on December 05, 2021, 12:09:01 PM
Ah, that explains a lot. Hope to get to 22.1 soon :-)

I tried to add a cron in the GUI but I could not find the Command for dhcpdv6 or radvd.
Can you explain how to do this? Sounds like a solution for now while waiting for 22.1 to arrive, or just wait for the 22.1 arrive in januari?
Title: Re: DHCPv6 ipv6 - static mappings [re-opened]
Post by: marjohn56 on December 05, 2021, 04:28:41 PM
You cannot just add commands to Cron, security within Opnsense prevents this, you first need to create and add an action_*.conf file to '/usr/local/opnsense/service/conf/actions.d'. Each conf file contains the definitions for the commands used by Cron. We want to restart radvd and dhcpdv6, so we need an action file for both; we could create a seperate script that restarts both, but we'll do it individually in this case. Each fie contains the command option, in this case 'restart', the command, the type and descrription:

[restart]
command:/usr/local/sbin/pluginctl -s -s dhcpd6 restart
parameters:
type:script
message:restarting dhcpdv6
description:Restart dhcpdv6 service

radvd is the same, but we just replace the relevent bits.


Once we have created the files and they are in the directory we issue the command
#service configd restart
This causes the system to reload the new comands into the system so we can access them from the cron setup. So next goto the cron setup and you should now find the restart_radvd and restart_dhcpdv6 options in the drop down list. I've attached the files to make it easier for you. :)

Title: Re: DHCPv6 ipv6 - static mappings [re-opened]
Post by: RamSense on December 05, 2021, 05:01:01 PM
Ah great!
Got the files. Next step adding them to opnsense.

created the file action_radvd.conf and dhcpdv6 while I wasn't able to move the file to opnsense, just did not know how. But it did not work. Than I noticed your file had an added s - actionS_radvd.conf and that worked!
Thanks. I have now 2 cron jobs added with [hours] 6
So I think it will run every 6 hours. Is that the recommended setting?