Forum Discussion
Killing TCP connection attached to secondary when primary server is back (in active/passive mode)
This is an iRule I created some time ago to do about what you are asking for. In this example pool member 10.0.0.1 is de primary pool member and pool member 10.0.0.2 is the backup pool member. This iRule will monitor TCP traffic when there are active connections to the backup member. When there are active connections being send to the bacup server, while the primary pool member is up (again), it will reject the current active connection to the backup pool member.
Note that this iRule has been tested in my lab only.
when CLIENT_DATA {
if { [LB::status pool pool_name member 10.0.0.1 80] equals "up" } {
reject
Disable future events in this or any other iRule on the virtual server
event disable all
Exit this event of this iRule immediately
return
}
TCP::release
TCP::collect 1
}
when SERVER_CONNECTED {
if { [IP::addr [LB::server addr] equals 10.0.0.2] } {
clientside { TCP::collect 1 }
}
}
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
