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

    How to prevent OPT nets from accessing LAN nets

    Scheduled Pinned Locked Moved Firewalling
    16 Posts 3 Posters 3.5k 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.
    • P
      pfcode
      last edited by

      @johnpoz:

      That rule should block, did you reset your states after there rule change to ! Lan net.  Any existing states would allow the traffic.. So you can either reset them all or look through them and kill the ones allowing your traffic you want to block.

      Reset the states from Diagnostic->States, doesn't work. My android box (192.168.2.x, OPT) still can browse all my NAS's (192.168.1.y, LAN) folders.

      Do I have to add a firewall rule on LAN interface to block all traffic from the OPT nets as source?

      Release: pfSense 2.4.3(amd64)
      M/B: Supermicro A1SRi-2558F
      HDD: Intel X25-M 160G
      RAM: 2x8Gb Kingston ECC ValueRAM
      AP: Netgear R7000 (XWRT), Unifi AC Pro

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

        I still can see the traffic went through from States table:

        OPT-LAN.PNG
        OPT-LAN.PNG_thumb

        Release: pfSense 2.4.3(amd64)
        M/B: Supermicro A1SRi-2558F
        HDD: Intel X25-M 160G
        RAM: 2x8Gb Kingston ECC ValueRAM
        AP: Netgear R7000 (XWRT), Unifi AC Pro

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

          No you do not have to add a rule on lan..

          So when you cleared your states, you then looked and there was no state?

          I have rules that block traffic just like that !, that rule says you can go where ever you want as long as not 192.168.1.0/?  Whatever your lan network is… So you might have a problem with your alias, did you renumber lan net?

          Try putting in the rule with specific network 192.168.1.0/? your mask is and reset your states.

          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
          • P
            pfcode
            last edited by

            @johnpoz:

            No you do not have to add a rule on lan..

            So when you cleared your states, you then looked and there was no state?

            I have rules that block traffic just like that !, that rule says you can go where ever you want as long as not 192.168.1.0/?  Whatever your lan network is… So you might have a problem with your alias, did you renumber lan net?

            Try putting in the rule with specific network 192.168.1.0/? your mask is and reset your states.

            Thanks. changed to 192.168.1.0/24, and reset states, worked. Now, How do I know what "LAN net" is wrong, since its pre-defined, which I never touch it??

            Release: pfSense 2.4.3(amd64)
            M/B: Supermicro A1SRi-2558F
            HDD: Intel X25-M 160G
            RAM: 2x8Gb Kingston ECC ValueRAM
            AP: Netgear R7000 (XWRT), Unifi AC Pro

            1 Reply Last reply Reply Quote 0
            • KOMK
              KOM
              last edited by

              LAN net should be literally your LAN network as it is defined.  Your LAN is 192.168.1.0 and OPT1 is 192.168.2.0… did you happen to use a /16 mask or something weird like that?

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

                If you renumber it, and didn't reboot maybe its holding the original 192.168.0/24 I believe..  But I have never ever seen that..

                Off the top I do not know how to view that the current values of those macro's are..  Have to look into how you would do that.. If there is a way??

                I would prob just reboot and then try your rule with lan net..  you can for sure see that the rule actually is with

                pfctl -sr

                either from the command under diag, or if you ssh to pfsense, etc.  Or actually at the console.

                The rules there list that actual networks and not the name..  so for example

                I have a rule that says allow in on ipv4 and v6 (see attached) allow

                But when I look at the actual rules I see this

                pass in quick on em2 inet proto udp from 192.168.2.0/24 to <ntpsrv>port = ntp keep state label "USER_RULE: Allow NTP"
                pass in quick on em2 inet6 proto udp from 2001:<snipped>:2::/64 to <ntpsrv>port = ntp keep state label "USER_RULE: Allow NTP"

                Which are my actual networks on my WLAN net both ipv4 and ipv6

                edit:
                KOM's idea of wrong mask could also be why it was allowed.  But as above you can always validate what your gui rules are exactly with the above command.  Your aliases will popup what they are in the gui if you put a mouse over them… But variables like Lan net or Lan Address do not do that.

                rulesnames.png
                rulesnames.png_thumb</ntpsrv></snipped></ntpsrv>

                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
                • P
                  pfcode
                  last edited by

                  @KOM:

                  LAN net should be literally your LAN network as it is defined.  Your LAN is 192.168.1.0 and OPT1 is 192.168.2.0… did you happen to use a /16 mask or something weird like that?

                  No. I didn't.  but where should I look into it?

                  Release: pfSense 2.4.3(amd64)
                  M/B: Supermicro A1SRi-2558F
                  HDD: Intel X25-M 160G
                  RAM: 2x8Gb Kingston ECC ValueRAM
                  AP: Netgear R7000 (XWRT), Unifi AC Pro

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

                    In your interface settings..

                    easy way would be status, interfaces would show you the mask on your interfaces.  Or Interfaces, then click into say lan and or your opt interface and where you set the IP you would see the mask..

                    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
                    • P
                      pfcode
                      last edited by

                      @johnpoz:

                      If you renumber it, and didn't reboot maybe its holding the original 192.168.0/24 I believe..  But I have never ever seen that..

                      Off the top I do not know how to view that the current values of those macro's are..  Have to look into how you would do that.. If there is a way??

                      I would prob just reboot and then try your rule with lan net..  you can for sure see that the rule actually is with

                      pfctl -sr

                      either from the command under diag, or if you ssh to pfsense, etc.  Or actually at the console.

                      The rules there list that actual networks and not the name..  so for example

                      I have a rule that says allow in on ipv4 and v6 (see attached) allow

                      But when I look at the actual rules I see this

                      pass in quick on em2 inet proto udp from 192.168.2.0/24 to <ntpsrv>port = ntp keep state label "USER_RULE: Allow NTP"
                      pass in quick on em2 inet6 proto udp from 2001:<snipped>:2::/64 to <ntpsrv>port = ntp keep state label "USER_RULE: Allow NTP"

                      Which are my actual networks on my WLAN net both ipv4 and ipv6

                      edit:
                      KOM's idea of wrong mask could also be why it was allowed.  But as above you can always validate what your gui rules are exactly with the above command.  Your aliases will popup what they are in the gui if you put a mouse over them… But variables like Lan net or Lan Address do not do that.</ntpsrv></snipped></ntpsrv>

                      Serious issue now.  As long as I changed back to ! Lan net, I can access my NAS again. and I don't see anything wrong when I ran "pfctl -sr"

                      Release: pfSense 2.4.3(amd64)
                      M/B: Supermicro A1SRi-2558F
                      HDD: Intel X25-M 160G
                      RAM: 2x8Gb Kingston ECC ValueRAM
                      AP: Netgear R7000 (XWRT), Unifi AC Pro

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

                        @johnpoz:

                        In your interface settings..

                        easy way would be status, interfaces would show you the mask on your interfaces.  Or Interfaces, then click into say lan and or your opt interface and where you set the IP you would see the mask..

                        Here you go:

                        Firewallissue.PNG
                        Firewallissue.PNG_thumb

                        Release: pfSense 2.4.3(amd64)
                        M/B: Supermicro A1SRi-2558F
                        HDD: Intel X25-M 160G
                        RAM: 2x8Gb Kingston ECC ValueRAM
                        AP: Netgear R7000 (XWRT), Unifi AC Pro

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

                          So when you ran the -sr what did you see for the rule when you put in ! lan net?

                          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
                          • P
                            pfcode
                            last edited by

                            @johnpoz:

                            So when you ran the -sr what did you see for the rule when you put in ! lan net?

                            Using ! Lan net:  (10.10.10.1 was auto added by pfBlockerNG as the DNSBL Virtual IP)

                            
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = http label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = https label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = ssh label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = http label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = https label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = ssh label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            pass in quick on igb2 inet from any to ! 192.168.1.0/24 flags S/SA keep state label "USER_RULE: 10/100Mbps LAN"
                            pass in quick on igb2 inet from any to ! 10.10.10.1 flags S/SA keep state label "USER_RULE: 10/100Mbps LAN"
                            
                            

                            Using !192.168.1.0/24:

                            
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = http label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = https label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto tcp from 192.168.2.0/24 to (self) port = ssh label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = http label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = https label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            block return in quick on igb2 inet proto udp from 192.168.2.0/24 to (self) port = ssh label "USER_RULE: Disallow OPT to access webGUI, SSH"
                            pass in quick on igb2 inet from any to ! 192.168.1.0/24 flags S/SA keep state label "USER_RULE: 10/100Mbps LAN"
                            
                            

                            Release: pfSense 2.4.3(amd64)
                            M/B: Supermicro A1SRi-2558F
                            HDD: Intel X25-M 160G
                            RAM: 2x8Gb Kingston ECC ValueRAM
                            AP: Netgear R7000 (XWRT), Unifi AC Pro

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

                              I'm just thinking that it could be the issue caused by pfBlockerNG DNSBL Virtual IP?

                              pass in quick on igb2 inet from any to ! 192.168.1.0/24 flags S/SA keep state label "USER_RULE: 10/100Mbps LAN"
                              pass in quick on igb2 inet from any to ! 10.10.10.1 flags S/SA keep state label "USER_RULE: 10/100Mbps LAN"

                              Release: pfSense 2.4.3(amd64)
                              M/B: Supermicro A1SRi-2558F
                              HDD: Intel X25-M 160G
                              RAM: 2x8Gb Kingston ECC ValueRAM
                              AP: Netgear R7000 (XWRT), Unifi AC Pro

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

                                Further discuss goes to here: https://forum.pfsense.org/index.php?topic=106742.0

                                Release: pfSense 2.4.3(amd64)
                                M/B: Supermicro A1SRi-2558F
                                HDD: Intel X25-M 160G
                                RAM: 2x8Gb Kingston ECC ValueRAM
                                AP: Netgear R7000 (XWRT), Unifi AC Pro

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