Laudec_55181
Nov 20, 2012Altostratus
SRC and DST Match Irule for NATting
I have the following irule, using two datagroups. The DG_DEST datagroup has a value that is a snatpool name. I need to set the snatpoolname variable to this value. What is the best way to do that with the iRule:
when CLIENT_ACCEPTED {
This iRule would NAT the source IP in the DG_SRC and match it to a destination in DG_DEST
and then snat to the snatpool defined in DG_DEST as the value corresponding to the name.
if { [class match [IP::client_addr] equals "DG_SRC" ] } {
if { [set snatpoolname [class match [IP::client_addr] equals "DG_DEST" ]] } {
log local0. "Got Natted to $snatpoolname"
snatpool $snatpoolname
}
}
else { forward
log local0. "NOT GETTING NATTED !!!"
}
}