1
Virtual private networks / Re: Restart Wireguard after WAN Interface gets ready
« on: August 28, 2023, 03:16:16 pm »
I found this thread when searching for a solution for the exact same issue.
Based on the newwanip hint in the thread you linked, I cowboyed this solution together by adding the following 2 functions to /usr/local/etc/inc/plugins.inc.d/wireguard.inc.
It seems to work.
On WAN interface DHCP renew -
Thanks for helping me find the original thread! I hope this helps you.
Based on the newwanip hint in the thread you linked, I cowboyed this solution together by adding the following 2 functions to /usr/local/etc/inc/plugins.inc.d/wireguard.inc.
It seems to work.
Code: [Select]
function wireguard_configure()
{
return [
'newwanip' => ['wireguard_configure_do'],
];
}
function wireguard_configure_do()
{
mwexec("/usr/local/sbin/configctl -dq wireguard restart");
}
On WAN interface DHCP renew -
Quote
2023-08-28T14:11:22 Notice kernel <6>wg2: link state changed to UP
2023-08-28T14:11:19 Notice kernel <6>wg1: link state changed to UP
2023-08-28T14:11:19 Notice kernel <6>wg0: changing name to 'wg1'
2023-08-28T14:11:19 Notice kernel <6>wg2: link state changed to DOWN
2023-08-28T14:11:19 Notice kernel <6>wg1: link state changed to DOWN
2023-08-28T14:11:19 Notice opnsense /usr/local/etc/rc.newwanip: plugins_configure newwanip (execute task : wireguard_configure_do())
Thanks for helping me find the original thread! I hope this helps you.