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

    Enable/disable lan rule thru ssh

    Scheduled Pinned Locked Moved Firewalling
    3 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.
    • S Offline
      spider85
      last edited by

      Short question, is it possible to enable / disable a firewall rule (LAN interface) thru ssh so i can script it?

      Kind regards

      1 Reply Last reply Reply Quote 0
      • V Offline
        viragomann
        last edited by

        Check this out: https://doc.pfsense.org/index.php/Adding_Rules_With_easyrule

        1 Reply Last reply Reply Quote 0
        • NogBadTheBadN Offline
          NogBadTheBad
          last edited by

          If you're wanting to enable / disable current firewall rules you can schedule them, look in Firewall -> Rules- -> Edit  -> Advanced Options & Firewall -> Schedules

          [2.3.4-RELEASE][admin@pfsense]/root: easyrule block lan 1.2.3.4
          Host added successfully
          [2.3.4-RELEASE][admin@pfsense]/root: easyrule showblock lan
          1.2.3.4/32

          [2.3.4-RELEASE][admin@pfsense]/root: easyrule unblock lan 1.2.3.4
          Host unblocked successfully
          [2.3.4-RELEASE][admin@pfsenset]/root: easyrule showblock lan
          No block rules set on interface: lan

          Looking at the source code you can't do a lot with easyrule :-

          https://github.com/pfsense/pfsense/blob/master/src/usr/local/bin/easyrule

          Andy

          1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

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