Forum Discussion
boneyard
Aug 07, 2016MVP
there are a couple of issues with that iRule
SERVER_CONNECTED won't be hit until there is a connection with the server, that connection needs to use the SNAT address you want so you should do this earlier, the CLIENT_ACCEPTED event is a good one.
then you do need to swap [IP::remote_addr] to [IP::local_addr] as that is the IP of the server you are connecting to (seems weird, but this is looking from the big-ip point of view)
i mocked something up that works fine on a forwarding IP or performance L4 virtual server
when CLIENT_ACCEPTED {
if { [IP::addr [IP::local_addr] equals 30.30.30.30/24] } {
snat 10.10.20.50
} elseif { [IP::addr [IP::local_addr] equals 40.40.40.40/32] } {
snat 10.10.10.20
} else {
snat none
}
}
now it is up to you to add the classmatch stuff again if you need it. again if you get stuck post here.