Forum Discussion
LTM iRule help : assign client to SNAT IP based on datagroup match
Hi Everyone,
I would like to assgn the client IP to a SNAT IP from a Datagroup match, any help woul dbe appreciated. Something like the following is what we have so far but TCL error occurring with line "if { $mapped_snat ne "" } then {"
when CLIENT_ACCEPTED {
set sourceip [IP::client_addr]
set mapped_snat [class match $sourceip equals DataGroup]
if { $mapped_snat ne "" } then {
snat $mapped_snat
}
# log local0. "SNAT for $sourceip choose SNAT $mapped_snat"
}
If you want the value from datagroup key, you can use the following, it checks the datagroup and assign the value in one line.
if { [set mapped_snat [class match -value -- $sourceip equals DataGroup]] ne "" } {
Recent Discussions
Related Content
* 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