Forum Discussion
Kenny_Van_73892
Nimbostratus
Dec 07, 2006Need some help to direct http based-on IP and uri
I got a challenge here and if anyone knows someting, please help me out on this.
I got a secure website that I need to use irules to direct traffic from 2 clients' IP addresses: 172.10.10.3 ...
Martin_Machacek
Dec 08, 2006Historic F5 Account
It should work (after minor syntactic cleanup). It can be streamlined somewhat:
class allowed {
host 172.10.10.3
host 192.168.20.15
}
rule access {
if (client_addr equals one of allowed and http_uri starts_with "/access") {
if (client_addr == 192.168.20.15 and http_uri contains "/secureview")
{
discard
}
else {
use pool pool1
}
} else {
discard
}
}Using the class and the one of operator is especially useful if there are many addresses to test against. In your case in does not make much difference.
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