Forum Discussion
naladar_65658
Oct 29, 2009Altostratus
I haven't had a chance to try this out, but I think the general logic MAY look something like this:
1. Create a Datagroup named "ServerAddress" and throw in the IP of the server. If you use a datagroup it can be easier to expand the iRule in the future (IMO).
2. iRule similar to the one below:
when RULE_INIT {
"clock seconds" will return the time in seconds
"clock format" will format the previous value with it's date/time components
split will chop the returned string into a list of elements.
set l [split [clock format [clock seconds] -format {%A %H}] " "]
Next add the time check logic:
if { ([lindex $l 1] >= 0) &&
([lindex $l 1] < 2) } {
Put in iRule logic here
if {([matchclass [IP::client_addr] equals $::ServerAddress])} {
discard
}
}