Forum Discussion
iRule correct or not
I have a link controller setup and i want the server1 and server2 to be translated to separate snat pools and go out via different gateway pool and the rest of the traffic should go out via default snatpool and gateway pool. So i have written the below iRule can some one comment if this is correct or there is some problem in the coding?
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals "Server1"]} {
snatpool snat_proxy1
pool GW_ISP1_Pool
} elseif {[class match [IP::client_addr] equals "Server2"]} {
snatpool snat_proxy2
pool GW_ISP2_Pool
}else {
snatpool Default
pool gateway_pool
}
}
1 Reply
- uni
Altocumulus
If Server1 is a single IP address, you can change your statement to
if { [IP::addr [IP::client_addr] equals 10.1.2.3] } {If it represents several IP addresses, create a data-group (such as server1_ip_class) with the IP addresses in it, and change your test to
if { class match [IP::client_addr] equals server1_ip_class } {
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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