OPNsense Forum

English Forums => Virtual private networks => Topic started by: achocolada on December 27, 2023, 04:32:33 AM

Title: Problem Connect OpenVPN Behind Router
Post by: achocolada on December 27, 2023, 04:32:33 AM
Hi everyone,

I have problem to connect OpenVPN which is installed on the OPNsense located behind the internet router. The topology is as follows:
Internet Routet(Mikrotik) ----> OPNsense ---> LAN

I've already added NAT rule on the Router to forward port 1194 to the OPNsense's IP, but the OpenVPN still doesn't connect. When I OpenVPN from the OPNsense local IP address it just works, means that no problem the VPN server configuration.

Are you guys have the solutions for this? thank you :)
Title: Re: Problem Connect OpenVPN Behind Router
Post by: bartjsmit on December 27, 2023, 09:20:54 AM
Does the tunnel endpoint have a route to LAN via OPNsense?

If there isn't, you'll have to do outbound NAT for OpenVPN in OPNsense
Title: Re: Problem Connect OpenVPN Behind Router
Post by: FraLem on December 27, 2023, 09:37:05 AM
Check firewall rules on the WAN interface accordingly. I guess that by "NAT Rule"you mean port forward, right? 
Title: Re: Problem Connect OpenVPN Behind Router
Post by: achocolada on December 27, 2023, 10:55:14 AM
Quote from: bartjsmit on December 27, 2023, 09:20:54 AM
Does the tunnel endpoint have a route to LAN via OPNsense?

If there isn't, you'll have to do outbound NAT for OpenVPN in OPNsense

In the future I will need to add route from OpenVPN client to the LAN segment, but for this time there is no route yet.

I checkek on the Outboud NAT, and there is no automatic rule generated.
On the Outbound NAT, there are 4 options and the current is automatic NAT generation.
So, did you mean I have to add manual outbound NAT rules ?
Title: Re: Problem Connect OpenVPN Behind Router
Post by: achocolada on December 27, 2023, 10:58:40 AM
Quote from: FraLem on December 27, 2023, 09:37:05 AM
Check firewall rules on the WAN interface accordingly. I guess that by "NAT Rule"you mean port forward, right?

I already recheck the firewall rules on mikrotik but still the same. Likely, the issue is on the OPNsense config, but dont know where :(
Title: Re: Problem Connect OpenVPN Behind Router
Post by: bartjsmit on December 27, 2023, 08:13:37 PM
Quote from: achocolada on December 27, 2023, 10:55:14 AM
I checkek on the Outboud NAT, and there is no automatic rule generated.
On the Outbound NAT, there are 4 options and the current is automatic NAT generation.
So, did you mean I have to add manual outbound NAT rules ?
Yes, or hybrid - they will have the same effect since there is no automatic rule
Title: Re: Problem Connect OpenVPN Behind Router
Post by: achocolada on December 29, 2023, 04:48:41 AM
unfortunately I couldn't resolve this problem, so I decided to reset to default :(
thank you guys.