Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Best way to route VPN traffic from specified devices?

    Scheduled Pinned Locked Moved Routing and Multi WAN
    2 Posts 2 Posters 418 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      steveharman
      last edited by

      Hi,

      We have an OpenVPN client setup in pfSense 2.3.4.  I'd like to nominate four devices on LAN to use the OpenVPN connection but leave all other traffic using the regular LAN / WAN routing.

      I'd thought of assigning the OpenVPN client to Opt1, hanging a small switch off the back of our VDSL modem and hooking up both Opt1 and WAN to the switch - then setting up a group containing the four IPs which need to use the VPN and telling pfSense to route that group over Opt1 (the VPN).

      But I'm only just returning to pfSense after a few years and my head is spinning!  :-)

      Any suggestions would be much appreciated.

      Thanks,

      Steve

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        This is a simple policy route.
        https://doc.pfsense.org/index.php/What_is_policy_routing

        Make sure that you do not pull routes from your vpn client you setup on pfsense, or it most likely will set your default route out the vpn.  Then the IP of the devices you want to go out your vpn just create a firewall rule saying these IPs (could use aliases to have them all in 1 rule) use the vpn as its gateway.

        if these devices need access to other local segments then you would have to put a rule above this routing rule so that they could get access to those networks.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.