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

    [SOLVED] Defining ports on GEOIP allow rule does not work

    Scheduled Pinned Locked Moved pfBlockerNG
    7 Posts 3 Posters 1.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.
    • G
      gabrimonfa
      last edited by

      I'm on pfsense 2.3.2-p1 x86 with pfblocker-ng uptodate.
      The box is a physical machine that worked correctly for years.

      I've create an allow rule under GeoIP tab.
      The rule is not floating, should allow IPv4 Inbound traffic from one country.
      In "Advanced Inbound Firewall Rule Settings" I have enabled Custom DST port using an alias.

      The rule is created correctly under WAN, it's positioning is correct and it shows the alias in Destination Port.

      Connections to the allowed ports from other countries do not match the rule and are blocked.
      Connections to the allowed ports from allowed country do match the rule and pass.

      So far so good?
      No.

      The problem is that connections from the allowed country to other ports strangely do match the rule and pass.
      I'm sure of that since I've logged just the problematic roule and it shows the connection, and the connection works.

      This behaviour is a bit scary for me since services are exposed that I thought to be blocked.
      I've double checked all configuration and cannot find any issue.
      Is this a bug?

      Can anyone confirm the issue or that this setup (with custom destination ports) works as intended in their environment?

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        @gabrimonfa:

        Can anyone confirm the issue or that this setup (with custom destination ports) works as intended in their environment?

        Works just fine here:

        
        # pfctl -vvsr | grep Europe
        @122(1770004813) pass quick on igb1 inet proto udp from <pfb_europe_v4:2637>to <wan_ips:2>port = openvpn keep state label "USER_RULE: pfB_Europe_v4 auto rule"
        @123(1770004813) pass quick on gif0 inet proto udp from <pfb_europe_v4:2637>to <wan_ips:2>port = openvpn keep state label "USER_RULE: pfB_Europe_v4 auto rule"
        @124(1770004709) pass quick on igb1 inet6 proto udp from <pfb_europe_v6:786>to <wan_ips:2>port = openvpn keep state label "USER_RULE: pfB_Europe_v6 auto rule"
        @125(1770004709) pass quick on gif0 inet6 proto udp from <pfb_europe_v6:786>to <wan_ips:2>port = openvpn keep state label "USER_RULE: pfB_Europe_v6 auto rule"</wan_ips:2></pfb_europe_v6:786></wan_ips:2></pfb_europe_v6:786></wan_ips:2></pfb_europe_v4:2637></wan_ips:2></pfb_europe_v4:2637> 
        
        1 Reply Last reply Reply Quote 0
        • G
          gabrimonfa
          last edited by

          doktornotor:

          If you have a pass rule on some ports, can you confirm that connections to other ports do not pass (aka do not match the pass rule)?

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            Well of course they don't match the pass rule with port = openvpn specified. Check the pfctl output for what you've produced there (or /tmp/rules.debug).

            1 Reply Last reply Reply Quote 0
            • BBcan177B
              BBcan177 Moderator
              last edited by

              Did you define the protocol setting in the Adv. Inbound settings?

              "Experience is something you don't get until just after you need it."

              Website: http://pfBlockerNG.com
              Twitter: @BBcan177  #pfBlockerNG
              Reddit: https://www.reddit.com/r/pfBlockerNG/new/

              1 Reply Last reply Reply Quote 0
              • G
                gabrimonfa
                last edited by

                Default: any
                Select the Protocol used for Inbound Firewall Rule(s).
                Do not use 'any' with Adv. Inbound Rules as it will bypass these settings!

                :-X :-X :-X
                Grrr. Ok I've overlooked the help text.

                Maybe it's a bit confusing that one of the advanced options has a default value that make not applicable all other options.
                IMHO it would be better to warn the user if he/she sets the ports and protocol is left to any.

                Or maybe the UI should be made consistent with the "Add rule".
                Default protocol is TCP and choosing any hide source and dest ports

                1 Reply Last reply Reply Quote 0
                • BBcan177B
                  BBcan177 Moderator
                  last edited by

                  @gabrimonfa:

                  IMHO it would be better to warn the user if he/she sets the ports and protocol is left to any.

                  Or maybe the UI should be made consistent with the "Add rule".
                  Default protocol is TCP and choosing any hide source and dest ports

                  This is already fixed in the next package release… Just in testing phase now ...

                  "Experience is something you don't get until just after you need it."

                  Website: http://pfBlockerNG.com
                  Twitter: @BBcan177  #pfBlockerNG
                  Reddit: https://www.reddit.com/r/pfBlockerNG/new/

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