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

    NordVPN Client only for specific hosts

    Scheduled Pinned Locked Moved OpenVPN
    58 Posts 10 Posters 8.6k 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.
    • L
      luckyzor
      last edited by

      Hello all,

      I managed to install NordVPN in pfsense (2.4.5-DEVELOPMENT) following this tutorial: https://nordvpn.com/fr/tutorials/pfsense/pfsense-openvpn/

      My problem is all my network is passing trough the VPN, but I don't want that.
      I've create an Aliase with the hosts I want to be in the VPN connection.

      Can you help me please?

      Here my settings:
      0_1548763921872_b70552a2-44c3-41c2-b89e-16c3c30c6865-image.png

      0_1548763868158_3e3fd383-8a2b-4655-9fe2-7113f05143b9-image.png

      If you need something else please tell me.
      Thanks for your help.

      1 Reply Last reply Reply Quote 0
      • NogBadTheBadN
        NogBadTheBad
        last edited by NogBadTheBad

        Why are you only policy based routing UDP ?

        Change the protocol to ANY.

        Also for testing use an IP address for the source, does it then work ?

        Andy

        1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

        1 Reply Last reply Reply Quote 0
        • L
          luckyzor
          last edited by

          Changed to Any in the rules and only the host ip, still the same, all my network is passing through the VPN.

          0_1548764917501_bd690ad5-bb03-4f92-8c1c-174f61e28ac0-image.png

          1 Reply Last reply Reply Quote 0
          • NogBadTheBadN
            NogBadTheBad
            last edited by

            @luckyzor said in NordVPN Client only for specific hosts:

            I've create an Aliase with the hosts I want to be in the VPN connection.
            Can you help me please?
            Here my settings:

            Tried changing the gateway in the two rules below the NORD VPN rule to be the WAN gateway ?

            Is the state count going up on the two rules below the NORD VPN ?

            Andy

            1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

            1 Reply Last reply Reply Quote 0
            • L
              luckyzor
              last edited by

              Is the state count going up on the two rules below the NORD VPN ? - what do you mean with this?

              0_1548765681900_6a8463eb-6ba1-4c6d-a7e5-c47b526aecee-image.png

              Like that it worked. Should I change the gateway in another rule?

              I have this problem too:
              VPN host - I can't access my DMZ zone (I have one VM in there) when I try to ssh to this VM I got access denied.
              Other host, I can't access the VM and there is no internet (can't ping 8.8.8.8 for example)

              NogBadTheBadN 1 Reply Last reply Reply Quote 0
              • NogBadTheBadN
                NogBadTheBad @luckyzor
                last edited by

                @luckyzor said in NordVPN Client only for specific hosts:

                Like that it worked. Should I change the gateway in another rule?

                You need to establish which firewall rules are being matched, add logging to the other two rules and then look in the logs.

                The rule at the bottom is IPv6, if you don't use IPv6 nothing will hit the rule.

                Maybe then do packet captures on the DMZ interface and see if traffic is even hitting the DMZ.

                Andy

                1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                1 Reply Last reply Reply Quote 0
                • L
                  luckyzor
                  last edited by

                  I'm struggling how to do it.
                  Do you have any hint, how to do it?

                  I turned on the log in the 2nd rule and why I tried to ssh to the VM in the DMZ and I can't find anything in the log, maybe i'm doing something wrong 😭

                  NogBadTheBadN 1 Reply Last reply Reply Quote 0
                  • NogBadTheBadN
                    NogBadTheBad @luckyzor
                    last edited by NogBadTheBad

                    @luckyzor said in NordVPN Client only for specific hosts:

                    I'm struggling how to do it.
                    Do you have any hint, how to do it?

                    I turned on the log in the 2nd rule and why I tried to ssh to the VM in the DMZ and I can't find anything in the log, maybe i'm doing something wrong 😭

                    The NordVPN rule or the rule below it ?

                    I've never done this but as I said previously you need to figure out what rule it hits and then go from there.

                    If you hold your mouse over the X or tick in Status System -> LogsFirewall -> Normal View you'll see the rule numbers, ditto over states in the firewall rules page.

                    Andy

                    1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

                    1 Reply Last reply Reply Quote 0
                    • L
                      luckyzor
                      last edited by luckyzor

                      Well, with logs I didn't find anything.

                      With some testes I have this:

                      Disabled OpenVPN client: VM in DMZ - OK (have internet ping 8.8.8.8 / I can SSH from LAN interface)

                      Enable OpenVPN client: Can't ping 8.8.8.8 / but I can SSH if - NO specific gateway which means all my network is in the VPN :

                      0_1548771465692_849d974b-34ac-4cd5-8de0-a44fdcd6c707-image.png

                      If I put the gateway like this:
                      0_1548771559471_b9365f98-ce20-4bdc-8d7e-84c5dc911dc1-image.png

                      Only the host 10.0.0.3 have VPN (which is my intention) but I can no longer ssh my VM in DMZ / no internet in the VM DMZ.

                      I'm lost, because I don't know what to do 😭

                      edit: the WANGW is the IP of my ISP modem :/

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

                        The guide you followed does not allow for policy routing; it assumes you want all traffic to go through the VPN. If you want to use policy routing, go into your VPN client configuration and check the box for "Don't Pull Routes". When that box is checked, a static route is pulled that directs all your traffic through the VPN. You don't want that; you want no traffic to go through the VPN unless you have a firewall rule that directs it to.

                        Also note that the guide directs all DNS requests through the VPN. Generally, that shouldn't be a problem. But you can override it for specific clients on your LAN using static DHCP mappings. For example, you could use a static mapping to ensure that a specific client always gets the IP 192.168.1.10 and always gets assigned Google's DNS servers (8.8.8.8 and 4.4.4.4) instead of being assigned the pfSense box itself (192.168.1.1) as its DNS server.

                        L 1 Reply Last reply Reply Quote 0
                        • L
                          luckyzor @TheNarc
                          last edited by

                          @thenarc WOW it's solved ;) thank you :D

                          One last question, how can I have access to my DMZ VM with a host in the VPN?

                          example:
                          [root@vmservers ~]# ping 192.168.2.2
                          PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
                          From 10.8.0.1 icmp_seq=1 Destination Port Unreachable
                          From 10.8.0.1 icmp_seq=2 Destination Port Unreachable
                          From 10.8.0.1 icmp_seq=3 Destination Port Unreachable

                          10.8.0.1 is the ip of the VPN Client

                          Thank you

                          J 1 Reply Last reply Reply Quote 0
                          • T
                            TheNarc
                            last edited by

                            Glad to hear that worked. I may be of less use with respect to a DMX though; I've never configured one on pfSense. But it's an OPT interface, right? Did you set up the appropriate policy routing firewall rules for it? How do you want it to behave?

                            1 Reply Last reply Reply Quote 0
                            • L
                              luckyzor
                              last edited by

                              yes the DMZ is an OPT interface.
                              This are the rules in DMZ.

                              0_1548777163862_871f6519-bf16-4fb9-95a4-dfa26aea38aa-image.png

                              Rules in the VPN interface:
                              0_1548777651667_1332cd9f-0104-4bf4-8a82-bce5a924d79d-image.png

                              the problem is the connection between the hosts in the VPN and the DMZ. (diferent subnet) / I can't even ping my ISP modem with the host in the VPN.

                              hosts in the VPN with hosts not in the VPN - OK (same subnet)

                              thanks for your help :)

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

                                When you say "hosts in the VPN", do you mean hosts in the LAN for which you have the gateway set to your VPN using policy routing firewall rules? As you say, the DMZ and your LAN are two separate networks, and the block rule you made explicitly prohibits any hosts on the DMZ from communicating with hosts on the LAN. Typically, this is what you would want, I believe. Are you saying that it's not what you want? Or that you want hosts on the DMZ to also be routed through your VPN? I'm still not clear on the goal, but if the firewall rules are configured to allow DMZ hosts to communicate with LAN hosts, then I don't believe it would be a DMZ at all, right?

                                1 Reply Last reply Reply Quote 0
                                • L
                                  luckyzor
                                  last edited by

                                  Yes, I want to be able to access all my subnet's (DMZ, ISP subnet ) with the hosts (in Lan interface) who have the gateway NordVPN
                                  For now, the hosts with the gateway NordVPN only have access to there subnet (10.0.0.0)

                                  The hosts in the DMZ will not have the NordVPN gateway and I don't want them to have access to anything else then WAN interface

                                  thanks for your help

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

                                    These resources may be useful:

                                    https://www.slideshare.net/NetgateUSA/creating-a-dmz-pfsense-hangout-january-2016

                                    https://www.netgate.com/docs/pfsense/config/example-basic-configuration.html

                                    However, I believe that allowing access to the DMZ from the LAN is breaking the whole idea of the DMZ. As I said, I've never configured one myself, but I think generally the whole purpose is to have complete isolation from the LAN.

                                    johnpozJ 1 Reply Last reply Reply Quote 0
                                    • L
                                      luckyzor
                                      last edited by

                                      But the DMZ is isolated. The DMZ only have access to WAN, nothing more than that.

                                      I have access to DMZ from LAN, for example if I want to update my website, etc...

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

                                        @thenarc said in NordVPN Client only for specific hosts:

                                        However, I believe that allowing access to the DMZ from the LAN is breaking the whole idea of the DMZ.

                                        NO... So you allow the whole public internet to access a DMZ... But you think accessing it from the LAN would be bad?

                                        You can even allow access from DMZ into lan with specific pinholes and understanding, etc. Its best to not do that - but its done all the time.

                                        All of the guides from these sites want any and all traffic to go to them... This is NOT what normal people would want... So you DO NOT PULL routes, and then just policy route out the vpn what you want to use the vpn.

                                        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
                                        • T
                                          TheNarc
                                          last edited by

                                          Okay, and you're saying your LAN-to-DMZ access is already working, or that's what you're trying to get working? Because if it's not working, I think you'll want to add a firewall rule on your LAN interface allowing access to the DMZ subnet via the default gateway.

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

                                            @thenarc said in NordVPN Client only for specific hosts:

                                            DMZ subnet via the default gateway.

                                            No you would not call out a gateway - this is where you run into problems.. You just allow the traffic you want and do not call out a gateway - since now your policy routing, and you wouldn't be going out your wan or vpn to get to another segment off pfsense.

                                            You just allow the rule above where you force out traffic via a policy route "setting gateway" in the rule.

                                            Rules are evaluated top down, first rule to trigger wins, no other rules are evaluated.

                                            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

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