Forum Discussion
Shiraz
Apr 28, 2016Altostratus
Irule to block access of VS on specific days
Dears,
I am able to restrict the access to Virtual Server by providing the static time by using the below irule. However, I also want to use this irule to restrict the access on weekends.
when R...
Ibrahim_Kadiri
May 01, 2016Nimbostratus
Stan,
We need to run this irule on the specific site only, but the below irule which i created is blocking the parent site. We need to allow access to the parent without time constrain, and block access for one of the site with the below irule.
when RULE_INIT {
set static::START_OFF_TIME [clock scan "05:30 AM"]
set static::END_OFF_TIME [clock scan "01:00 PM"]
}
when HTTP_REQUEST {
set now [clock seconds]
set current_day [clock format [clock seconds] -format {%u}]
if { ([string tolower [HTTP::uri]] contains "/contractor/") && ($current_day > 1 ) && ($current_day < 4 ) && ( $now > $static::START_OFF_TIME ) && ( $now < $static::END_OFF_TIME ) } {
pool POOL_443
}
elseif {([string tolower [HTTP::uri]] contains "/contractor/") && ($current_day == 7 ) && ( $now > $static::START_OFF_TIME ) && ( $now < $static::END_OFF_TIME ) } {
pool POOL_443
}
elseif {
HTTP::respond 200 content "Not Authorised! Contact AdministratorNot Authorised! Contact Administrator..."
}
}
- Ashu_AggarwalOct 18, 2020Cirrus
Hi I have a similar requirement where i have to restrict the VS access to a IP subnet for a particular window. Were you able to make it work? If so can you please share the i-rule?
Thanks
Ashu
- jaikumar_f5Oct 19, 2020MVP
You could rather open a new thread, it would have more visibility.
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