Forum Discussion
Tom_Thunem_9204
Nimbostratus
Jun 05, 2015check to see if an HTTP header IP is in a particular address space
trying to determine the iRule syntax that determines if an http::header IP is part of a certain address space. for example,
if [http::header true-client-IP] is in 172.16.38.0/24 redirect to http://blah.com
Can't use the IP::client_addr as that will change since the connection is coming from a remote CDN (Akamai). The 'true-client-ip' is the IP from the original user request.
1 Reply
- cjunior
Nacreous
Hi,
See this example below, but is expected to be a valid IP when header exists. Regardswhen HTTP_REQUEST { if { [HTTP::header exists true-client-IP] } { if { [IP::addr [HTTP::header true-client-IP] equals 172.16.38.0/24] } { HTTP::respond 302 noserver Location "http://blah.com" } } }https://devcentral.f5.com/wiki/iRules.HTTP__respond.ashx
https://devcentral.f5.com/wiki/iRules.IP__addr.ashx
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