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

    Question on Firewall Schedules in pfSense 2.3.2

    Scheduled Pinned Locked Moved Firewalling
    43 Posts 6 Posters 12.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.
    • DerelictD Offline
      Derelict LAYER 8 Netgate
      last edited by

      Click individual date to select that date only. Click the appropriate weekday Header to select all occurrences of that weekday.

      So if you want the same thing to fire every day, select all weekdays using the weekday headers (Sun, Mon, Tue, etc). Only on Mondays, select only Monday.

      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
      • KOMK Offline
        KOM
        last edited by

        IIRC with the older config, it didn't work if you left it open but had some block rules – the states would remain open and not cleared.  Instead, you had to block everything and then create rules when to allow access.  I wonder if it still behaves this backwards way.

        1 Reply Last reply Reply Quote 0
        • T Offline
          thecableguy
          last edited by

          It doesn't seem to work… I am having the same issue with states remaining after the scheduled PASS expires.

          I have UpNP off, block rule above pass rule in the LAN tab..

          I have been using PF for years but it seems the last release or two, something has changed or broken the way states are cleared when the schedule changes?

          :o

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

            No idea.  I don't use scheduling at all, but I remember the way you had to do it wasn't intuitive unless you understood what was going on behind the scenes.

            1 Reply Last reply Reply Quote 0
            • T Offline
              thecableguy
              last edited by

              Something is broken on the last release.. I have removed the pass rules in the LAN tab and both aliases can still access all blocked services.

              Manually clearing states works initially however, the states re-establish after a few mins..

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

                Unpossible. Every time I lab this when someone says it doesn't work it works just fine.

                If there is not a matching pass rule on LAN traffic will be blocked.

                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
                • T Offline
                  thecableguy
                  last edited by

                  Thanks for the reply but this is the case.. Something must have gone wrong with the last update..

                  Looks like a re-install  :'(

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

                    Doubtful. But a reinstall takes 5 minutes + packages so if you think that might be the case, it can't hurt.

                    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
                    • T Offline
                      thecableguy
                      last edited by

                      Thanks, reinstall tonight and report.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thecableguy
                        last edited by

                        I thought i would try an older config backup before reinstalling PF from scratch.

                        It looks like everything is working again… Scheduled blocks are fine and firewall log entries are as expected.

                        Previously, no LAN blocks were working and nothing was showing in the firewall logs.. Not sure what went wrong but the older config reload fixed my issues for now.

                        Would be nice to know what went wrong?  :o

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          thecableguy
                          last edited by

                          Ok, problem back again.. The only thing I can point to is after modifying the schedules the scheduled 'pass' rule does not seem to work. After I manually clear states, the links are broken and the schedule shows the correct status in the 'pass' rule but after another cycle, the scheduled 'pass' doesn't kill states.

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thecableguy
                            last edited by

                            No one has a similar issue or any suggestions?

                            1 Reply Last reply Reply Quote 0
                            • N Offline
                              n3by
                              last edited by

                              Looks like this is an old/unsolved problem…

                              To solve it you can add a cron job to clear all states for that IP ( or more IP's ) after time schedule is not active with this command:

                              /sbin/pfctl -k IP
                              example:
                              /sbin/pfctl -k 192.168.103.100
                              

                              Just remember:

                              1. first rule will allow to pass traffic on time schedule for that IP.
                              2. second rule will deny traffic for that IP.
                              3. cron will clear all states for that IP ( 1 minute after first rule is not active ).
                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                thecableguy
                                last edited by

                                Yes, seems to be an ongoing issue..

                                After a reboot, everything works fine for a week or so and then the states don't clear properly..

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  thecableguy
                                  last edited by

                                  I am still having this issue. . I have narrowed it down to when I make a change to a schedule this problem occurs.

                                  I have tried resetting states and reloading the firewall rules after the schedule change but after the timed block/pass, some states remain active and require a manual clearing of states.

                                  As long astory the schedules are not altered, everything works as expected..

                                  I shouldn't have to reboot after a schedule change?

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

                                    I should hope not.  If this is something you can reproduce faithfully, you could post your steps here for others to confirm, and then enter a bug at Redmine to address it.

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      thecableguy
                                      last edited by

                                      Could you please have a look at my rules?

                                      I have blocked out the kids names but what I have are all IP's setup in aliases, a bandwidth limiter and different schedules for blocking steam ports (alias again) and to completely block internet using PASS rules in the schedule.

                                      ![lan rules.JPG_thumb](/public/imported_attachments/1/lan rules.JPG_thumb)
                                      ![lan rules.JPG](/public/imported_attachments/1/lan rules.JPG)

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

                                        Are you sure the Steam ports being blocked should be source ports? Source ports are usually random to specific destination ports.

                                        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
                                        • T Offline
                                          thecableguy
                                          last edited by

                                          Good question, my understanding is the 'source' in this situation would be the host on the LAN, as per the rule?

                                          The block works if applied manually and also most of the time however as I mentioned, if I modify a schedule, reload the firewall rules and reset states the scheduled block stops working and requires a reboot of the firewall..

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

                                            Source ports are almost always random. Destination ports are almost always static.

                                            For instance to pass connections only to HTTP servers you would pass source LAN net port any dest any port 80 on the LAN interface.

                                            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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.