Forum Discussion
Brad_Wood_7735
May 31, 2007Historic F5 Account
NAT Irule
I have a client that wants to do the following… The "had" this functionality in some alteons that we replaced. Not sure of how to write this irule up, looking for some guidance from the experts!! TIA
From the client....
"I want to NAT an entire network one-to-one without setting up each individual IPs.
Example, someone types in telnet 11.5.110.x which routes to the F5 BigIP. BigIP NATs that to 10.5.110.x where x can be any valid host on the network."
- hoolio
Cirrostratus
You can test how to get the last octet of the destination IP with something like this:when RULE_INIT { set ::translated_ip_prefix "1.2.3." set destination_ip 10.20.30.40 set last_octet [getfield $destination_ip "." 4] set translated_ip $::translated_ip_prefix$last_octet log local0. "\$translated_ip: $translated_ip" }
when RULE_INIT { set ::translated_ip_prefix "10.20.30." } when CLIENT_ACCEPTED { node $::translated_ip_prefix[getfield [IP::local_addr] "." 4] [TCP::local_port] log local0. "Translated IP: $::translated_ip_prefix[getfield [IP::local_addr] "." 4] [TCP::local_port]" }
- Brad_Wood_7735Historic F5 AccountThanks!! I have gotten your suggestions over to the client. Great Idea!!! I'll post up the final irule when we get it complete.
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