Forum Discussion
sjko_254603
Nimbostratus
May 12, 2017Apply Filter time setting
Hi
Please let me know if there is an I-Rule or other method that can apply filter policy through time setting.
Thank you.
Stanislas_Piro2
Cumulonimbus
May 15, 2017The following irule will deny connection out of business hours. you can filter source / destination / ports in this irule.
when RULE_INIT {
array set static::timerange {
Sunday {"05:30" "16:00"}
Monday {"05:30" "16:00"}
Tuesday {"05:30" "16:00"}
Wednesday {"05:30" "16:00"}
Thursday {"05:30" "16:00"}
Friday {}
Saturday {}
}
}
when CLIENT_ACCEPTED {
set now [clock seconds]
set current_day [clock format $now -format {%A}]
set start [lindex $static::timerange($current_day) 0]
set end [lindex $static::timerange($current_day) 1]
if {($start ne "") && ($end ne "") && ($now >= [clock scan $start]) && ($now < [clock scan $end])} {
do nothing
} else {drop}
unset start end
}
it is not possible to manage packet filter in irule. if you have AFM, you can manage irules in AFM rule.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects