Forum Discussion
iRule to Redirect or forward to an ip address
If the IP in the query string is a 10.x.x.x address, then a redirect is probably not your best bet for external requests. You could, however, send traffic to a specific node based on the query string. Here's a very basic example:
when HTTP_REQUEST {
if { [URI::query [HTTP::uri] printIP] ne "" } {
node [URI::query [HTTP::uri] printIP] 80
}
}
This would capture the printIP query string value and send the request, via the node command, to the IP specified (and an arbitrary port assignment. This example doesn't deal with error handling (a printIP query string that isn't an IP address), or persistence (what happens on subsequent requests from the same client if the query string doesn't exist - and needs to be sticky). Not sure if you need either, so didn't include them.
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