pfsense OpenVPN Policy Routing With Kill Switch Using PIA / Private Internet Access

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 109

  • @moelassus
    @moelassus 5 лет назад +9

    This is hands down the best tutorial to date. Very clear and easy to follow. It's not just click here, here and here. The concepts are explained so its easy to apply to my environment. I've tried getting this to work in the past and the whole gateway thing is what I was missing. Thanks Tom!

  • @holyk4545
    @holyk4545 5 лет назад +8

    There is another way of doing the "kill switch" without tagging and floating rule. Not sure if it has better or worse "performance" but it works just fine for me.
    - Create two rules. First one is the "Allow" one like Lawrence did. Just set the src IPs/Alias-list, define the VPN gateway under advanced. Second rule will be to block everything from the same src-IPs but without the VPN gateway defined. Meaning "Allow whatever goes through the VPN GWs and block everything else what tries to leak by any other way."
    - Second step is to go to "System -> Advanced -> Miscellaneous -> Gateway Monitoring" and ENABLE (tick) the "Skip rules when gateway is down". This will ensure that IF the VPN GW gets down the "Allow" FW rule will not fall-back to the default gateway but the rule is ignored completely. Then the "Deny" rule does its job and effectively prevents the outgoing connection.

    • @divingmundz
      @divingmundz 4 года назад +1

      I've tried both ways now, I was fairly sure the floating rule was allowing leaking of traffic across both paths. The way you explained above appears to have stopped that, so well done and thank you for your comment.
      One thing i did pickup is that i could not rely on the default options set on the getaways for my allow lan to any rule. I had to set my gateway as my preferred gateway to stop PFsense using the VPN as the default. I had also set the default gateway under routing but that did not help and i had to do it individually on allow lan to any firewall rule on each one of my lan segments.

  • @edhill4055
    @edhill4055 4 года назад +1

    Great tutorial. The kill switch worked as advertised. I personally don't mind the fallback to ISP on VPN failure. While playing around with the concepts I decided to setup several VPN endpoints and add them to a gateway group creating a load balanced VPN gateway group. Then setup the VPN_LB as gateway on the LAN rule. Now every other outbound connection pops out at a different geo location. An additional feature is if one of the locations in the group goes down connections continue to be served by others in the group if available. While currently all of my VPN endpoints are served by the same VPN provider, mixing providers in the GW group would add additional fault tolerance.

  • @williambaldwin7611
    @williambaldwin7611 4 года назад +1

    Great video!...finally got mine working. For anyone trying this....LAN to any rule is not the way to go. (which is how mine was setup before this) Once you add another gateway I think pfsense will just decide to put some of your traffic through the VPN gateway because you didn't specify. Once I specified the WAN_DHCP gateway for the LAN pass rule...looks like it fixed stuff. It was hard to figure out what was going on until I saw the remote access IP for Plex was randomly changing between the WAN IP and the VPN IP. You don't want untagged traffic heading out through the VPN...although I guess it's better than the reverse happening :)

    • @krizzo
      @krizzo 4 года назад

      Thank you, that saved me some troubleshooting! I enabled it and 10-20 seconds later my wifi devices lost internet connectivity (Windows and android). My work mac book was functioning just fine though and wired devices on the network as well. I saw on windows when running an mtr that I was seeing 50% packet loss which I've seen happen due to asymmetric routing issues and firewalls blocking traffic. Setting the default rule to route out the WAN fixed the issue. Also if you run IPv6 you'll need to make sure the host machine doesn't have it enabled as PIA only supports ipv4 for now.

  • @mujahidjaleel
    @mujahidjaleel 5 лет назад +1

    Great tutorial. The way I setup mine was I put all the hosts that needed vpn access on a dedicated vlan and then I disabled the NAT for the WAN for that subnet. Didn't need to use tags or floating rules. That's how I implemented the killswitch for it.

    • @godasor
      @godasor 5 лет назад +1

      many ways to skin a cat.

  • @lanceeilers5061
    @lanceeilers5061 5 лет назад +3

    cool thanks a bunch tom really learning so much stuff :-) keep smiling and have a great one cheers

  • @daninmanchester
    @daninmanchester 3 года назад

    just got openVPN / PIa working, thanks again. It would be great to see this done the otherway round, where all traffic goes via the VPN except exceptions. I thought setting the default gateway would force this then create rules to allow round it but I had issues.

    • @SteveSmith-ng2dv
      @SteveSmith-ng2dv 3 года назад +1

      This was actually covered in Tom's old video: "Setting up PIA VPN on pfSense for your whole network and Configuring Selective Routing"

  • @sergey930
    @sergey930 4 года назад +4

    Hey Tom, thanks for the video, best tutorial ever 👍 can you please help how to setup "if swiss goes down route via chicago vpn and if chicago goes down then kill switch"? I've tried playing with tags, but can't make it work for some reason. Thanks a lot!

  • @fastjp72
    @fastjp72 5 лет назад +12

    Where is the link to download the config?

  • @bmp6361
    @bmp6361 4 года назад +1

    Out bound NAT has changed (pfSense 2.4.5) since this video. Having some struggles with that. Great videos.

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  4 года назад +2

      Yeah, I need to make an updated video on this

    • @bmp6361
      @bmp6361 4 года назад

      I also noticed my main issue is routing. The Client VPN will also put in a 0.0.0.0/1 and will make all traffic route through it. I tried both "Don't pull routes" and "Don't add/remove routes", which puts me in the opposite situation and then cannot route with it. I saw that you used Automatic instead of the default GateWay, seemed to have been beneficial.

    • @bmp6361
      @bmp6361 4 года назад

      I ended up creating a gateway group (WAN and a Peer to Peer) and assigning all rules a gateway. Also routing seems to hang without a reboot.

    • @habvnaty1habvnaty188
      @habvnaty1habvnaty188 3 года назад

      @@LAWRENCESYSTEMS I had some struggles too, after doing everything you did all devices on my network got routed through the VPN, I assume it's because the VPN sets itself as the new gateway, I had to check the "Don't add or remove routes automatically" box and in "Custom options" i manually added the route which in my case was "route add 10.0.0.0 255.0.0.0;" I should also mention that I'm doing this with MullvadVPN and not PIA, though I assume it's the same for all commercial VPN's.

  • @DonPapiLuis
    @DonPapiLuis 2 года назад +1

    Dude, you are a legend, thank you!

  • @acrusso1
    @acrusso1 5 лет назад +1

    great video thank you been trying to figure out how to do a killswitch forever

  • @michaelmaxey1137
    @michaelmaxey1137 4 года назад

    This is a good walkthrough. Thanks a million.

  • @nickharvey5149
    @nickharvey5149 5 лет назад +1

    So incredibly helpful! Thanks Tom, AGAIN!!

  • @jameejay
    @jameejay 4 года назад

    VPN works for the whole house, but it doesn't want to use routing rules to route thru specific devices. Also, gateway shows "Offline". Both interface and service are up and running.

  • @gustavomarrara9660
    @gustavomarrara9660 Год назад

    As always great video... Just wondering if there are any difference on settings for the new CE 2.7

  • @HuskyMedia
    @HuskyMedia 3 года назад +1

    Like your videos and tutorials. Pfsense VPN client routing is very helpful. I was wondering what speeds you’re able to achieve with PIA? Did you run any speedtests with those configs?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  3 года назад

      There are a lot of factors such as speed of the firewall and PIA limits per location so I did not run speed tests.

    • @HuskyMedia
      @HuskyMedia 3 года назад

      @@LAWRENCESYSTEMS Ok Thanks. I asked only because i am running pfSense on a Dell R720xd with Dual Intel Xeon E5-2650v2 @2.6Ghz 8 Core CPUs with 130gb of ram and on Astrill VPN I am only able to get 12mbps down and 1.5 up. However, using a raspberry pi 4 I can get 90 down and 35 up. I think i will dry PIA next to see how the results vary.
      Yes my server is overkill for the firewall but for that reason i dont see how the firewall is overloading. openbeing single core could max out 1 core but i only see 0% CPU usage.
      Thanks for the reply

    • @HuskyMedia
      @HuskyMedia 3 года назад

      ​@@LAWRENCESYSTEMS Have a question/issue, after doing the VPN Client and config the VPN and wan works correctly, however, accessing any of my port forwarding into my network for example HAProxy to web server is broken from outside. Any ideas what is breaking it. I have tried this on multiple pfSense installs same issue.
      Issue only occurs while VPN Client is connected

  • @Petzku01
    @Petzku01 3 года назад +1

    I got this working with pfsense 2.4.5 but now with opnsense the policy based routing seems to do nothing. Any tips? VPN connects and routes traffic, but firewall rules to control which hosts should go through it and the floating kill switch rule seem not to work.

  • @dazzles1975
    @dazzles1975 3 года назад +1

    Great video. I know this is an old video but just curious that when vpn goes down and the killswitch is enabled, is there anyway for pfsense to automatically disable killswitch when vpn service is back up and running again or do you always have to manually re-enable service?

  • @Farizno
    @Farizno 3 года назад

    Great job. Extremely helpful. Thank you.

  • @michaelsass5953
    @michaelsass5953 5 лет назад +1

    Once again a very useful video, thank you so much.

  • @babbjos
    @babbjos 4 года назад +2

    Would it be possible to set up a failover VPN? Say swiss goes down can you fail over to Chicago?

  • @chrisumali9841
    @chrisumali9841 4 года назад

    thanks for this walk through and info. Have a great day

  • @qwerty74
    @qwerty74 5 лет назад +1

    My brain farted for a moment when it saw the X5670 being showed as 4 cores only until a split second later it realised that's just a VM. Good job, brain. Why am I awake at 5am?

  • @HijmenSchilperoort
    @HijmenSchilperoort 5 лет назад

    thank you for video! I never thought of using tags to create a killswitch.
    I can think of a few other things I can use this tagging for

  • @AFiB1999
    @AFiB1999 3 года назад +1

    Hi @
    Lawrence Systems Could you post the link down below you mention on your video? Thanks!

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  3 года назад

      What link?

    • @AFiB1999
      @AFiB1999 3 года назад

      @@LAWRENCESYSTEMS 25:37 VPN config file. We did all the process but I might missed something.

  • @MaximilianJirik
    @MaximilianJirik 3 года назад

    Thank you very much! Very helpful dude!!!

  • @MashMacharia
    @MashMacharia 2 месяца назад

    I tried creating the same scenario but using another instance on the cloud. However, I can't seem to have internet on the LAN once I change the gateway to the OpenVPN tunnel.

  • @trevelvin7455
    @trevelvin7455 5 лет назад +1

    Excellent video, well explained..thanks.

  • @robintodd3901
    @robintodd3901 6 месяцев назад

    Both (x2) NordVPN virtual addresses are the same? I’m guessing this is the reason for upsetting load balancing?

  • @victorpham221
    @victorpham221 3 года назад +1

    Hey Tom, great video! I recently got into pfsense and have followed this guide with success but I ran into an issue. My firewall rules aren't updating when I change or delete alias host as quickly as your's showing. It takes maybe 1-5 minute for the rules to reload and switch to VPN or back to no VPN. Any ideas on what causes this? I hit reload filter and does nothing until later. Thanks for your help!!

  • @myozone
    @myozone 3 года назад +1

    Thanks Tom for this video, I'm trying to route one IP on my LAN over ProtonVPN (setup and working). However, everything goes over the VPN ignoring the default WAN gateway. The rules have the IP address aliased I want to only send over the VPN but pfsense sends all LAN IP's over the VPN rather than out the default WAN

    • @Elliot9874
      @Elliot9874 2 года назад

      Did you ever solve this? I am running in to the same issue. Thank you

    • @myozone
      @myozone 2 года назад

      @@Elliot9874 Yes, I created a Proton gateway and route out via that then have a rule for the IP you want. I don't use that now and use a Wifi VLAN to ProtonVPN which is more flexible for me.

  • @manakeri9407
    @manakeri9407 4 года назад

    This is indeed a great tutorial - My only problem so far is that I haven't been able to create a rule for a specific host IP to go around the PIA tunnel? No matter what I do it goes through the tunnel? (You could say its working to good :-)

  • @thacalebful
    @thacalebful 5 лет назад +1

    Have you tested the killswitch? I tried to configure this and it looks like the LAN rule (that also tags) doesn't work if the gateway for the VPN is down (Even though I marked the gateway as always up in system->routing) and then the block floating rule doesn't work.

  • @comfysofa1549
    @comfysofa1549 3 года назад

    Hi - i wonder if you could do a guide for setting up a vpn outgoing connection but slightly differently.....i want my default connection to go out regularly but a few devices on my network i would like to always go through a vpn connection (i use PIA) - i think this involves creating some sort of custom group that only goes through a vpn connection....is this something youve done already (on you tube?)

  • @stationxtv7258
    @stationxtv7258 2 года назад

    Very nice configuration I am using it but my question is the following: Can we set up multiple OpenVPN connections and set up in the way if one VPN goes down the IPs in the alias uses the other VPN connection. In my case, I have multiple VPN providers three to be exact so I want to set up one connection from each provider (Which I already have set up and it is working fine) But what I want to do is this: Let's say VPN-A, VPN-B and VPN-C, I want VPN-A to be the primary connection and if that one goes down, I want to automatically twitch to VPN-B connection and if B goes down switch to VPN-C and if C goes down then activate the kill switch meaning no WAN access. And if A goes down and B is serving internet traffic and A comes back online it switches back to A. This way with three VPNs there is a better chance that it never goes down. Currently, I am using only one and the other two I Have to switch manually by changing the order of the firewall rule for the LAN network.
    Any idea on how to accomplish that?.
    By the way, watched a lot of tutorials about this subject and this is by far the best one When it comes to pfsense I don't bother looking elsewhere, just come to your channel and find what I am looking for,
    Thanks a bunch.

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  2 года назад

      I probably could be done, but I don't plan on making a video on it

  • @Donb1233
    @Donb1233 3 года назад

    Do wireguard PIA next please!

  • @sunnyg2k
    @sunnyg2k Год назад

    followed the steps given but the rules is not working, and pushes all my connections through the VPN, not just the specific devices on my network, this starts as soon as I create the outbound entry. Is there something different that needs to be performed on pfsense 2.6.0 CE edition?

  • @MO22731
    @MO22731 4 года назад

    great video as always thank you. just wondering if we edit the NAT rule for a network to point to the VPN only and not copy it, would it not achieve the same result as the kill switch without creating the extra config?

  • @mikescott4008
    @mikescott4008 2 года назад

    Are you able to do port forwarding on the traffic if you're running a torrent etc?

  • @edwardnizza9620
    @edwardnizza9620 4 года назад +1

    Will any tutorials coming out routing Amazon prime around the PIA tunnel on the same client?

    • @edwardnizza9620
      @edwardnizza9620 4 года назад

      Do you route incoming and outgoing? When I try Amazon gives me a message that prime video doesn't work with a VPN.

    • @edwardnizza9620
      @edwardnizza9620 4 года назад

      How to you find Amazon server address? can you find them using the state table?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  4 года назад

      You have to find all the Amazons IP's that are associated with prime and keep updating them as they change. Also they may be shared with other services that use those ip's therefore you will no have VPN on sites that do.

    • @edwardnizza9620
      @edwardnizza9620 4 года назад

      @@LAWRENCESYSTEMS thanks, so looking at the state table is the best way to find those ip's?

  • @RunMoreira
    @RunMoreira 4 года назад

    Great tutorial!

  • @mervinmercado4755
    @mervinmercado4755 4 года назад

    Hey dude, I would like to ask, what are those interfaces, are they hardware? thanks

  • @chrislowe8085
    @chrislowe8085 2 года назад

    Thanks for this video, now that pfsense is @ 2.6 version does PIA fully support that version I do not see a walk through on PIA website. Only 2.4.5. Is it possible to update this to pfsense 2.6x? Thanks

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  2 года назад

      2022 / 2.6 video ruclips.net/video/ulRgecz0UsQ/видео.html

  • @JustinCarver1981
    @JustinCarver1981 3 года назад

    The floating rule based on the VPN traffic tag stops ALL other LAN firewall rules from doing anything as it matches to ALL traffic. Got another solution?

  • @billsecond1
    @billsecond1 4 года назад

    Tom, thanks again! I was able to do exactly the same thing using CyberGhostVPN. Do you recommend using this for the Guest Vlans? What do you recommend using for Guest VLAN's?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  4 года назад +1

      If you are worried about your guest wandering to sites that you don't want your ISP to know about, then yes.

  • @mervinmercado4755
    @mervinmercado4755 4 года назад

    Meaning this set up is not applicable to all company needs like in the office people are dev and fed there is a possibility to encounter network problem or web access problem

  • @nandurx
    @nandurx 4 года назад

    Is there any way you can do same thing with NordVPN and ONLY allow one pc to route through VPN server. I tried few option which I read online, seems not effective.

  • @fedemtz6
    @fedemtz6 5 лет назад

    if I only changed the gateway on the allow any to any rule on lan (all traffic on that lan goes thru vpn) would I still to add the floating rule and tag the traffic?

  • @MaximilianImaging
    @MaximilianImaging 5 лет назад

    Hey LS, couldn’t you create a vpn killswitch by deleting all other NAT settings other than the vpn ones?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  5 лет назад

      No

    • @Blink_____
      @Blink_____ 4 года назад

      @@LAWRENCESYSTEMS I have a single Nat:outbound entry which routes from LAN subnet to OPT1, nothing gets out when its down. Maybe that's what he was asking about.

  • @evertythingtechrelated9715
    @evertythingtechrelated9715 5 лет назад +1

    how can i access my local network remotely with pia pfsense setup? i would like to access my octoprint and home assistant

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  5 лет назад +1

      Setup an OpenVPN server on pfsense

    • @evertythingtechrelated9715
      @evertythingtechrelated9715 5 лет назад

      @@LAWRENCESYSTEMSthanks... can I install pfsense on a netgear ac router or do I need PC type hardware? and will this setup hide my location?

  • @godasor
    @godasor 5 лет назад

    Tom do you have a tutorial on how to configure pfsense as a vpn appliance only?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  5 лет назад

      What's the use case for that?

    • @godasor
      @godasor 5 лет назад

      I work out of my home and for redundancy, I have two ISP providers with two separate L3 devices running hsrp and ospf between them and I dont want the VPN on either of them. I have an old Netgate appliance which would fit the bill.

  • @rogersnyder1294
    @rogersnyder1294 4 года назад

    I have followed this guide as well as the one on the PIA website multiple times paying VERY close attention to all the details. All attempts have failed. I tried experimenting with settings but nothing has worked. The diagnostic ping mentioned in the video never works so I am assuming something has changed since this video was created. I have also been unable to locate the .xml file mentioned in the video. As a novice pfsense user, access to this .xml file would be very helpful.

    • @rogersnyder1294
      @rogersnyder1294 4 года назад +1

      Followup: After banging my head against the wall for four days, I tried the settings used by the PIA app (AES-128-CBC) and suddenly it works. The online guide at the PIA web site states "10. For Encryption Algorithm select the option appropriate to your configuration based upon the settings you want to use from the Dependencies Table at the beginning of this guide. In general, we suggest using GCM over CBC." Obviously this information is WRONG. Hopefully this will help anyone who finds themselves in a similar situation.

  • @abdraoufx
    @abdraoufx 5 лет назад +1

    Did you re-upload this video?

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  5 лет назад

      I found a mistake so I cut it out and re-uploaded it

    • @abdraoufx
      @abdraoufx 5 лет назад +2

      @@LAWRENCESYSTEMS i questioned my reality, i fall asleep watching this video, when ibwake up I found it just got uploaded. Was i dreaming!! Lol

  • @danjones4002
    @danjones4002 4 года назад

    I cant seem to figure out how to make this work with pfblockerNG. Any know how to do that

  • @augurseer
    @augurseer 4 года назад

    kill switch is killing everything EXCEPT torrent traffic. suggestions?

  • @pensarbens4296
    @pensarbens4296 5 лет назад

    Please could you give me a tip on how to solve the double nat problem on xbox one when using pia vpn on pfsense? Note: I connect through pppoe. Thank you.

  • @emanuelpersson3168
    @emanuelpersson3168 3 года назад

    Is there a way to do the same thing but to only use the VPN IF the destination is xxx.zzz.yyy.nnn

  • @pepeshopping
    @pepeshopping 5 лет назад

    I have never needed a kill switch for any VPN. The route entries take care of that.
    And then, DO EXPLAIN the setup for both VPN sides to connect to each other through the open, non-encrypted internet??

  • @manu_5031
    @manu_5031 5 лет назад

    Nice TuT. But my DNS leaks my real IP :/

    • @blindside995
      @blindside995 5 лет назад

      Hi, I don't know if you figured this one out. I ran into the same issue at first. I made another rule with the alias and tag and just pointed that alia to the appropriate DNS.
      imgur.com/a/Zomqf6W
      Hopefully, that link works when you see this and you can make the adjustment if still needed.
      I should probably meantion that this worked for me. I have a handful of devices that use a VPNgroup gateway that I made and no mater which device I put on the alias they don't see my real wanip. Cheers.

  • @stix-77
    @stix-77 4 года назад +1

    ExpressVPN all the dude. Unless you know otherwise. I bet I’m going to hear something bad about ExpressVPN one day but they have the best customer service I’ve ever seen

  • @Chaz393
    @Chaz393 5 лет назад

    360p squad where we at

  • @Glorious_Kim_Jong_Un
    @Glorious_Kim_Jong_Un 5 лет назад

    Do people find use for this (in all seriousness) for a service such as PIA (you aren't using that for business or banking I hope) for actual purposes outside of pirating movies, music, games, software, fuck machine blueprints? If you have never seen a fuck machine before.. 🤗 this guy is like if only I could block certain people

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  5 лет назад

      We get a lot of people contacting us for setting this up.

  • @cfgdr3
    @cfgdr3 5 лет назад +1

    I'm watching this video on a 50"+ monitor and the video is REALLY fuzzy. It may just be my internet connection, but you may try to watch it yourself, Tom.

    • @cfgdr3
      @cfgdr3 5 лет назад

      It was just me. Thanks for the videos, Tom.

  • @settleragent8283
    @settleragent8283 2 года назад

    The guy makes an effort to speak extra fast and move the mouse and clicks even faster. Impossible to even look at what he's referring to. Wtf seriously

  • @mohsein
    @mohsein 2 года назад

    Dude, you really need to learn how to make a tutorial. Why rushing through the steps without even completing it or explaining it well? No wonder why this video on this important topic hasn't got that much of views.

    • @LAWRENCESYSTEMS
      @LAWRENCESYSTEMS  2 года назад

      I have a new version here ruclips.net/video/ulRgecz0UsQ/видео.html

  • @grocerylist
    @grocerylist 3 года назад

    Where is the link to download the config?