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...
hoolio
Cirrostratus
Jul 12, 2007If using separate virtual servers isn't an option, you could create a datagroup for each set of client IP addresses. You could then use an if/elseif/else to find which datagroup the client is a part of. You could then use 'persist uie' with an alias for the particular datagroup the client is a part of to use the existing persistence record or have a new record created automatically once a load balancing decision is made.
class group1 {
host 10.1.1.1
host 192.168.1.1
host 172.16.1.1
}
class group1 {
host 10.1.1.2
host 192.168.1.2
host 172.16.1.2
}
class group1 {
host 10.1.1.3
host 192.168.1.3
host 172.16.1.3
}
when CLIENT_ACCEPTED {
check to see if client IP is in one of the datagroups
if {[matchclass [IP::client_addr] equals $::group1]}{
client IP is in first datagroup, use existing persistence record or create a new one
persist uie "group1"
} elseif {[matchclass [IP::client_addr] equals $::group2]}{
check to see if client IP is in the second datagroup
client IP is in second datagroup, use existing persistence record or create a new one
persist uie "group2"
} elseif {[matchclass [IP::client_addr] equals $::group3]}{
check to see if client IP is in the second datagroup
client IP is in third datagroup, use existing persistence record or create a new one
persist uie "group3"
} else {
client IP is not defined in any datagroup, so take some default action
or perhaps just use source address persistence?
}
}If you have more than a few datagroups, you could replace the if/elseif/else with a loop to go through each datagroup by name.
Note that I didn't test this rule but hopefully it gives you some direction.
Aaron
[edited the rule description...]
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