Forum Discussion
Marvin_129795
Nimbostratus
Jul 09, 2018Irule persist lookup source_addr for specific virtual server
Is there a way to lookup (persist lookup) the source IP address persistence for a specific VS only?
The tmsh command is like this but is there an equivalent using the persist lookup in Irule? ...
Jason_Cohen_417
Aug 01, 2018Historic F5 Account
Marvin,
For the most part, getting an added command to look across other virtuals persist records without enabling persist across * is slim. There are probably too many dark corners around which that could / would break. The preferred mechanism to do this would be with the table commands.
A minimal framework using the table commands could look similar to this:
when RULE_INIT {
probably makes more sense to use data groups here
quick and dirty PoC
set static::web1_peer "/Common/vs_web2"
set static::web2_peer "/Common/vs_web1"
}
when LB_SELECTED {
table set [virtual name]:[IP::client_addr] [LB::server]
}
when HTTP_REQUEST {
if { [virtual] eq "/Common/vs_web1" } {
set peer ${static::web1_peer}
}
elseif { [virtual] eq "/Common/vs_web2" } {
set peer ${static::web2_peer}
}
set peer_persist [table lookup ${peer}:[IP::client_addr]]
if { ${peer_persist} ne "" } {
log local0. "${peer} persist-record: ${peer_persist}. Select and persist to partner memeber."
}
else {
log local0. "Peer persist-record not found. Making selection."
}
}
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
