Forum Discussion
2 Replies
- Karol_Biernack2Nimbostratus
Hey
I think this article should point you to correct solution
https://devcentral.f5.com/questions/irule-for-redirect-the-traffic-to-specific-node
- VernonWellsEmployee
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-specific
This 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.