Forum Discussion
Rob_78590
Nimbostratus
Aug 25, 2009iRule for SNAT for Host IPs & Supernets based on specific customer
Hi everyone! We currently have an iRule setup to SNAT to a particular IP depending on which customer it is. We specify the customer's host address in the Data Group List and associate it to our IP tha...
Rob_78590
Nimbostratus
Aug 28, 2009Hi Aaron,
One of our engineers modified the iRule a bit, and it works great for host IPs as well as supernets. Here is the iRule;
when CLIENT_ACCEPTED {
Loop through each line in the datagroup
foreach line $::syniverse_snat {
Check if the local IP equals the current line's subnet
if {[IP::addr [IP::local_addr] equals [lindex $line 0]]}{
log local0. "[IP::local_addr]:[TCP::local_port]: Matched [lindex $line 0], using SNAT [lindex $line 1]"
Use the SNAT IP
snat [lindex $line 1]
Exit the loop as we've found a match
break
}
}
}
Thanks a lot for your help!
Rob
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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