Hi,
when I deploy a LC, I use this irule for outgoing VS (this is the only one except the one for FTP)
when RULE_INIT {
unset static::SnatPolicy
array set static::SnatPolicy {
"10.1.1.1" {"gateway_pool_isp1" "1.1.1.1" "1.1.2.1"}
"10.1.1.2" {"gateway_pool_isp2" "1.1.1.2" "1.1.2.2"}
"10.1.1.3" {"default_gateway_pool" "1.1.1.3" "1.1.2.3"}
"default" {"default_gateway_pool" "1.1.1.4" "1.1.2.4"}
}
Format:
"source IP Address" {"gateway pool" "NAT when ISP1" "NAT when ISP2"}
}
when CLIENT_ACCEPTED {
if { [info exists static::SnatPolicy([IP::client_addr])]}{
set clientip [IP::client_addr]
} else {
set clientip "default"
}
pool [lindex $static::SnatPolicy($clientip) 0]
}
when LB_SELECTED {
if { [IP::addr [LB::server addr]/24 equals 1.1.1.0]} {
set link 1
} else {
set link 2
}
snat [lindex $static::SnatPolicy($clientip) $link]
}
The VS is performance Layer4 with default gateway_pool and with any protocols
I also create one pool per ISP:
gateway_pool_isp1 and gateway_pool_isp2 with both gateway as member but with priority group activation