OPNsense Forum

English Forums => Virtual private networks => Topic started by: orybdunt on August 13, 2023, 03:21:28 PM

Title: Assign Wireguard VPN to a physical port
Post by: orybdunt on August 13, 2023, 03:21:28 PM
Hi everyone, I configured ProtonVPN (Wireguard) on my OPNsense firewall ( I followed this guide (https://gist.github.com/morningreis/eeda36e8bb07dcb750d77e9a744776e8)).
The VPN works, but I don't want to route all traffic through the the VPN.
My firewall box has 3 ethernet interface, WAN, LAN and a free interface that a want to assign to the VPN.
I thought of creating a bridge between the wireguard wg0 interface and the igb2 interface but from what I understand it would not work because Wireguard is only layer 3. How could I do that?
Title: Re: Assign Wireguard VPN to a physical port
Post by: Maurice on August 13, 2023, 03:53:51 PM
Assign igb2 to a new interface (OPT1 by default) and configure it with its own subnet. Then add the rule from the "Firewall Rules" section of the guide to OPT1 instead of LAN.

Cheers
Maurice
Title: Re: Assign Wireguard VPN to a physical port
Post by: orybdunt on August 14, 2023, 02:32:31 PM
Thank you, much simpler than I had imagined.
I configured the OPT1 interface to its subnet, enabled the DHCP server by also specifying the VPN's internal DNS server, and had to add the firewall rule to allow DNS server communication.
It works perfectly, now when I want to use the VPN I just plug the Ethernet cable into the appropriate port.