Forum Discussion
chris_connell_1
Nimbostratus
Jun 17, 2010persistency on this irule
I have this irule which does not seem to work correctly in that I see requests not sent to the specified node when it hits the top 2 rules. Do we have to specify persistency in the irule even when its configured in the virtual server? Also I have configured a default pool in the virtual server resource section, so I assume if it doesnt hit any of these rules it will be sent to the default pool.
rule test-apn {
when CLIENT_ACCEPTED {
if { [matchclass [IP::remote_addr] equals ::opt-client] and [active_members unison] > 1 } {
node 10.129.60.2 80
persist source_addr 255.255.255.255 300
} elseif { [matchclass [IP::remote_addr] equals ::noopt-client] and [active_members unison] > 1 } {
node 10.129.60.66 80
persist source_addr 255.255.255.255 300
} elseif { [active_members unison] < 1 } {
virtual forwarding_TCP_vs
}
}
}
- hoolio
Cirrostratus
Hi Chris,when CLIENT_ACCEPTED { Check if client IP is in session table set node_info [session lookup uie [IP::client_addr]] if {$node_info ne ""}{ Use the IP and port from the session table entry scan $node_info {%s %s} ip port node $ip $port } else { if { [matchclass [IP::remote_addr] equals ::opt-client] and [active_members unison] > 1 } { Select the node and record the selection in the session table for 1 hour node 10.129.60.2 80 session add uie [IP::client_addr] [list 10.129.60.2 80] 3600 } elseif { [matchclass [IP::remote_addr] equals ::noopt-client] and [active_members unison] > 1 } { Select the node and record the selection in the session table for 1 hour node 10.129.60.66 80 session add uie [IP::client_addr] [list 10.129.60.66 80] 3600 } elseif { [active_members unison] < 1 } { virtual forwarding_TCP_vs } } }
- chris_connell_1
Nimbostratus
Hello Aaron - hoolio
Cirrostratus
If you're testing on v10, you should remove the :: prefix from the datagroup name. You can check the persistence records using 'b persist all show all' to see what records are being added with the iRule in use. - chris_connell_1
Nimbostratus
Thanks again Hoolio. I saw your other post regarding this and using the new classmatch command. Now it seems to work great!
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