Forum Discussion
xin_li_90490
Nimbostratus
Jul 11, 2007how to realized some clients persistence acording to source ip, but their src ip are not in one subnet?
there are 3 groups of clients accessed my telnet vs.
their ip is
group1:10.1.1.1, 192.168.1.1, 172.16.1.1
group2:10.1.1.2, 192.168.1.2, 172.16.1.2
group3:10.1.1.3, 192.168.1.3, 17...
Deb_Allen_18
Jul 12, 2007Historic F5 Account
Nice job, hoolio. Very creative use of univeral persistence.
If the match will always be on single IPs rather than subnet ranges, a slight refinement might offer better performance & scalability:
when CLIENT_ACCEPTED {
check to see if client IP is in one of the datagroups
set group [findclass [IP::client_addr] $::groups]
if { $group != "" }{
you can either specify the timeout value here or apply the iRule
under a universal persistence profile and specify timeout there
persist uie $group 500
} else {
client IP is not defined in any group, so take some default action
or perhaps just use source address persistence?
}
}
class groups {
10.1.1.3 group1
192.168.1.3 group1
172.16.1.3 group1
10.1.1.2 group2
192.168.1.2 group2
172.16.1.2 group2
10.1.1.3 group3
192.168.1.3 group3
172.16.1.3 group3
}Regardless of which version you use, you'll also either want to add a timeout to the "persist uie" command or be sure this rule is applied under a persistence profile of type "universal" to make sure stale persistence entries are reaped, otherwise you run the risk of memory exhuastion over time./deb
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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