How to use route LAN through Wireguard peer?

Started by dsh, November 14, 2021, 07:40:11 AM

Previous topic - Next topic
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 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?

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?







Running OPNsense through Proxmox
4 x Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (1 Socket)
24 GB RAM