Forum Discussion
gwrotterdam_347
Nimbostratus
Sep 18, 2009Data group to default pool instead of specified pool
Hi,
I've got the following code to redirect IP's who are not in the 'SysOp' datagroup to google.com
when HTTP_REQUEST {
if { [matchclass [IP::client_addr] equals $::SysOp] }{
...
hoolio
Cirrostratus
Sep 18, 2009Hi,
[LB::server pool] (Click here) will return the currently selected pool name. At the beginning of the TCP connection this will return the default pool on the virtual server. If you change the pool to a different pool at some point for a TCP connection, [LB::server pool] will return that pool name. So you can save the VIP's default pool in CLIENT_ACCEPTED, before it's been changed and then reference that later in the iRule. If you're never selecting a different pool, you probably don't need to save the name, but I think it's a good practice anyhow.
when CLIENT_ACCEPTED {
Save the VIP's default pool name
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [matchclass [IP::client_addr] equals $::SysOp] }{
pool $default_pool
} else {
HTTP::redirect "http://www.google.com/"
}
}
Aaron
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
