Forum Discussion
ispksas_39015
Nimbostratus
Jun 26, 2009iRule for persistence bsed on tcp source port
Hello,
Can anyone guide me on iRule to acheive persistence based on srouce tcp port?
when CLIENT_ACCEPTED {
if {[TCP::client_port] != 0} {
persist uie [TCP::client_port]
}
}
Thanks.
- johns
Employee
I did this once for a customer, you can remove the client_addr portion to to get what you want: - ispksas_39015
Nimbostratus
Thanks John for your immediate response. - hoolio
Cirrostratus
The remote port in a clientside event is the client's source port. You could use TCP::client_port which returns the client's port in all events (client or serverside context) for something more intuitive. If the client's IP address won't change over the course of a session, you would probably want to include the client IP address in the persistence record as johns has done. - ispksas_39015
Nimbostratus
Thanks Aaron and Johns. I'm currently in a process of applying this irule and will test it out this evening. Will let you know.
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