OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • Routing/NATing certain networks through VPN
« previous next »
  • Print
Pages: [1]

Author Topic: Routing/NATing certain networks through VPN  (Read 384 times)

gtech1

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Routing/NATing certain networks through VPN
« on: July 07, 2024, 06:25:43 pm »
Here's what I have done/got working so far:

1. connected to remove vpn server using openvpn
2. added a route for my wanted network to go through the vpn: route add 1.2.3.4/24 10.8.0.5

this works. I can ping the remote network from the OPNSense box

now I want to do the same with the clients sitting behind OPNSense

I setup an outbound NAT rule that says all traffic through the openvpn interface to be natted.
This *works* except it NATs ALL traffic, not just traffic for 1.2.3.4/24

Is there a way to do this without having to specify all my wanted networks in the NAT rules ?

I want only traffic through the OpenVPN interface to be natted
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Routing/NATing certain networks through VPN
« Reply #1 on: July 07, 2024, 06:38:56 pm »
Did you put the outbound NAT rule on the OpenVPN interface?
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

gtech1

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Routing/NATing certain networks through VPN
« Reply #2 on: July 08, 2024, 04:34:25 am »
Thank you, that was indeed the issue! I had done it on the the VPN name interface I created not just 'OpenVPN'. Once I changed the source, bam, it worked - you rock!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • Routing/NATing certain networks through VPN
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2