hello,
Thank you for your answers.
The solution I found is a irule:
when HTTP_REQUEST {
log local0. ""
log local0. "************* start [TCP::client_port] *************"
log local0. "**** Client : [IP::client_addr]:[TCP::client_port]"
log local0. "**** LB Server : '[LB::server addr]'"
if { [LB::server addr] eq "" } {
log local0. "**** force eval LB Server"
eval [LB::select]
log local0. "**** eval OK !!!"
log local0. "**** New LB : '[LB::server addr]'"
set gw [getfield [LB::server] " " 2]
log local0. "**** Gateway : $gw"
switch $gw {
"172.20.112.125%10" { set nat "10.204.36.[expr ( [crc32 [IP::client_addr] ] % 126 ) +1 ]" }
"172.20.112.126%10" { set nat "10.204.32.[expr ( [crc32 [IP::client_addr] ] % 126 ) +1 ]" }
}
snat $nat
log local0. "**** S-nat : $nat"
nexthop $gw
} else {
log local0. "++++ LB choice : [LB::server addr]"
log local0. "++++ Gateway : $gw"
log local0. "++++ S-nat : $nat"
snat $nat
nexthop $gw
}
log local0. "************* end [TCP::client_port] *************"
log local0. ""
}
But strangely, the command eval [LB :: selec] 'works correctly for the first request, but never for the following ...
Here is an excerpt from / var / log / ltm
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw :
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : ************* start 39932 *************
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** Client : 194.250.98.57%10:39932
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** LB Server : ''
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** force eval LB Server
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** eval OK !!!
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** New LB : '172.20.112.126%10'
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** Gateway : 172.20.112.126%10
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** S-nat : 10.204.32.108
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw : ************* end 39932 *************
Oct 30 10:06:52 pyxb595 info tmm3[12555]: Rule /OVIP-INTERNET/Persistence_gw :
Oct 30 10:06:58 pyxb595 info tmm[12555]: Rule /OVIP-INTERNET/Persistence_gw :
Oct 30 10:06:58 pyxb595 info tmm[12555]: Rule /OVIP-INTERNET/Persistence_gw : ************* start 12475 *************
Oct 30 10:06:58 pyxb595 info tmm[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** Client : 194.250.98.57%10:12475
Oct 30 10:06:58 pyxb595 info tmm[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** LB Server : ''
Oct 30 10:06:58 pyxb595 info tmm[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** force eval LB Server
Oct 30 10:07:05 pyxb595 info tmm1[12555]: Rule /OVIP-INTERNET/Persistence_gw :
Oct 30 10:07:05 pyxb595 info tmm1[12555]: Rule /OVIP-INTERNET/Persistence_gw : ************* start 55778 *************
Oct 30 10:07:05 pyxb595 info tmm1[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** Client : 194.250.98.57%10:55778
Oct 30 10:07:05 pyxb595 info tmm1[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** LB Server : ''
Oct 30 10:07:05 pyxb595 info tmm1[12555]: Rule /OVIP-INTERNET/Persistence_gw : **** force eval LB Server
Someone has an idea? Is this a problem of writing?