Enable/disable lan rule thru ssh
-
Short question, is it possible to enable / disable a firewall rule (LAN interface) thru ssh so i can script it?
Kind regards
-
Check this out: https://doc.pfsense.org/index.php/Adding_Rules_With_easyrule
-
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: lanLooking at the source code you can't do a lot with easyrule :-
https://github.com/pfsense/pfsense/blob/master/src/usr/local/bin/easyrule