Forum Discussion
Apr 29, 2010
Persist only specific IPs destined for a VS
I'm looking to limit persistence to specifc IPs destined for a VS and load balance everyone else with the default LB metric assigned to the Pool. I see I can only apply a mask in the standard Source addresss profile..An error has occurred.Error: is currently unavailable." Thanks!
I was thinking of using matchclass and holding the IPs in a defined class/datagroup, use the persist command, else LB to the pool specified..
Issues ideas gotchas?
On a side note, I'm haveing issues searching the forum for more than one word, when I search for; persistence limited by ip
I get;
"
- Michael_Yates
Nimbostratus
I believe that this is the general iRule structure that you will probably need, but I'm not sure exactly what you are looking for with the description that you have given, so I have included other options that are commented out.when CLIENT_ACCEPTED { if { ([matchclass [IP::remote_addr] equals $::TestDataGroup ]) } { persist cookie insert Specific Pool pool Your.Pool.Name Specific Pool and Specific Pool Member pool Your.Pool.Name member 10.10.10.10 80 } }
- Cool, that's where I was going with it. Do you know if "if" is a cleaner way to do this vs setting the variable "hostip"? Setting the host variable leave the option to do something else with the info in the future..
- Michael_Yates
Nimbostratus
It should be more efficient to do a qualifying compare and an action if it meets your criteria.when CLIENT_ACCEPTED { if { ([matchclass [IP::remote_addr] equals $::TestDataGroup ]) } { persist source_addr 28800 } }
- Gotcha, so it will always default to the pool applied to the virtual server, correct?
- Tested and yes it defaults to the pool attached to the VS, and no if there's an else you don't need to specifiy the pool after the command above.
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