Forum Discussion
hooleylist
Feb 22, 2011Cirrostratus
Hi Felipe,
You'd need to use an iRule for this. You could basically check in CLIENT_ACCEPTED to see if the client IP (IP::client_addr) is in a datagroup of source IP address/networks to SNAT. You could then apply the SNAT using logic like this:
when CLIENT_ACCPTED {
Check if client IP is in address datagroup of allowed source addresses
if { [class match [IP::client_addr] equals allowed_snat_clients_class] }{
Take the last octet of the client IP and use that for the SNAT address
snat "172.23.180.[getfield [IP::client_addr] . 4]"
}
}
Note that you don't need to define any SNAT object to use this iRule.
Aaron