Forum Discussion
Mark_Burchard_5
Nimbostratus
Mar 21, 2006iRule to limit access to webserver directory by client IP
Hi all,
First time posting here, and you'll probably laugh and shake your heads at this simple problem, but hopefully I'll learn. I have searched for similar iRules and can't seem to find t...
Guillaume_Bruss
Nimbostratus
Apr 10, 2006I try this
when RULE_INIT {
log local0. "Init redirect Https V2"
array set ::http_allowed_ip_list {
"10.0.0.11/12"
"10.0.0.12/13"
}
}
when HTTP_REQUEST {
log local0. "IP [IP::client_addr] Tries to connect"
if { ( not ( [ matchclass [IP::client_addr] equals $::http_allowed_ip_list ] ) ) } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}but I have an error
TCL error: Rule redirection_https_v2 - can't read "::http_allowed_ip_list": variable is array while executing "matchclass [IP::client_addr] equals $::http_allowed_ip_list
I suppose this is because I don't declare well my array
but it seems I have no error during init
any help appreciate
thanks
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
