DHCPv6 ipv6 - static mappings [solved]

Started by RamSense, December 01, 2021, 07:48:31 PM

Previous topic - Next topic
December 05, 2021, 12:09:01 PM #15 Last Edit: December 05, 2021, 12:25:54 PM by RamSense
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?
Deciso DEC850v2

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. :)

OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

December 05, 2021, 05:01:01 PM #17 Last Edit: December 05, 2021, 05:30:45 PM by RamSense
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?
Deciso DEC850v2