Forum Discussion
Restrict access to VS by ip & time
- Can you mark one of these as Best answer? Did you solve the problem in some other way?
- Ashu_AggarwalNov 03, 2020Cirrus
No I could not resolve it, The i-rule is not working as expected. It just keep blocking the connection regardless of time. Thanks!
- JRahmNov 04, 2020Admin
Hi Ashu, take a look at this iRule for guidance: https://devcentral.f5.com/s/articles/irule-maintenance-windows.
- Ashu_AggarwalJan 22, 2021Cirrus
Hi ,
Thanks for your response. Where to enter the values for day start_time end_time. Sorry i haven't get this part & bit confusing to me. For example i want to enable the maintenance window every Wednesday at 10:15PM & end at 12:15AM(Thursday).
Thank You!
- JRahmJan 23, 2021Admin
Give this a shot.
when RULE_INIT { set static::start_time 221500 set static::end_time 001459 set static::days [list "Wednesday" "Thursday"] } when HTTP_REQUEST { scan [clock format [clock seconds] -format {%A %H%M%S}] {%s %s} cur_day cur_time ### FOR TESTING PURPOSES ONLY ### # immediately before the maintenance window #scan [clock format [clock scan "Wed Jan 20 22:14:59 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time # at very beginning of the maintenance window #scan [clock format [clock scan "Wed Jan 20 22:15:00 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time # at the very end of the maintenance window #scan [clock format [clock scan "Thu Jan 21 00:14:59 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time # immediately after the maintenance window #scan [clock format [clock scan "Thu Jan 21 00:15:00 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time ### END TESTING STRINGS ### if { !(($cur_day eq [lindex $static::days 0]) && ($cur_time >= $static::start_time)) && !(($cur_day eq [lindex $static::days 1]) && ($cur_time <= $static::end_time)) } { # NORMAL CONDITION HTTP::respond 200 content "Situation: Normal. $cur_day, $cur_time " } else { # MAINTENANCE CONDITION HTTP::respond 200 content "Situation: Maintenance. $cur_day, $cur_time " } }
Recent Discussions
Related Content
* 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