Forum Discussion
sukraf_88722
Nimbostratus
Jan 30, 2008Help with Irule to forward traffic
What I am needing to do is forwaard http traffic to the internet that matches a IRule instead of our internal pool members. Understand how to match a URI but not how to forward it backout.
Example: any http uri containing yahoo forward.
I have tried default_gw pool, wich I cant get to work and have tried to forward to a Ip_forward VIP 0.0.0.0 but in 9.3.0 cant use virtual (poolname}.
Any thoughts are appreciated.
4 Replies
- The_Bhattman
Nimbostratus
In order to answer your question there are several assumptions that need to be made.
1. The default route on the LTM points towards the firewall or router that points you our to the internet.
2. Your client has to be able to route towards the VIP somehow either through your network.
3. VIP 0.0.0.0:80 at the minimum.
4. You may need may need SNAT or AUTOSNAT if the clients gateway isn't the LB.
Your IRULE could look like this, applied on the VIP 0.0.0.0:80when HTTP_REQUEST { if { [HTTP::uri] equals something]} { forward } else { pool pool_name } }
You could also use the SWITCH Command, references can be found on the following link so Click here
I have never tried this particular way of forwarding but that may be the logic you want to go with. - Shay_Ben-David1
Nimbostratus
the irule written by: cmbhatt is ok, but you did not mention what happens if it does not match the uri, because if the else reffers to pool that has one of your default gateways you will be routed anyway.
doing an irule on the 0.0.0.0 vs will affect all your traffic maybe you can add spesific VS on Performance L4 and add the iRule there.
Shay - The_Bhattman
Nimbostratus
There are different ways to handle when the URI doesn't match, that the original poster didn't mention. The original poster seemed to only be be interested in how to match the URI and forward it. - Colin_Walker_12Historic F5 AccountIf you're concerned about effecting all traffic, you could always just have the "else" clause of the if statement in that example rule do nothing. That way only traffic that matches the desired pattern is effected at all.
Colin
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