Forum Discussion
SNat iRule based on destination address
Hi All,
I would like to create snat iRule based on the destination IP address. I have VS with 3 pool members. If request hits first 2 pool members then do not SNAT & If destination hits 3rd pool member then SNAT is required.
Could any one please help me to script an iRule for above requirement.
Regards, Mahantesh
6 Replies
- arpydays
Nimbostratus
try this,
when LB_SELECTED { if { not [IP::addr [LB::server addr] equals 10.0.0.1] } { snat none } } - Mahantesh_Bisur
Nimbostratus
Thanks arpdays for the reply. So above iRule has been written assuming that 10.0.0.1 is the 3rd pool member ? Correct me If I am wrong.. I will check on this & let you know.
Regards, Mahantesh
- arpydays
Nimbostratus
Yes, also assumes SNAT is configured on VS
cheers
- Mahantesh_Bisur
Nimbostratus
@arpdays,
whether below iRule will work without SNAT on VS ?
when LB_SELECTED { if { not [IP::addr [LB::server addr] equals 10.0.0.1] } { snat none } else { snatpool xyz.com } }
- arpydays
Nimbostratus
should do, although this may be simpler,
when LB_SELECTED { if { [IP::addr [LB::server addr] equals 10.0.0.1] } { snatpool xyz.com } } - Mahantesh_Bisur
Nimbostratus
OK Thanks arpydays for the response. I will check on this & will update you.
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