Forum Discussion
Dec 16, 2016
I must confess that this scenario made me cringe a bit.
But it sounds like a bit of a challenge and I don't mind experimenting on other peoples environments! 🙂
How about trying to force the LB to detach the connection before doing the SNAT again?
Please note that I have not checked the syntax in my LB as I'm not at the office. Use in QA first if possible:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/uri1/" - "/uri2/" - "/uri3/*" {
if { [IP::addr [IP::client_addr]/24 equals 10.1.1.0] } {
Check if another snat has been chosen in this session
Close the server side connection if it has
if{ [info exists chosensnat] && $chosensnat != "snat1"
LB::detach
}
snat automap
set chosensnat "snat1"
}
pool pool-www-11
}
"/uri4/*" {
if { ( [IP::addr [IP::client_addr] equals 10.1.1.69] ) or ( [IP::addr [IP::client_addr] equals 10.1.1.76] ) } {
Check if another snat has been chosen in this session
Close the server side connection if it has
if{ [info exists chosensnat] && $chosensnat != "snat2"
LB::detach
}
snat 10.1.1.250
set chosensnat "snat2"
}
pool pool-www-11
}
default {
if { [IP::addr [IP::client_addr]/23 equals 10.10.10.0] }{
Check if another snat has been chosen in this session
Close the server side connection if it has
if{ [info exists chosensnat] && $chosensnat != "default"
LB::detach
}
snat automap
set chosensnat "default"
}
pool pool-www-22
}
}
}
Updated: Thanks Ed
/Patrik