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

    Tutorial: Configuring pfSense as VPN client to Private Internet Access

    OpenVPN
    99
    348
    418.3k
    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
      sogseal
      last edited by

      @Derelict:

      Post the rule that forwards your traffic to PIA.

      I got my new mobo coming today, ill se teverything up and post it, thank you for the help

      EDIT

      so i got my mobo MSI Z87I AC(waiting on AR9380). Pretty much i followed this guide to the end and added opendns ips( im on 2.2-RC (amd64)  built on Mon Dec 29 07:41:21 CST 2014 FreeBSD 10.1 RELEASE-p3) to System>General Setup DNS servers and i dont have nay DNS leaks

      1 Reply Last reply Reply Quote 0
      • J
        jptech
        last edited by

        After testing a bit, I see issues when using DHCP (LAN) and the DNS Forwarder.  Clients on the LAN are given the pfSense LAN IP as a DNS server and the DNS lookups done by the DNS Forwarder don't seem to be very sophisticated.  My firewall rules route a couple machines over the VPN and everything else goes over the WAN:

        However, I still see geo-optimized IPs when I do DNS lookups (ex: google.com).  I changed my DNS a bit to see if I could figure out what was going on.  I set two DNS servers:

        Note that one is set to use the WAN gateway and the other is set to use the TGNEWYORK gateway (I'm using TorGuard, not PIA).  After doing this, the behavior of one of my 'vpnclients' gives a good indication of what's happening.

        When I do a DNS leak test I can see that both DNS servers are being used and the route depends on which DNS server is picked by the DNS Forwarder.  I can tell this because it appears that TorGuard forces all DNS requests through OpenDNS, so half the servers found are Google, half are OpenDNS.

        There are two things to be careful of in my opinion.  1) Make sure all vpnclients bypass the DNS Forwarder.  2) Make sure normal connections don't use the VPN for DNS lookups.  I use a port forward rule to get the vpnclients to bypass the DNS Forwarder.  Note the rule uses the LAN interface.  Also note the firewall rule I have above to intentionally block all traffic from vpnclients to pfsense.

        Another option would be to make sure the DHCP server passes non-local DNS to clients, but keeping the vpnclients and normal clients separated is a pain.  To ensure normal connections don't use the VPN for DNS, I explicitly specify the WAN gateway for DNS and don't allow the settings to be overridden by DHCP.

        From the testing I did, leaving a gateway of 'none' doesn't work.  I still saw DNS lookups going over the VPN gateway.  To me this is incorrect behavior since my default gateway is the WAN gateway (only tested on 2.1.4).

        Does anyone know if it's possible to get the DNS Forwarder to use a specific gateway for lookups?

        1 Reply Last reply Reply Quote 0
        • C
          cybernet
          last edited by

          Has anyone successfully gotten PIA to work with SHA256? Works flawlessly with SHA1. Also if you receive MTU or HMAC authentication errors, try another server. Some servers are acting really wonky right now.

          Cheers!

          1 Reply Last reply Reply Quote 0
          • K
            kintaroju
            last edited by

            great tutorial you guys have. I have a more complicated situation that I have been trying to get setup.

            Having TWO openVPN client setup via PIA.

            So the idea is this, based on IP range 192.168.0.2-192.168.0.20 it'll go to PIA USA west

            The based on IP range 192.168.0.21-192.168.0.40 it'll go to PIA Canada

            Then the remaining IP 192.168.0.41-192.168.0.254 will be on the WAN.

            I've tried to follow the instructions before and just add a 2nd VPN client accordingly, but everything just default to the PIA USA West, is there anything I could be missing?

            1 Reply Last reply Reply Quote 0
            • T
              terryd
              last edited by

              very good guide but mine seems to restart if put under any stress like a download

              1 Reply Last reply Reply Quote 0
              • K
                kintaroju
                last edited by

                TerryD, did you upgrade to the latest pfSense 2.2 that was released yesterday?

                As for my issue, upgrading to 2.2 totally fixed the issues

                1 Reply Last reply Reply Quote 0
                • R
                  Robs
                  last edited by

                  @ryan29:

                  Does anyone know if it's possible to get the DNS Forwarder to use a specific gateway for lookups?

                  I did set it up like this, using no special rules:
                  check in the dns forwarder: Query DNS servers sequentially

                  209.222.18.218 -> pia gateway
                  209.222.18.222 -> pia gateway
                  8.8.8.8 ->  wan gateway

                  1 Reply Last reply Reply Quote 0
                  • R
                    Robs
                    last edited by

                    @kintaroju:

                    great tutorial you guys have. I have a more complicated situation that I have been trying to get setup.

                    Having TWO openVPN client setup via PIA.

                    So the idea is this, based on IP range 192.168.0.2-192.168.0.20 it'll go to PIA USA west

                    The based on IP range 192.168.0.21-192.168.0.40 it'll go to PIA Canada

                    Then the remaining IP 192.168.0.41-192.168.0.254 will be on the WAN.

                    I've tried to follow the instructions before and just add a 2nd VPN client accordingly, but everything just default to the PIA USA West, is there anything I could be missing?

                    Once you have one vpn gateway there isn't anything different setting up an other one and select the gateway based on lan ip.
                    However, there can be a situation where the vpn clients both have the same local interface ip. (the 10.x.x.x ip address)
                    I don't know what caused it but restarting one vpn client did solve it for me.

                    1 Reply Last reply Reply Quote 0
                    • DerelictD
                      Derelict LAYER 8 Netgate
                      last edited by

                      Save yourself some headaches and set your IPs on subnet boundaries instead.  That'll make your rules a lot easier.

                      Like instead of assigning hosts IP addresses from 192.168.0.21 through 192.168.0.40, assign them 192.168.0.33 through 192.168.0.62.  You can then cover them in one rule with source IP 192.168.0.32/29 (255.255.255.248)

                      You could:

                      pass ip any source 192.168.0.32/29 dest any gateway PIA_USA_WEST # (hosts .33 through .62 - in this case you could actually use .32 and .63 too but I wouldn't)
                      pass ip any source 192.168.0.64/29 dest any gateway PIA_CANADA # (hosts .65 through .94)
                      pass ip any source LAN network dest any gateway default # everything else.

                      Chattanooga, Tennessee, USA
                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                      1 Reply Last reply Reply Quote 0
                      • P
                        phatty
                        last edited by

                        Since the upgrade to 2.2 I have had PIA randomly disconnect and remain disconnected for me until I manually click connect again. Anyone else experience this problem? Seems to be every couple of days, on 2.1. 5 the only time I had connectivity issues when an internet issue caused a bad route to the server I had been connecting to. Other than that previously it has been very solid for me up until the upgrade.

                        1 Reply Last reply Reply Quote 0
                        • M
                          Moatilliata
                          last edited by

                          Thanks for this guide, I got PIA up and running for just my FireTV and the rest of my devices go through the normal WAN.

                          The problem I'm having now is I'm trying to access content on hulu and watch Disney Junior with my FireTV, but it says I'm outside of the US (I'm not, and I'm using the PIA California server, I know that Hulu has blocked a lot of VPNs). I don't care if the traffic for Hulu and Disney aren't over PIA, I want to make a rule to bypass the VPN for Hulu, Disney, and potentially a couple of other streaming services. I've tried creating an alias for hulu.com and then I made a firewall rule (placed before my VPN hosts rule) that said if the destination was the hulu alias it would use the WAN gateway instead of the PIA gateway, but I still got the same outside of the US or private network error. I've also added an ipcheck to the alias to make sure it was working and it returned the IP address I wanted when the rule was applied, so it worked for that site at least.

                          Any ideas how to get this to work? I don't really want to have to turn the VPN off each time I want to turn on Disney Junior for the kids.

                          1 Reply Last reply Reply Quote 0
                          • K
                            kintaroju
                            last edited by

                            hi moatilliata,

                            instead of rerouting the traffic you could try to use a dnsmasq server to forward your dns request so you can use the PIA vpn still.

                            One service that could work although I haven't tried it before is using UnoTelly:

                            https://www2.unotelly.com/home#2-channels

                            1 Reply Last reply Reply Quote 0
                            • M
                              Moatilliata
                              last edited by

                              @kintaroju:

                              hi moatilliata,

                              instead of rerouting the traffic you could try to use a dnsmasq server to forward your dns request so you can use the PIA vpn still.

                              One service that could work although I haven't tried it before is using UnoTelly:

                              https://www2.unotelly.com/home#2-channels

                              Well the sites work on my other PC's and iPad, and I'm pretty sure the DNS being sent on my normal WAN is still the PIA DNS, the only difference is the IP address. There must be a DNS or IP that's not included in my alias for Disney and Hulu when my location is being checked on the devices behind the VPN.

                              Hulu isn't my real problem because my TV has an app, but I don't have an app for Disney. I guess I'll just use the iPad and Chromecast, but that's just one more thing I have to teach my wife how to do.

                              1 Reply Last reply Reply Quote 0
                              • K
                                kintaroju
                                last edited by

                                One thing I was thinking if you are testing multiple devices, you should test if the registered external IP is the VPN IP or not?

                                Also you should do a DNS leak test to ensure that the DNS resolution is coming from the correct DNS server, be it be the VPN or local DNS server.

                                So what I do to troubleshoot the VPN issues is to use the below:

                                https://www.dnsleaktest.com/
                                http://whatismyipaddress.com/

                                1 Reply Last reply Reply Quote 0
                                • M
                                  Moatilliata
                                  last edited by

                                  I've done both of those things already.

                                  The DNS that comes back on DNS leak is always the VPN DNS, but when I'm on my normal WAN the inaccessible content is accessible.

                                  As far as IP check, behind the VPN I'm getting my VPN IP and on the WAN I'm getting my normal IP from my ISP.

                                  That's why I think my alias for Hulu and Disney are incomplete.  They must connect to another DNS or IP that I'm not bypassing in my alias.  I've pretty much given up on it for now. I just wanted it to the convenience of accessing those apps from the Fire TV.

                                  Is there a way to make it so certain source IP's use the VPN DNS and my sources going through WAN use the local DNS? I couldn't figure this out without having a DNS leak which is why I just left it on the VPN DNS.

                                  1 Reply Last reply Reply Quote 0
                                  • K
                                    kintaroju
                                    last edited by

                                    if you want to have specific DNS for specific interfaces, you can do it two ways.

                                    One you forward all DNS requests via the firewall to the interface you want to the specific DNS server OR

                                    Go to System -> General Setup. Under DNS servers you can specify specific DNS servers based on the Gateway, or in your case the "VPN Gateway"

                                    Let me know if that helps your cause or not.

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      archedraft
                                      last edited by

                                      Anyone else experiencing slower download speeds through PIA when upgrading from pfsense 2.1.5 to 2.2? My download speeds have been constantly 10-14 Mbps and with 2.1.5 they were 100+ Mbps.

                                      1 Reply Last reply Reply Quote 0
                                      • K
                                        kintaroju
                                        last edited by

                                        Nope, I personally haven't had that problem. My speeds to PIA are the same before the upgrade.

                                        Also for the record going from 2.1.5 to 2.2 solved a lot of issues that I was having when opening multiple OpenVPN clients to PIA.

                                        1 Reply Last reply Reply Quote 0
                                        • P
                                          plainzwalker
                                          last edited by

                                          edit  the firewall at my work was blocking all images.

                                          Thank you

                                          1 Reply Last reply Reply Quote 0
                                          • U
                                            User1503
                                            last edited by

                                            Great tutorial.  Setup my pfsense on the first go-round, thanks!  Now, the 2 issues.  1 is really just speed, I'm only getting 1.6-2.x mbps but that's not really a pfsense issue, more of a PIA issue.  Using Texas server seems to be fastest but still slow compared to my 50mbps VDsL.  #2,  Email.  Email pop3 doesn't work over PIA (goDaddy) and they know it.  Can receive, can't send.  Is there a rule? or setting to let smtp bypass the VPN and use the Wan?  I tried a few tests, obviously unsuccessfully.  Again, great stuff!
                                            Thanks

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