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.4k 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.
    • 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.7.2, 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.7.2, 24.11

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

                                My LAN to DMZ is working, but only with hosts without the NordVPN gateway.

                                I wanted to know if it's possible to connect to others subnets (DMZ, ISP modem subnet) with hosta who have NordVPN gateway.

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

                                  @johnpoz You're correct, but in my defense the terminology on the firewall rule config is confusing:
                                  "Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing."

                                  So you set the Gateway setting to Default, but that doesn't mean it uses the default gateway.

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

                                    @luckyzor You need to create a LAN firewall rule above your existing rule that routes hosts through the NordVPN gateway. Per johnpoz's post, that rule should have the source set to any (assuming you want any LAN host to be able to access the DMZ), the destination set to the DMZ subnet, and the Gateway setting left at Default.

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

                                      So only have to pull down the nordvpn rule for that... If I'm understanding well.

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

                                        @luckyzor You mean you have an existing LAN-to-DMZ allow rule but it's currently below your NordVPN rule? If so, then yes, simply re-ordering them may be all you need. If that doesn't work, post a screen shot of your LAN firewall rules.

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

                                          I have this for now
                                          alt text

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

                                            @luckyzor Okay so add a new rule at the top that looks like the "Default allow LAN to any rule" but instead of the Destination being set to any (*), set it to "DMZ Address", or more likely "OPT1 Address", whatever corresponds to your DMZ interface. I'd probably also move it below the Anti-Lockout Rule, but that's just for aesthetics; since they'll have mutually exclusive destinations they can't both match the same traffic anyway.

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