Forum Discussion
mike_89584
Jun 13, 2016Nimbostratus
iRule help
Hi I have two separate irules - one to restrict access to certain IPs and one to force basic authentication, and I now find that I need to combine the two, that is allow certain IPs to a VIP (or fold...
- Jun 13, 2016
Hi,
haven't understand quite well your requirement. Here the new try :
when HTTP_REQUEST { if { [IP::client_addr] eq "xxx.xxx.xxx.xxx" } { pool Pool_my_pool.com } else { binary scan [md5 [HTTP::password]] H* password if { [class lookup "[HTTP::username]" local_user_dgroup] equals $password } { log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]" } else { log local0. "User [HTTP::username] has been denied access to virtual server [virtual name]" HTTP::respond 401 WWW-Authenticate "Basic realm=\"Secured Area\"" } } }
Yann_Desmarest_
Jun 13, 2016Nacreous
Hi,
haven't understand quite well your requirement. Here the new try :
when HTTP_REQUEST {
if { [IP::client_addr] eq "xxx.xxx.xxx.xxx" } {
pool Pool_my_pool.com
} else {
binary scan [md5 [HTTP::password]] H* password
if { [class lookup "[HTTP::username]" local_user_dgroup] equals $password } {
log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]"
} else {
log local0. "User [HTTP::username] has been denied access to virtual server [virtual name]"
HTTP::respond 401 WWW-Authenticate "Basic realm=\"Secured Area\""
}
}
}
- mike_89584Jun 13, 2016NimbostratusPerfect - thank you :-)
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