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

    PfblockerNG opens ports when enabled

    Scheduled Pinned Locked Moved pfBlockerNG
    5 Posts 2 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.
    • A
      Art
      last edited by

      Hi All,

      I am having a strange situation on my pfSense firewall. A couple of days ago I updated pfSense to 2.4.4_r3. After that when pfBlockerNG/GeoIP is enabled it opens some ports on WAN that should not be opened. By default pfSense should block all that is not allowed, but in my situation it does not work.

      On pfBlockerNg/GeoIP

      Country X is selected
      List Action: Permit Inboud
      Enable Logging: Enable

      Advanced Inboud Firewall Rules Settings:
      Custom DST Port: Enabled, Set to Alias of list of ports that I want traffic to be allowed on the firewall
      Custom Protocol: any
      Custom Gateway: default

      I've tried many things but without success. To block the ports I created rules and moved them before the auto rules. It works some time, but after the cron update the auto rules go up and the ports are open again.

      Settings on the General tab:
      Inbound firewall rules: WAN, Block
      Outbound Firewall Rules: LAN, Reject
      Rule Order: | pfB_Block/Reject | All other

      Please, advise. Thanks in advance

      1 Reply Last reply Reply Quote 0
      • A
        Art
        last edited by

        I've done some more research and got the following.
        When GeoIP is enabled and List Action=Permit, ports 81 (firewall itself) and port 53 (firewall's DNS forwarder) are open on WAN.

        I also tried List Action=Alias Native and created a rule manually (let us say rule_1) I got the ports 81 and 53 open on WAN as with auto rules. I can block these ports by creating rules before the rule_1, but it I'd like to keep things simple.

        My aim is to limit the traffic on open ports (not 81 and not 53) to a particular country. It looks like GeoIP's auto rules are first and even on top of firewall's default block. Is it something that should be expected? Is my understanding of pfSense's block all if not allowed incorrect? Please, advise.

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

          @Art
          Install pfBlockerNG-devel which is much improved. Also when using "Adv. Inbound/Outbound" settings you need to set the protocol setting. It can't be "any".

          "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/

          A 1 Reply Last reply Reply Quote 0
          • A
            Art @BBcan177
            last edited by

            @BBcan177
            Thanks for your reply BBcan177. I set the protocol to TCP/UDP, however when I enable the rule created using the alias of GeoIP (Alias Native and etc.), I get ports 81 and 53 open on WAN. Is it expected or an abnormal thing? If it is expected, then I will block ports 81 and 53 creating block rules before the pass rule. I'd prefer to keep the non-devel package (at least for now) if the behaviour of the devel package is the same. Please, let me know.

            1 Reply Last reply Reply Quote 0
            • A
              Art
              last edited by

              Figured this out.
              I replaced pfBlcokerNG with pfBlockerNG-Devel but the behavior remained the same. Creating a rule based on a GeoIP alias containing a country, opens ports 81 and 53 to the world (despite ports 81 and 53 are not included in the alias settings; only the required ports are included). To avoid this, in addition to (or instead of) having Custom DST Port in Firewall > pfBlockerNG > IP > GeoIP > Continent > Advanced Inbound Firewall Rule Settings, the ports are also required to be set in the Destination Port Range of the Rule, otherwise ports 81 and 53 (in addition to other opened ports) would be opened to the world. In my case I disabled the Custom DST Port and set the Destination Ports Range in the rule. I am not sure about the purpose of the "Custom DST Port" in GeoIP.

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