Forum Discussion
samir_110997
Nimbostratus
Nov 10, 2007PLEASE HELP SNAT conditionnel and traffic redirection
hi everybody,
as i'm not familiar with i-rules, i really need you help to correcte my i'rule cause the site is at risk.
I have created a strandard virtual serveur for the http traffic (80) and an i'rule so as to redirect all the traffic http to the second Internet provider ISP2, but there is only one exeption for three servers where the trafic http for theses servers should be directed to the first Internet Provider ISP1 and must be natted differently.
thes is my irule:
when LB_SELECTED {
if { [IP::addr [IP::client_addr] equals 172.24.95.139 ] } {
snat 196.29.40.139
pool Pool_Routeur_ISP1
} elseif { [IP::addr [IP::client_addr] equals 172.24.95.133 ] } {
snat 196.29.40.133
pool Pool_Routeur_ISP1
} elseif { [IP::addr [IP::client_addr] equals 172.24.95.135 ] } {
snat 196.29.40.135
pool Pool_Routeur_ISP1
} elseif { [TCP::local_port] == 80 } {
pool Pool_Routeur_ISP2
} elseif { [TCP::local_port] == 443 } {
pool Pool_Routeur_ISP2
} else {
snat automap
}
}
thanks for all in advance
- Deb_Allen_18Historic F5 AccountSounds like you're LB'ing outbound links?
class ISP1_server_SNATs { 172.24.95.139 196.29.40.139 172.24.95.135 196.29.40.135 172.24.95.133 196.29.40.133 }
when CLIENT_ACCEPTED { if { ([TCP::local_port] == 80) || ([TCP::local_port] == 443) } { set mySNAT [findclass [IP::client_addr] $::ISP1_server_SNATs " "] if { $mySNAT != "" } { log local0. "SNATing [IP::client_addr] to $mySNAT over ISP1" snat $mySNAT pool Pool_Routeur_ISP1 } else { log local0. "SNATing [IP::client_addr] to auto SNAT over ISP2" snat automap pool Pool_Routeur_ISP2 } }
- samir_110997
Nimbostratus
I get an error when applying the i-rule please can anyone have an idea about this: - hoolio
Cirrostratus
The datagroup (called a class in the bigip.conf) definition should be separate from the iRule. You can create a datagroup in the GUI under Local Traffic >> iRules >> Datagroup List.
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