Forum Discussion
Greg_Hammond
Aug 27, 2020Nimbostratus
url redirect based on client IP address range
I have written the following irule to redirect http requests based on IP address ranges but the user says it isn't working. Just need a little help verifying that the syntax is correct or if I am mis...
Samir
Aug 28, 2020MVP
Put additional log statements and see whether traffic is coming to your irule or not.
Monitor the logs. it will give some clue
when HTTP_REQUEST {
log local0. "Client IP address is - [IP::client_addr]:[TCP::client_port]"
if { ( [IP::addr [IP::client_addr] equals 10.10.10.0/24] ) } {
log local0. "Client IP address is - [IP::client_addr]:[TCP::client_port]"
HTTP::redirect "ttp://www.site1.com/ibs/Pages/ca_en.aspx"
} elseif { ( [IP::addr [IP::client_addr] equals 10.10.11.0/24] ) } {
log local0. "Client IP address is - [IP::client_addr]:[TCP::client_port]"
HTTP::redirect "https://www.site2.com/scripts/index.aspx/bpg/travel/pages/Concur"
}
}
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