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

Max Connections / Per Second Question

Scheduled Pinned Locked Moved Firewalling
7 Posts 3 Posters 4.7k 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.
  • R
    rsw686
    last edited by Dec 5, 2007, 11:33 PM Dec 5, 2007, 11:28 PM

    I might be confused about how this setting works. I had set this to restrict SSH access with 3 connection per 240 seconds.

    My assumption was that the 4th SSH connection would be blocked but connections to to other ports would be allowed. However ALL connections from that IP are blocked to any port. Is this the intended operation?

    From my testing it seems that connections from that IP to ANY port after the IP is blocked resets the 240 second wait period? Or the wait period in seconds is being calculated wrong as just tested this out and its been 10+ minutes and it still won't let me back in.

    Is there any over to unblock the IP view the webgui? I tried to reset the state table without success. Making a firewall rule change and applying, which reloads the firewall rules didn't unblock it either.

    The reason I ask is that this doesn't work well for users that access my server behind a NAT. One mistake and the everyone is blocked out to all ports. If it just blocked the SSH port then this would work well.

    Maybe the best thing to do is just implement something on the box with SSH itself.

    1 Reply Last reply Reply Quote 0
    • D
      dotdash
      last edited by Dec 6, 2007, 7:57 PM Dec 6, 2007, 7:53 PM

      When you exceed the connection limits specified by the rule, it puts the offending IP into an internal table that is totally blocked (I think it's virusprot…). The table is cleared when you reboot, or you could clear it manually from a shell with pfctl... I forget the exact syntax...
      EDIT- something like this:
      pfctl -t virusprot -T delete 10.10.10.10

      1 Reply Last reply Reply Quote 0
      • R
        rsw686
        last edited by Dec 6, 2007, 8:07 PM

        Thanks for the explanation. This makes sense now. I think the blocks are cleared automatically after a designated time as I was eventually able to access the machine an hour or so later. Although I wonder if a webgui interface for viewing and or removing IP blocks would be useful?

        1 Reply Last reply Reply Quote 0
        • D
          dotdash
          last edited by Dec 6, 2007, 8:17 PM

          I think it would be cool to be able to drop to a custom table (instead of the hidden virusprot table) as defined in Aliases. Then you could add and delete from it via the webgui…

          1 Reply Last reply Reply Quote 0
          • R
            rsw686
            last edited by Dec 6, 2007, 9:57 PM

            I did some more searching on this and the above is all correct.

            http://osdir.com/ml/security.firewalls.pfsense.user/2006-07/msg00029.html

            At the moment an
            attackers IP address is globally blocked by one rule (see below), if he
            exceeds the limit of connections per timeslot:

            block in quick from <virusprot>to any label "virusprot overload table"

            What I want, is something like this:

            block in quick proto tcp from <virusprot>to any port 22 label
                                                          "virusprot overload table"</virusprot></virusprot>

            1 Reply Last reply Reply Quote 0
            • S
              sullrich
              last edited by Dec 6, 2007, 11:12 PM

              We reset the table very hour or so.  I also agree that converting it to a alias of some sort would be neat but since the table is cleared often it might not make sense.  Maybe a view of the tables contents allowing someone to delete an item would be a good idea..

              1 Reply Last reply Reply Quote 0
              • R
                rsw686
                last edited by Dec 6, 2007, 11:17 PM

                @sullrich:

                Maybe a view of the tables contents allowing someone to delete an item would be a good idea..

                This along with a way to block the IP entirely or just that IP's port. Neither of these is a big deal since I understand how it works now. Just icing on the cake.

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received