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

    PfSense as a Standlone OpenVPN Endpoint?

    Scheduled Pinned Locked Moved OpenVPN
    6 Posts 4 Posters 2.1k 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.
    • D
      downtown
      last edited by

      Can pfSense be configured to sit on a LAN (behind a gateway, through which the OpenVPN incoming traffic is NATed) and just be an OpenVPN endpoint to allow traffic to the same LAN?

      1 Reply Last reply Reply Quote 0
      • V
        viragomann
        last edited by

        Yes, that works. I've currently such a setup running.

        1 Reply Last reply Reply Quote 0
        • D
          downtown
          last edited by

          Any chance you could give me a rough idea of how to set that up?  Or what to google for in order to find out how it's done?

          1 Reply Last reply Reply Quote 0
          • V
            viragomann
            last edited by

            There is nothing special with this setup.
            Just set up an OpenVPN server: https://doc.pfsense.org/index.php/OpenVPN_Remote_Access_Server
            You may also use the wizard for that.

            The only challange here is to route the response traffic back to the VPN client. Since pfSense wouldn't be the default gateway in LAN here, the LAN devices will direct their responses to vpn clients to the gateway instead of to pfSense and the packets get miss-routed.
            To get this working you either can add a route to each LAN device you want access from vpn or you do SNAT at pfSense to translate source address of any packet from a vpn client to the pfSense LAN address. But this way, any access seem to come from pfSense, which want be ideal, since you cannot differ vpn users.

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

              You can get rid of routing issues by placing your vpn box that is behind gateway on a transit vlan vs on the lan your users are on.  So this removes the asymmetrical routing problem but leaves you with hairpin configuration.

              But this is a hack sort of solution to be honest.  Your vpn endpoint really belong at the edge, not internal to your network.  If the device is internal you either end up with asymmetrical routing or have to do host routing, and you end up with hairpins.. Placing the vpn at the edge of the network removes all of these issues.

              While you could for sure leverage pfsense as just a openvpn appliance sort of thing.  Putting one leg of it outside is the better solution if you can not just use it as your edge/border firewall/router and openvpn device.  To do this you do need more more than 1 public IP.

              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
              • S
                Soyokaze
                last edited by

                Or you can just NAT packets from VPN to local subnet, that way you will not have a problem with asymmetrical routing, but, depending on number of VPN users and services they will access in your LAN, you can have from almost zero problems (for web services for ex.) to totally non-working (services which really doesn't like to be NATed, like SMB or NFS).

                Need full pfSense in a cloud? PM for details!

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