Forum Discussion
iRule for access to two ip addresses to a URI
Hi!
I am looking for
a way to make
a irule.
Only
these two
ip's
can access
this
path.
All other
IP addresses
must access
anywhere but
not
to the
selected
URI
.
when CLIENT_ACCEPTED {
if { [IP::client_addr] equals 192.168.1.10 } {
pool MY_POOL_A
}
elseif { [IP::client_addr] equals 192.168.1.11 } {
pool MY_POOL_A
}
}
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/abc/dfg/"} {
pool MY_POOL_A
}
else {
default
}
}
}
This rule or similar, it's might work?
Regards
A. Diezma
2 Replies
- hoolio
Cirrostratus
Hi,
If you define an address data group named allowed_clients_dg with the two IP addresses, you can use an iRule like this to block requests to a specific URI made from clients not in the data group:when HTTP_REQUEST { Check for requests to the restricted URI if { [HTTP::uri] starts_with "/abc/dfg/"} { Check if the client IP is not in the allowed clients data group if {![class match [IP::client_addr] equals allowed_clients_dg]}{ Send a 403 response HTTP::respond 403 content {blocked!Aaron - adiezma_1656
Nimbostratus
It's worked!!
Certainly, the irules are very useful
Aaron, Thank you so much.
Antonio
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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