Forum Discussion
Shawn_Puckett_8
Nimbostratus
Jul 18, 2006SNAT iRules for Multiple Gateways
Short description: I need to use different gateways out of the F5 for SNAT IPs.
Longer version: I need some of my systems that sit behind the Big-IP to NAT to different IPs so I can have our firewall NAT to public IPs then I can setup correct MX records. For example, server-192.168.72.57 needs to hit the firewall as 192.168.73.67 so the firewall knows to NAT to a set public IP. Well that is easy enough with SNAT but the issue is that I have two firewall gateways that only respond to their subnets but since the F5 only goes out one gateway and I can’t seem to get any of the pervious suggestions to work.
Here is my basic setup:
Internal Network: 192.168.72.0/24 (servers all site here)
External Network 1: 192.168.73.32/28 (these are Virtual Server IPs)
External Network 2: 192.168.73.64/28 (these are also Virtual Server IPs)
External Network 1 Gateway 192.168.73.33 (Firewall) <- default route
External Network 2 Gateway 192.168.73.65 (Firewall) <- unable to setup or use
I've seen some iRules similar to this:
when CLIENT_ACCEPTED {
if {[IP::addr [IP::local_addr] equals 192.168.73.65/28]} {
pool gateway-2
} else {
pool gateway -1
}
}
Even if that rule would work I can’t seem to create a working Pools for the gateways as neither gateway replies to pings (the firewall rejects pings on gateways) so the Big-IP considers it down and will not allow me to use it. So is there another approach I could use to with iRules.
Thanks,
Shawn
- Deb_Allen_18Historic F5 AccountHi Shawn -
CLIENT_ACCEPTED happens before the SNAT, and IP::local_addr in CLIENT_ACCEPTED is the address local to the BIG-IP (in this case the destination IP) so you'll want to look instead for the real IP.when CLIENT_ACCEPTED { if {[IP::addr [IP::remote_addr] equals 192.168.72.65/28]} { pool gateway-2 } else { pool gateway -1 } }
- Shawn_Puckett_8
Nimbostratus
Thanks for the reply, but I'm stumped. The docs you linked to say: “To create a pool of transparent devices, display the Pools screen and click the Create button. For more information, see Chapter 4, Configuring Load Balancing Pools.” But I don’t see anything that tells me how to pick a monitor that is “transparent” all I see are a few monitors, I even create a custom one per first link you provided but that is not available to new Pools. I’m so sorry, but I’m not getting it. Can you point to another example of how someone has done this? - Shawn_Puckett_8
Nimbostratus
Does anyone know of an example in the manual or other location that would direct me on setting up two routes based on SNAT IP's? Please help, I've been reading the manual but can't get any clear picture on this, sorry. - JRahm
Admin
If you search the forum for "source route" you will find some help. Here is one such thread: - Shawn_Puckett_8
Nimbostratus
I've run into two problems: - JRahm
Admin
Pool objects and associated monitors are off-topic for this forum. I would recommend not monitoring until you get the desired routing achieved, then worry about availability. You will need to contact support for this information. - unRuleY_95363Historic F5 AccountThere's also a monitor called "gateway_icmp" that might work for you...
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