OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: dsh on November 14, 2021, 07:40:11 AM

Title: How to use route LAN through Wireguard peer?
Post by: dsh on November 14, 2021, 07:40:11 AM
Hello, I have following config.

WAN: x.x.x.7/24 GW: x.x.x.1
LAN: 172.16.0.1/24

Then I have followed https://www.thomas-krenn.com/en/wiki/OPNsense_WireGuard_VPN_for_Road_Warrior_configuration (https://www.thomas-krenn.com/en/wiki/OPNsense_WireGuard_VPN_for_Road_Warrior_configuration) tutorial and it works as intended.

OPNsense wg0: 10.10.0.1
Peer wg0: 10.10.0.2

Only change I made is the peer's allowed IP is 0.0.0.0/0. Now OPNsense routes through this peer.

Now I'd like LAN clients to route through Wireguard Peer.

Basically users from LAN: 172.16.0.50->172.16.0.1->10.10.0.2->0.0.0.0/0

How can I do this?
Title: Re: How to use route LAN through Wireguard peer?
Post by: koushun on December 06, 2021, 02:18:21 PM
Basically do this (I think - I cannot find my notes on how I did this):
1. System > Gateways > Add gateway.
Name can be 'GW_WireGuard' - the interface selected would be your WG interface.
2. Make a rule on the LAN interface; expand the ruleset (advanced or something) and select your newly created gateway instead of the default gateway.

Maybe this can get you started?