OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of knn28 »
  • Show Posts »
  • Messages
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Messages - knn28

Pages: [1]
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.

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.

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2