Forum Discussion
f5now_28704
Nimbostratus
Jun 18, 2008IP Address based iRule
Im trying to block
---[HTTP::uri]] contains "/_grid/print/print_data.aspx"
from everyone with an IP not 10.0.0.0/8
I have one iRule.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/_grid/print/print_data.aspx" } {
HTTP::redirect "http://google.com"
}
}
I know that I can have the below somewhere but its just not adding up..
"inside network"-> if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] }
thanks for any direction.
BIG-IP 9.4.1 Build 29.2
R.
- hoolio
Cirrostratus
Like this?when HTTP_REQUEST { if { [string tolower [HTTP::path]] ends_with "/_grid/print/print_data.aspx" and (not ([IP::addr [IP::client_addr]/8 equals 10.0.0.0]))} { HTTP::redirect "http://google.com" } }
- f5now_28704
Nimbostratus
Perfection!!!!! - Colin_Walker_12Historic F5 AccountSharp looking rule. Simple, efficient, and a cool example of how to use iRules for something I don't see every day in the forums. Dig it.
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