OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: elanfuture on December 28, 2021, 08:45:53 AM

Title: How to use LAN gateway for WireGuard clients
Post by: elanfuture on December 28, 2021, 08:45:53 AM
Hello, thanks for reading my question.
My current setup:
Internet -- ISP router (1stLAN 192.168.1.1) -- OPNsense (2ndLAN 10.0.1.1). Yes, but I have to use double NAT because it's a shared ISP router.

In OPNsense -- Services -- DHCPv4 -- [LAN], I set gateway to 10.0.1.10 (a socks5 proxy running on OpenWrt)
I have setup WireGuard according to the official road warrior guide.https://docs.opnsense.org/manual/how-tos/wireguard-client.html (https://docs.opnsense.org/manual/how-tos/wireguard-client.html)
Set tunnel address to 10.10.10.1/24, assigned interface WG to wg0, selected Hybrid outbound NAT rule generation.

I can connect WireGuard server with my android phone by WireGuard client (10.10.10.11/32, DNS server: 10.0.1.1) and can access both LANs and internet, but not through the sock5 gateway which is what I want.
I tried Disable Routes in advanced mode of Local Configuration, and set Gateway there, but without luck, the whole OPNsense seems stuck.

Can anyone shed some lights since i am a newbie here.
Sorry for that if it's a silly approach or deadly simple question.
Thanks for your time again.

Regards.