Forum Discussion
Source IP to Node with backup
All,
I've got the following iRule I use when I want to drive traffic from a source ip to a specific node.
when CLIENT_ACCEPTED { if {[class match [IP::client_addr] equals ipsec_bypass_backup] and [LB::status node 192.168.155.5 up]} { node 192.168.155.5 }
I'd like to add an option to direct traffic to a secondary node is the first is down, and am having problems. Blow is the iRule I'm testing with. It works, but only if I clear the clients connection after the first node fails. If I don't manually clear it, the session will stay on the dead node until it times out.
when CLIENT_ACCEPTED { if {[class match [IP::client_addr] equals ipsec_bypass_backup] and [LB::status node 192.168.155.5 ] eq "up" } { node 192.168.155.5 } elseif {[class match [IP::client_addr] equals ipsec_bypass_backup] and [LB::status node 192.168.157.5 ] eq "up" } { node 192.168.157.5 } }
4 Replies
Hi!
Try changing the LB Method to Reject. Using the defalt, "None" would keep the active connection alive.
/Patrik
Or you can move the rule to the HTTP_REQUEST event instead of CLIENT_ACCEPTED. That should also do it.
/Patrik
- Stewart
Altostratus
Hi Tyler,
Another way would be to send your traffic to a pool and set the pool up so that it will only dispatch traffic to your favoured node unless it's down, in which case it'll go to the second one. You can do this using different priority groups for the pool members and setting the min active members to 1. That would cut down on the size of your iRule.
Stewart.
- nitass
Employee
have you tried to set reject or reselect in action on service down as Patrick suggested?
sol15095: Overview of the Action On Service Down feature
http://support.f5.com/kb/en-us/solutions/public/15000/000/sol15095.html
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