Forum Discussion
sose_86565
Nimbostratus
Jan 19, 2009SNAT descision based on client ip and link availability
I have 2 ISPs that are being load balanced. I also have a list of internal IP's that we do not want to use SNAT's if ISP-A is online. Can someone validate this iRule for me? The Hosts class is the list of the IP's not to NAT, and the LB-server IP listed is the IP of the link for ISP-A.
class Hosts {
host 128.94.2.9
host 128.94.2.10
host 128.94.2.11
host 128.94.2.12
host 128.94.2.13
host 128.94.2.14
host 128.94.2.15
host 128.94.2.16
host 128.94.2.17
host 128.94.2.18
host 128.94.2.19
host 128.94.2.20
host 128.94.2.23
host 128.94.2.25
host 128.94.2.52
host 128.94.2.53
host 128.94.2.100
host 128.94.2.101
host 128.94.2.103
host 128.94.2.104
}
when LB_SELECTED {
if {[matchclass [IP::client_addr] equals "$::Hosts"} {
if {[LB::server addr] == "128.94.240.254"} {
snat none
}
else {
snat automap
}
}
else {
snat automap
}
}
- hoolio
Cirrostratus
The logic looks fine. You could use IP::addr to perform the IP address comparison:when LB_SELECTED { if {[matchclass [IP::client_addr] equals "$::Hosts"}{ if {[IP::addr [LB::server addr] equals 128.94.240.254]}{ snat none } else { snat automap } } else { snat automap } }
- sose_86565
Nimbostratus
Thanks hoolio.. With this rule in place, what Address Translation settings should I configure for the outbound virtual server? - hoolio
Cirrostratus
The address translation checkbox in the VIP properties in the GUI refers to destination address only. If you have a network VIP (a VIP with a destination address that does not have a mask of 255.255.255.255) you'll need to leave address translation disabled so LTM doesn't try to change the destination address on the packets. - brice
Nimbostratus
Along these same lines... Don't mean to hijack your thread, but it seems related...when LB_SELECTED { if {[IP::addr [LB::server addr] equals drop } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects