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

    Reset states from Cron?

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 2 Posters 4.2k 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
      Gulkings
      last edited by

      Hey Guys,

      Found this http://forum.pfsense.org/index.php/topic,45417.0.html
      on how to reset states, but the last entry in the thread - I simply cannot make this work.
      I only want to reset states on one vlan with```
      /sbin/pfctl -F all -i bce1_vlan20

      Tried with -K and vlan net, but nogo there...
      
      Or is it not possible to reset states on vlan only?
      
      Please advice - TIA!
      
      /Gulkings
      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        use -k and specify the subnet.

        like:

        pfctl -k x.x.x.x/24 ; pfctl -k 0.0.0.0/0 -k x.x.x.x/24

        That will kill all states to and from x.x.x.x/24

        Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

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

          Thanks,
          I believe I've tried that already, however only with one subnet.
          Used -k 192.168.1.0/24 instead of -i interface.

          Do I have to use to->from subnet or should -k subnet work ?

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            Do it exactly as I put in above, or otherwise you'd only kill half the states.

            Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

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

              Understood.

              Just tried:

              /sbin/pfctl -F all -k 192.168.1.1/24
              

              from commandline sitting on adminnet (172.16.0.1), but it kills everything - just lost connection to both server and pfsense?

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                Don't use -F all, use the exact syntax I showed, just change the IPs.

                Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

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

                  Thanks, you're a saviour ;D!

                  /sbin/pfctl -k 192.168.1.1/24 ; pfctl -k 0.0.0.0/0 -k 192.168.1.0/24
                  

                  seems to do the trick! Any idea how soon that subnet will be able to start connections again after that reset?

                  /G

                  1 Reply Last reply Reply Quote 0
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    Immediately.

                    Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

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