21-Jun-2022 21:27
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"
}
21-Jun-2022 23:34
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 "" } {