OPNsense Forum

English Forums => Virtual private networks => Topic started by: Clauu on October 01, 2023, 05:09:28 PM

Title: LAN traffic through Openvpn
Post by: Clauu on October 01, 2023, 05:09:28 PM
Good day people, i've started to play with Opnsense and Openvpn and i've encountered some issues which i'm unable to sort out. My setup looks like this:
Main router with 192.168.140.0/24 subnet on it, Opnsense VM having 192.168.140.106 with a separate wan interface.
I've managed to setup Openvpn, i can connect through internet. But while connected i can only access the Openvpn LAN IP which is 192.168.140.106, anything else from 192.168.140.0/24 isn't accesible, not even the gateway.

In Opnsese i have following rules:
1. LAN - in and out allow any
2. Openvpn - in and out allow any
3. WAN - allow only 1194 udp

Openvpn has the following configuration :
- IPv4 Local Network as 192.168.140.0/24
- IPv4 Tunnel Network as 10.10.99.0/24
Title: Re: LAN traffic through Openvpn
Post by: bartjsmit on October 02, 2023, 11:26:50 AM
Do any of your LAN hosts have a route to the OpenVPN tunnel? Unless OPNsense is your default gateway, they'll send their replies out through your ISP router.

You can either set a route on your hosts (e.g. by DHCP), make OPNsense your main router, or NAT the OpenVPN traffic.

None of these are ideal solutions, I'm afraid. They'll either take work and/or add unecessary complexity.

Bart...
Title: Re: LAN traffic through Openvpn
Post by: Clauu on October 05, 2023, 12:45:47 PM
Thank you for your reply! Well maybe i'm missing some routes, i will try to debug again.
Title: Re: LAN traffic through Openvpn
Post by: Clauu on October 12, 2023, 10:19:21 AM
Yep, indeed, i was missing some routes.. silly me.
Thank you for your input!