Forum Discussion
Irule to redirect traffic to a pool with node that is out on the internet
Grettings Dev central, I have been asked to write an Irule to do the following. Client connects to www.company.com and gets directed to pool configured in virtual server as normal. Client connects to www.company.com/alternate and get sent to alternate_pool which has a host that is out on the internet via external vlan. I need the F5 to proxy this connection and not just redirect to the different URL. I have the following Irule and was hoping someone could look at it and tell me if it will work and what should be added.
Thanks
Assign a pool and SNAT based on HTTP URI
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path ]] {
"/alternet*" {
select the pool and SNAT automap
pool alternet_pool
snat automap
}
}
}
4 Replies
- Kevin_Stewart
Employee
This looks pretty good. You're sending the traffic to a pool of hosts that are external to your environment and enabling automap SNAT so that the remote host sees the self-IP of the BIG-IP. The most important aspect of this configuration is ROUTING. You must ensure that 1) the BIG-IP can route to these remote hosts, and 2) the remote host can route back based on the SNAT IP (which may or may not be required).
You may also want to consider, depending on your software version, 1) enabling OneConnect and/or 2) setting a default action in your switch statement to go back to internal pool(s). - pvaughan
Nimbostratus
Kevin, how do I set a default action in the switch statement? I am new at this.
Thanks - pvaughan
Nimbostratus
double post, sorry.
- Kevin_Stewart
Employee
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path ]] { "/alternet*" { select the pool and SNAT automap pool alternet_pool snat automap } default { pool local_pool } } }
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