Forum Discussion
swiss2000_13853
Nov 23, 2009Nimbostratus
SNAT pool and persistence
Hi all!
I have a LTM-setup (10.0.1) with a SNAT Pool containing 5 ip addresses. So each connection uses the next SNAT address (round robin).
But for persistent connection...
hooleylist
Nov 23, 2009Cirrostratus
Actually, it looks like getfield is a lot more efficient for this compared with scan. So you could replace the scan command with getfield:
when CLIENT_ACCEPTED {
Use a local array to configure the 5 SNAT addresses
set snat_ips(0) 1.1.1.1
set snat_ips(1) 2.2.2.2
set snat_ips(2) 3.3.3.3
set snat_ips(3) 4.4.4.4
set snat_ips(4) 5.5.5.5
Use getfield to parse the third octet from the client IP address
Get the modulus of the third octet against the number of the SNAT IPs in the array
set snat_number [expr {[getfield [IP::client_addr] "." 3] % [array size snat_ips]}]
log local0. "Client IP: [IP::client_addr], SNAT number $snat_number, SNAT IP: $snat_ips($snat_number)"
Apply the SNAT
snat $snat_ips($snat_number)
}
Aaron
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