OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: astuckey on May 19, 2021, 10:20:25 AM

Title: [SOLVED] Wireguard + Captive Portal
Post by: astuckey on May 19, 2021, 10:20:25 AM
Hi all,

Just wondering if anyone has tried Wireguard with the Captive Portal?

My attempts to get it to work have ended in misery so far, essentially once the WG tunnel is set up, all packets can get through without needing to use the Captive Portal.

I have a feeling this might be due to the Captive Portal only being able to see the individual wgX interfaces. The Firewall section only seems to have an effect on the parent "WireGuard" interface that doesn't get listed in the Interfaces section (a general frustration with the WG plugin, FW rules on the individual WG interfaces wg0, wg1 etc don't have an affect).

(http://interfaces.jpg)
(http://firewall.jpg)
(http://captiveportal.jpg)

Kind Regards,
Adam
Title: Re: Wireguard + Captive Portal
Post by: Obeng on June 18, 2021, 07:19:21 PM
I wrote a short article about how to go about it

https://obengafrane-oa.medium.com/wireguard-peer-authentication-a-captive-portal-approach-c464e4be8675
Title: Re: [SOLVED] Wireguard + Captive Portal
Post by: astuckey on July 15, 2021, 08:00:36 PM
Thank you very much Obeng for putting that together, it is working like a dream now.
The issue I had was having the "generic" WireGuard interface with an allow all rule, a WG tutorial I read mentioned that the rules only work on this generic interface, not the individually assigned interface per WG tunnel.

Once I swapped the rules over everything worked.

Thanks again for your help.
Title: Re: [SOLVED] Wireguard + Captive Portal
Post by: Obeng on July 28, 2021, 10:12:25 AM
You are welcome