Forum Discussion
Ferg_104721
Oct 30, 2011Nimbostratus
Syntext on Irule for NATTING
Hi
I am writing an irule to do some natting (long story i know there are better ways). I know the switch statement has a limitation in the number of functions you can have it do, i.e. SNAT...
nitass
Oct 31, 2011Employee
what about this one?
when CLIENT_ACCEPTED {
if {[IP::addr [IP::remote_addr] equals "10.X.X.25"]} {
pool poo_2
snatpool SNATY member X.X.Y.1
} elseif {[IP::addr [IP::remote_addr] equals "10.X.X.26"]} {
pool pool_2
snatpool SNATY member X.X.Y.2
} else {
switch [IP::remote_addr] {
"10.X.X.5" { snatpool SNATX member X.X.X.1 }
"10.X.X.6" { snatpool SNATX member X.X.X.2 }
"10.X.X.7" { snatpool SNATX member X.X.X.3 }
"10.X.X.8" { snatpool SNATX member X.X.X.4 }
"10.X.X.9" { snatpool SNATX member X.X.X.5 }
default { snatpool SNAT }
}
}
}
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