OPNsense Forum

Archive => 19.7 Legacy Series => Topic started by: whit on September 19, 2019, 08:23:27 PM

Title: Is WireGuard presently limited to two tunnels?
Post by: whit on September 19, 2019, 08:23:27 PM
After success with two tunnels, trying to add a third, but while ifconfig shows wg0 and wg1, there's no wg2 as there should be now. Is this a limitation in the current implementation here, or have I missed something?
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: mimugmail on September 19, 2019, 09:02:10 PM
Try via console:
/usr/local/etc/rc.d/wireguard restart

And you'll see the error (in your configuration).

Tunnels are not limited.
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: whit on September 19, 2019, 09:43:09 PM
Thanks for the suggestion. It reveals nothing:

root@OPNsenseFL1:~ # /usr/local/etc/rc.d/wireguard restart
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: whit on September 19, 2019, 10:21:44 PM
Ah! I see the problem. It is necessary not just to hit Save in both Local and Endpoint individual setup pages, but also the Save again on at least the Local page listing each of the Local endpoint -- even though they've already been saved individually. So it's not the Save button for the individual Local and Endpoint setup pages which builds the config file, but the Save button for the page which lists all the Locals.

Perhaps that would be clearer if it were labelled "Apply" rather than "Save"?

Best,
Whit
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: whit on September 19, 2019, 10:51:00 PM
There is something glitchy in that though. It initiated the third tunnel with those "extra" Save options, but it dropped one of the existing tunnels. Going through the pages again for the now-dropped tunnel, pressing Save for the individual as well as group pages, got us back to having three tunnels running.

Again, that was an established tunnel. Nothing was changed on it. And nothing was changed on it since then either. There might be some timing dependency as it starts multiple WireGuard tunnels that can cause it to fail on one.

Whit
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: mimugmail on September 20, 2019, 05:40:30 AM
Sounds like /24 in Tunnel address instead of /32? Have you checked OPNsense Docs for this? I added a note there some weeks ago.

Every save in every tab should trigger a restart.
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: whit on September 20, 2019, 07:49:01 PM
Each address is/was a /32 for the wg interfaces.

The problem where I finally got the 3rd tunnel up and it dropped the 2nd in doing so, until I pressed all the "Save" buttons again without editing anything, looks like a separate thing. But since that firewall is in production, I can't go bouncing the tunnels up and down to see how replicable it is. Might have been a one-off event.
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: mimugmail on September 21, 2019, 07:21:03 AM
For me, it sounds like /24 instead of /32. If you can reproduce it some more times I can have a look, but please understand that I don't have the time to build a lab just trying to reproduce (which I did some weeks ago for the /32 thing which was just lack of documentation)
Title: Re: Is WireGuard presently limited to two tunnels?
Post by: whit on September 23, 2019, 04:26:22 PM
Honestly, I never set any of these addresses as a /24. Always a /32.

Is your theory that setting it as a /24 would block the writing of the config file for the wireguard instance? It wasn't that, but something obviously prevented it from being created until the Save button on the main page -- not those one the "inside" pages -- was pressed. I'll try this again on our current spare system, which we haven't placed into its future DR role yet.