Forum Discussion
Jason_Roppolo_3
May 15, 2006Historic F5 Account
iRules and SNAT
All,
I was wondering if I could get some assistance with an issue:
I have a rather large customer that is trying to replace several Alteon Switches, but we are having one issue. They have several servers that are multihomed with IP's on the same subnet as the Big-IP, but the resource needed is on another NIC/Subnet on that server. When packets arrive they are routed to the other NIC (Same Subnet as the BIG-IP) on the server creating an asynchronous route. Easy enough right? Add a host route? Well that breaks about 10 other apps so what I am looking for is an iRule that says when a connection is made outbound through a forwarding virtual from one server to another then use a particular SNAT. Any help on this would be greatly appreciated!!!
- JRahm
Admin
boolean logic : - Deb_Allen_18Historic F5 AccountLocal address is a given based on the virtual to which the rule is applied.
This version allows a comparison to a subnet for flexibility. (The appropriate syntax corrections have also been made on the "snat" & "snatpool" wiki pages.)when CLIENT_ACCEPTED { if {[IP::addr [IP::remote_addr] equals x.x.x.x/24] ) { snat y.y.y.y } }
- Jason_Roppolo_3Historic F5 AccountDeb,
- Deb_Allen_18Historic F5 AccountInteresting twist -- I've never had to SNAT on specific destination IPs through a forwarding virtual server (no defined local address, and the destination addresses are not local objects either.)
(I'm not 100% certain which IP command would pick up the destination address passing through a forwarding virtual. I'm guessing that it must be "local_addr", but I don't have a way to test a forwarding virtual, so I added a log line to help figure that out.)when CLIENT_ACCEPTED { log local0. "Local address is [IP::local_addr]" if {[IP::addr [IP::local_addr] equals x.x.x.0/24] ) { snatpool mySNATpool } }
class BounceBackSNAT { "x.x.x.a" "z.z.x.0 netmask 255.255.255.0" } when CLIENT_ACCEPTED { if {[IP::addr [IP::local_addr] equals $::BounceBackSNAT] ) { snatpool mySNATpool } }
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