What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Execute script after DHCPv6 lease renewal?

i0ntempest

Occasional Visitor
Is there a simple way to execute a script after odhcp6c client renews its lease? Reason I ask this is because I have a ULA range setup in my network and every time odhcp6c renews its lease my ULA prefix on br0 gets cleared. This renew does not appear to trigger any user scripts.
I know that odhcp6c executes /tmp/dhcp6c (a symlink to rc) for status updates, but the arguments passed to odhcp6c seems to be hardcoded into the rc binary so there’s no simple way to change it.
I have a BE88U running latest Merlin firmware (3006).
Thanks in advance.
 
I’m not running 3006.103, but you should be able to use /jffs/scripts/dhcpc-event to capture the event (updated, bound, ra-updated, etc.) and the IP protocol (4 or 6).
Code:
Feb  9 19:09:50 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 10 06:30:01 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 11 19:09:52 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 12 06:30:01 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 13 19:09:54 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 14 06:30:01 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 15 19:09:56 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 16 06:30:01 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 17 19:09:57 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 18 06:30:01 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 19 19:10:01 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 20 06:30:02 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
Feb 21 19:10:03 custom_script: Running /jffs/scripts/dhcpc-event (args: updated 6)
Feb 22 06:30:02 custom_script: Running /jffs/scripts/dhcpc-event (args: renew 4)
 
I’m not running 3006.103, but you should be able to use /jffs/scripts/dhcpc-event to capture the event (updated, bound, ra-updated, etc.) and the IP protocol (4 or 6).
I didn’t try but the official documentation says this works only with udhcpc, no mention of odhcp6c. You sure it’s going to work with DHCPv6?
 
I didn’t try but the official documentation says this works only with udhcpc, no mention of odhcp6c. You sure it’s going to work with DHCPv6?
Here’s the code behind /tmp/dhcp6c

I also updated my earlier post to show logs of it being invoked when my DHCPv6 lease is updated.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top