Forum Discussion
iRule for redirecting all traffic to a perticular on LTM
Hi guys,
Need a help in a writing a iRule. Requirement is to redirect all traffic coming from one specific public IP to one specific node. If anyone aware of doing this with or without iRule and share with me will be a much appreciated.
Thanks
2 Replies
- Karol_Biernack2
Nimbostratus
Hey
I think this article should point you to correct solution
https://devcentral.f5.com/questions/irule-for-redirect-the-traffic-to-specific-node
- VernonWells
Employee
No iRule is needed. Virtual Servers have a source discriminator, which, by default is 0.0.0.0/0. You can leave the existing Virtual Server with this source matcher in place, then create a second Virtual Server with the same destination IP+port+proto, but with a specific Source Address configured. Something like this:
tmsh create ltm pool pool-http-general members replace-all-with { 10.10.10.1:80 { } 10.10.10.2:80 { } 10.10.10.3:80 { } } tmsh create ltm pool pool-http-specific members replace-all-with { 10.10.10.3:80 { } } tmsh create ltm virtual vs-http-general destination 203.0.113.1:80 profiles replace-all-with { tcp {} } ip-protocol tcp pool pool-http-general tmsh create ltm virtual vs-http-specific source 198.51.100.1/32 destination 203.0.113.1:80 profiles replace-all-with { tcp {} } ip-protocol tcp pool pool-http-specificThis would send traffic from most sources to a pool with three IPs, but send 198.51.100.1 to only one of those pool members (specifically, 10.10.10.3:80, in my example).
This is more performant than an iRule, but quickly becomes unwieldy if you are doing it for more than one IP or one netblock.
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