Forum Discussion
Adam_3360
Nimbostratus
Dec 10, 2010SNAT iRule based on outbound destination address
Hi All
Don't know if this is the correct way to do it, but I am trying to configure Outbound SNAT based on the destination address.
The scenario is that I have an internal server with an IP address of (for example) 192.168.1.100. This server needs to initiate outbound communication to certain internet based systems but use a different SNAT address for each.
So if I wanted to communicate out to 172.16.10.10 on the Internet (for example), I want the outbound SNAT set as 10.10.10.10 (again for example). If I wanted to communicate out to 172.16.20.20, the SNAT must be different at 10.10.20.20.
I have been reading about intelligent SNAT and iRule rules but was wondering whether this is the correct way, and if so whether anyone could suggest some example iRules?
Thanks
4 Replies
Sort By
- Chris_Miller
Altostratus
Do you want the SNAT to be based both on the source and destination address? If you create an iRule that SNATs traffic destined to 172.16.10.10, it'll SNAT it all, unless you say it should meet both the source (192.168.1.100) and destination (172.16.10.10). - Adam_3360
Nimbostratus
Hi Chris - Chris_Miller
Altostratus
Yep, that makes sense. You'll simply need to do a rule that switches based on destination address. I need to look into what form of IP::addr to use here though.when CLIENT_ACCEPTED { switch -glob [IP::local_addr] { "1.1.1.1" { snat x.x.x.x } "2.2.2.2" { snat y.y.y.y } }}
- Adam_3360
Nimbostratus
Hi Chris
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