vbhugra
Nov 10, 2023Nimbostratus
SNAT and Next hop based on Node address
I have a requirement wherein I have 2-nodes in a pool; of which 1 node is directly connected to F5 and the other one is behind a layer-3 router.
I want to make an iRule if the directly connected node goes off, it does SNAT Automap and also changes the next-hop.
I tried a couple of options, nothing worked, Please help
1. when LB_SELECTED {
if { [IP::addr [LB::server addr] equals 10.222.45.252] } {
LB::reselect snat automap
LB::reselect nexthop /DBS/DBS_CLIENT_174 10.219.30.65
}
}
2. when CLIENT_ACCEPTED {
if { [IP::addr [serverside {IP::remote_addr}] equals 10.222.45.252] } {
snat automap
nexthop /DBS/DBS_CLIENT_174 10.219.30.65
}
}