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

    Using Open VPN service on XG-7100, prevent LAN clients connecting

    Scheduled Pinned Locked Moved Firewalling
    48 Posts 5 Posters 6.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.
    • JKnottJ
      JKnott @shapelytraffic
      last edited by

      @shapelytraffic said in Using Open VPN service on XG-7100, prevent LAN clients connecting:

      If I block LAN access to the WAN then I assume this will have global impact.

      Block access only to the WAN interface address, not everything out on the WAN and beyond. That is you block that specific address and no other.

      PfSense running on Qotom mini PC
      i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
      UniFi AC-Lite access point

      I haven't lost my mind. It's around here...somewhere...

      1 Reply Last reply Reply Quote 0
      • S
        shapelytraffic @Derelict
        last edited by

        @Derelict what are you representing with "guest" network?

        DerelictD 1 Reply Last reply Reply Quote 0
        • JKnottJ
          JKnott @shapelytraffic
          last edited by

          @shapelytraffic

          If you were trying to reach the LAN interface address from the WAN, you'd have to create a rule that would allow that. Going the otherway, pfSense allows all traffic from the LAN, out to the Internet, including the WAN interface address. In some other routers, such as Cisco, you'd have to create a rule just to reach the Internet.

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • JKnottJ
            JKnott @shapelytraffic
            last edited by JKnott

            @shapelytraffic

            Here's some info that may help:

            Interface Settings

            The interface settings screen will differ based on the type of interface being dealt with. In pfSense® software, the real distinction between “WAN”, “LAN” and “OPT” interfaces is blurred as they are all capable of handling any role. For historical and ease-of-use purposes, the first two interfaces are WAN and LAN. Additional interfaces start at OPT1 and are numbered from there (OPT2, OPT3, … OPTn)


            As soon as you have installed pfSense, you have WAN and LAN interfaces, which are understood to have different roles. The LAN role is to pass everything to the WAN, unless specifically blocked. The WAN role is to block everything, unless specifically enabled.

            Try creating a couple of OPT interfaces to get a better idea of how rules are applied.

            PfSense running on Qotom mini PC
            i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
            UniFi AC-Lite access point

            I haven't lost my mind. It's around here...somewhere...

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

              @shapelytraffic said in Using Open VPN service on XG-7100, prevent LAN clients connecting:

              @Derelict what are you representing with "guest" network?

              The subnet of the GUEST interface. I have no idea what it was when I took that screen shot but if the GUEST interface is numbered like this:

              192.168.123.1 /24

              GUEST Address: 192.168.123.1/32
              GUEST Network: 192.168.123.0/24

              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
              • S
                shapelytraffic @JKnott
                last edited by

                @JKnott This is a production unit so I don't have the luxury of experimenting.

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

                  So spin up a VM to experiment on. It doesn't cost anything.

                  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)

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    shapelytraffic @Derelict
                    last edited by

                    @Derelict so, if I understand you correctly, you're saying to block private addresses on the WAN rule set to the WAN IP?

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

                      No. Look at the rule set I posted. The rules go on the interface the connection comes INTO the firewall on. GUEST in that example.

                      https://docs.netgate.com/pfsense/en/latest/book/firewall/index.html

                      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)

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        shapelytraffic @Derelict
                        last edited by

                        @Derelict so, for each internal interface, I need to implement these rules?

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

                          If that is the desired effect to implement your policy, yes.

                          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)

                          S 1 Reply Last reply Reply Quote 0
                          • JKnottJ
                            JKnott @shapelytraffic
                            last edited by

                            @shapelytraffic said in Using Open VPN service on XG-7100, prevent LAN clients connecting:

                            @Derelict so, if I understand you correctly, you're saying to block private addresses on the WAN rule set to the WAN IP?

                            One very important thing to remember is that the rules are applied to the interface, not the address. So, you have to put the rule on the interface that the packets will pass through. If you try to reach the WAN address from the LAN, the packets will pass through the LAN interface, but not the WAN interface, so the rules go on the LAN interface.

                            PfSense running on Qotom mini PC
                            i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                            UniFi AC-Lite access point

                            I haven't lost my mind. It's around here...somewhere...

                            1 Reply Last reply Reply Quote 0
                            • S
                              shapelytraffic @Derelict
                              last edited by

                              @Derelict I'm not certain we agree specifically what my desired effect is though. I would feel much more confident in your assistance if you would express to me what you think I'm trying to do, because in my mind it's not at all unusual. But your phrasing sounds skeptical.

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

                                You do not want inside hosts to be able to connect to your OpenVPN server on the WAN address.

                                So you need to block those connections on the inside interfaces.

                                I'm pretty much done here. Can only say the same thing so many times. There is a book.

                                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)

                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  shapelytraffic @Derelict
                                  last edited by

                                  @Derelict good on ya mate. How can I be as good as you.

                                  1 Reply Last reply Reply Quote 0
                                  • JKnottJ
                                    JKnott @shapelytraffic
                                    last edited by

                                    @shapelytraffic said in Using Open VPN service on XG-7100, prevent LAN clients connecting:

                                    @Derelict I'm not certain we agree specifically what my desired effect is though. I would feel much more confident in your assistance if you would express to me what you think I'm trying to do, because in my mind it's not at all unusual. But your phrasing sounds skeptical.

                                    You want to keep LAN users from using the VPN. So, all you have to do is block them with a rule on the LAN interface. Also, even if they did connect it, the VPN still won't be used, because there is a direct connection that bypasses the it and that connection will always be used.

                                    You may need to brush up on how IP works. When you try to connect to something, the computer compares the destination address with the local network address and subnet mask. If the destination is on the same network, then the packet is sent directly to the destination. Any other destination requires routing and you can't route to your own network, as you'd be doing if you passed through the VPN.

                                    PfSense running on Qotom mini PC
                                    i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                                    UniFi AC-Lite access point

                                    I haven't lost my mind. It's around here...somewhere...

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      shapelytraffic @JKnott
                                      last edited by

                                      @JKnott thanks for taking the time to condescend. No thanks.

                                      JKnottJ 1 Reply Last reply Reply Quote 0
                                      • JKnottJ
                                        JKnott @shapelytraffic
                                        last edited by

                                        @shapelytraffic

                                        I wasn't trying to be condescending. You seemed to be having a problem understanding how it works.

                                        PfSense running on Qotom mini PC
                                        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                                        UniFi AC-Lite access point

                                        I haven't lost my mind. It's around here...somewhere...

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          shapelytraffic @JKnott
                                          last edited by

                                          @JKnott you must have worked with any other kind of firewall that provides a VPN client (ex: SonicWall). In my experience, you don't have to roll your sleeves up to prevent LAN traffic from initiating the VPN. - you can't go in through the out door.

                                          What I'm not understanding is why there isn't a prefab to do this?

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            shapelytraffic
                                            last edited by

                                            I mean, if you go back to the first comments, it's clear that there was a misunderstanding. One which was not admitted to.

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