Forum Discussion
paul_79097
Nimbostratus
Sep 14, 2009Unable to add a rule
hello there,
I am trying to add a rule to go to a specific node in a pool when specific ip address is connected.
when HTTP_REQUEST {
if {[IP::addr [IP::remote_addr] equals 216...
hoolio
Cirrostratus
Sep 14, 2009Posted By cmbhatt on 09/14/2009 12:18 PM
Looking at your logic the condition is if the client IP matches then go to a specific pool member, but then if the clients URI matches go to the other pool members. Is it possible that you meeting 2 conditions that is forcing it to another pool?
CB
CB, I'd guess you found the problem here. If the client check was done in CLIENT_ACCEPTED but then another condition in HTTP_REQUEST was met, the pool selection in CLIENT_ACCEPTED would be over-ridden.
Could you try something like this? You'll need to change 219.254.86.100 to the actual client IP you want. Also, it would be more efficient to use IP::addr to compare the IP address than a string comparison.
when CLIENT_ACCEPTED {
Select the pool member if the client IP is 219.254.86.100
if {[IP::addr [IP::client_addr] equals 219.254.86.100]} {
pool apache_webtier member 10.0.1.101:8080
set skip_event 1
}
}
when HTTP_REQUEST {
If the client IP check in CLIENT_ACCEPTED matched, then exit this event
if {[info exists skip_event]}{
return
}
Else, check the requested URI to select the pool
switch -glob [HTTP::uri] {
"*awstats/awstats.pl*" -
"*web01*" {
pool apache_webtier member 10.0.1.101:8080
}
"*web02*" {
pool apache_webtier member 10.0.1.100:8080
}
"*web03*" {
pool apache_webtier member 10.0.1.102:8080
}
default {
Take some default action like select the VIP's default pool?
}
}
}
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