Forum Discussion
D_Tech_19468
Nimbostratus
Jul 01, 2013changing SNAT pool every week by iRule
Hi All,
Would like to check is there any way to write an iRule about this.
- Require to change snatpool every week - Wednesday
- After Wednesday, the server will stick to the ne...
Kevin_Stewart
Employee
Jul 03, 2013I didn't ~exactly write it to your specifications. ;) The above iRule is based on weeks of the year (1-52). The "%W" means the week of the year starting on Monday, so every Monday the value would cycle (next week). We'll take the modulus 4 of that number to get a value between 0 and 3. Example:
Week = Value
1 = 1
2 = 2
3 = 3
4 = 0
5 = 1
6 = 2
...
50 = 2
51 = 3
52 = 0
A few additional points:
1. This runs on every client request (CLIENT_ACCEPTED or HTTP_REQUEST). Also consider that at midnight on Sunday, should someone be in an active session, the snat/snatpool would change. I'm not 100% certain what the affect of that would be mid-session.
2. This is a VIP-global setting, so when you say "server A using using snatpool A", understand that the snat/snatpool is applied to all servers in the pool.
3. It's still possible to get it to rotate on a Wednesday, but would require a little extra work.
4. Because this calculation is triggered on every client request, you may not want to log all of that.
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