Forum Discussion
Mick_Thompson_6
Nimbostratus
Aug 29, 2006Redirect based on source IP
Hi,
I am looking to find the best way to redirect all requests made to a virtual Server to be redirected to a another Pool or server, except for serveral IP addresses that would need access to the Virual Server .
Thanks
Mick
- dennypayne
Employee
Click here for an example of using HTTP::redirect. There's also some other forum posts showing how to do if statements for client IP's. - Mick_Thompson_6
Nimbostratus
Thanks for the reply, but I think I need to do something similar to the irule below but I need to match several IP addresses. - unRuleY_95363Historic F5 AccountThen your best bet would be to create a DataGroup of IP addresses and switch to using the command "matchclass".
- Mick_Thompson_6
Nimbostratus
So how does this work if I am doing FWLB -- BIGIP --FW-- BIGIP - unRuleY_95363Historic F5 AccountWell, if you the external BIGIP is SNAT'ing then you would need to insert an X-Forwarded-For header (or equivalent) and then check against that (again, assuming you are implementing this check on the inside BIGIP). However, I would wonder why the check couldn't be done in the external firewall or whether you really need SNAT enabled...
- Mick_Thompson_6
Nimbostratus
We are not using Snat on the outside, so we have to use the irule on the inside - unRuleY_95363Historic F5 AccountWell, there you have it then: that should work fine.
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