OPNsense Forum

English Forums => Virtual private networks => Topic started by: tverweij on August 15, 2023, 05:19:10 PM

Title: Nat routing from VPN [Solved]
Post by: tverweij on August 15, 2023, 05:19:10 PM
Step 1 - works
I have created a NAT rule on Adapter LAN: from LAN -> destination: myIP -> Redirect target: AnotherIP.

In the logs, I see:
LAN -> myIP Pass
WAN -> myIP Pass
WAN -> AnotherIP Pass

This works 100% as expected, so far, so good.
---------------------------------------------------------------------------------------------------------------

The step 2 - does not work
I have an OpenVPN Server, with a client attached.
The VPN server has the LAN and the network of myIP as local network (LAN is reachable).

I create a new NAT rule on adapter OpenVPN: from OpenVPN -> destination: myIP -> Redirect target: Another IP

In the logs, I see:
LAN -> myIP Pass
WAN -> myIP Pass

The last line (the NAT, WAN -> AnotherIP Pass) is missing what means that the NAT is not performed.

Is there a way to apply a NAT rule on an OpenVPN adapter?
Title: Re: Nat routing from VPN
Post by: tverweij on August 15, 2023, 05:34:16 PM
I found the cause.

In the automatic created Outbound rules there is no entry for the OpenVPN adapter.
That means that this outbound rule has to be created manually.

In my case, I had to add Outbound rule on adapter OpenVPN -> source any -> destination myIP_Network -> Translation/Target WAN Address

And after that, the NAT rule worked.