Forum Discussion
Christopher_Ach
Nimbostratus
Dec 16, 2008Can a Irule do this 0.0.0.0-->LB-->to one of 2 SNAT Pools
Hi
I have a incoming traffic stream that I want to SNAT.
I want to control the way I SNAT the traffic based on a defined ratio (60-40).
So I want to have 2 separat...
dennypayne
Employee
Dec 16, 2008This sounds do-able, I'm not sure of the best way to do the ratio but certainly you can use the snatpool command based on a decision that is made in the iRule logic of when to use each one.
My first thought is just a loop from 1 to 10 where the first 6 connections are sent to snatpool 1 and the rest to snatpool 2. Someone can probably think of a more efficient way to do that but here goes...
pseudocode:
when RULE_INIT {
set counter 0
}
when CLIENT_ACCEPTED {
if $counter < 6 {
snatpool pool-1
} else {
snatpool pool-2
}
increment $counter (not sure of the best syntax here)
if $counter > 9 {
set counter 0
}
}
Denny
EDIT: edited the code a bit...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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