nanselmo_108951
Dec 17, 2012Nimbostratus
Need help with a SNAT iRule
So I have an iRule which will effectively SNAT everything to the VIP address, but I need to modify it to ONLY SNAT traffic where the source subnet is the same as the destination subnet. Any help here would be greatly appricated.
rule ir_snat2vip {
when CLIENT_ACCEPTED {
set VirtualIP [clientside {IP::local_addr}]
snat $VirtualIP
}
}
We have other iRules which do the selective SNAT but each one has to be created and the subnet must be noted on each one. I would rather have it where there is just one standard iRule across all my devices and anytime an application needs SNAT we just apply the iRule. Below is an example of a selective SNAT rule.
rule ir_snat_10_42_20 {
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.42.20.0/24] } {
snatpool abc_snatpool
}
}
}
Sooooo... any help would be greatly appreciated.