Forum Discussion
Jean_Mamène
Dec 05, 2022Cirrus
Irule based on source IP and URI request
Hi, I want to redirect on pool the request if the IP source and URI request match to the condition. On version BIG-IP 11.5.4 I think it's better to do with iRule. Regards
Paulius
Dec 05, 2022MVP
You might be able to do something similar to the following. If it ends up being a long list I would recommend using a data group and using that to limit your lines of code because iRules do have a line limit.
when CLIENT_ACCEPTED {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST {
set URI [string tolower [HTTP::uri]]
if { [IP::addr [IP::client_addr] eq 10.10.10.10] } {
if { $URI eq "/my/uri/path" } {
pool my_pool_for_this_uri
} elseif { $URI eq "/my/other/uri/path" }
pool my_pool_for_other_uri
else {
$DEFAULT_POOL
}
} else {
$DEFAULT_POOL
}
}
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