Forum Discussion
Dan_Williams_25
Nimbostratus
Sep 19, 2005Selective SNAT iRule
Apologize if this has already been posted.
I recently upgraded to a pair of 6400s that are running v.9.0.5. During the days of 4.5.x, I was able to utilize a "Selective SNAT" rule of sorts that allowed me to manipulate when a private network, 10.x, would SNAT and not-SNAT.
Here is the original 4.5.x rule:
if (client_addr == 10.0.35.0 netmask 255.255.255.0 and (server_addr == 192.168.1.0 netmask 255.255.255.0 or server_addr == 172.16.1.0 netmask 255.255.0.0 or server_addr == 10.0.1.0 netmask 255.255.255.0)) {
use pool Forwarding_Pool_NoSNAT
}
else {
use pool Forwarding_Pool
}
I've done some digging and setup some preliminary iRules that would seem to work, but don't. I'd appreciate it if an engineer could help me out.
Regards,
Dan
6 Replies
- Colin_Walker_12Historic F5 AccountThis is certainly something that's possible in v9.x. Here's a good post that shows a rule doing what you're talking about:Click here
when CLIENT_ACCEPTED { if {([IP::addr "[IP::local_addr]/24" equals "10.0.35.0/24"]) and ([IP::addr "[IP::remote_addr]/24" equals "192.168.1.0/24"])} { use snatpool } else { use normal_pool } } Hope this helps. -Colin
- unRuleY_95363Historic F5 AccountThat's probably not quite what you want. Maybe something like this:
when CLIENT_ACCEPTED { if { not ([IP::addr [IP::remote_addr] equals "10.0.35.0/24"] and ([IP::addr [IP::local_addr] equals "192.168.1.0/24"] or [IP::addr [IP::local_addr] equals "172.16.1.0/24"] or [IP::addr [IP::local_addr] equals "10.0.1.0/24"])) } { snatpool mysnats } pool forwarding_pool }
- Dan_Williams_25
Nimbostratus
I appreciate the responses. - Dan_Williams_25
Nimbostratus
I see what you're rule is saying now. I'm going to give that a try. - Dan_Williams_25
Nimbostratus
Forgot the "breaking" part. Basically, connectivity between the nodes and the database begins to fail. In fact, it begins to fail for other nodes that are on other VLANs as well. - Dan_Williams_25
Nimbostratus
It's been a while, but I was finally able to catch up and try a few things out.
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