Forum Discussion
SNAT
I am looking for a irule that will map the source address of specific machines. The situation is that I am load balancing using a pool / VS on my LTM . I need to ensure that ALL machines even if they are on the same subnet) get routed through the LTM. So simply stated I want to use auto map for 1 subnet which all the nodes / pool members are on and all other connections wont use auto map.
5 Replies
- nathe
Cirrocumulus
So, on the VS don't have an option for Source Address Translation and then an irule like this might do the trick:
when CLIENT_ACCEPTED { Check if client is in same subnet as pool members if {[IP::addr [IP::client_addr] equals x.x.x.x/x]}{ Use snat automap snat automap } }Change x.x.x.x/x to the relevant subnet and any source IP on this range will use SNAT automap. If not then no SNATing will be done.
Hope this helps,
N
- pedinopa_170325
Nimbostratus
I added the irule (changed x.x.x.x/x to ip subnet) and attached it to the virtual server. It does not appeaar to be working?
- nathe
Cirrocumulus
Hmmm. Check out this wiki. Has an example just like your scenario using LB_SELECTED event. https://clouddocs.f5.com/api/irules/SelectiveSNAT.html
- pedinopa_170325
Nimbostratus
that worked great thank you
- nathe
Cirrocumulus
No probs. Glad I could help.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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