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.254.x.x]} {
pool poolname member 10.1.0.101
}
}
for some reason it doesn't work :-/
26 Replies
- The_Bhattman
Nimbostratus
I believe you are missing a port
pool poolname member
CB - paul_79097
Nimbostratus
tried doing
when CLIENT_ACCEPTED {
if { [IP::remote_addr] equals "216.254.x.x" } {
pool poolname member 10.1.0.101
}
}
nothing .... same thing
even tho i tried log local0.info and it shows "216.254.x.x" inside the log - The_Bhattman
Nimbostratus
What kind of error are you receiving?
CB - paul_79097
Nimbostratus
actually there is no error
the irule is executed just fine - The_Bhattman
Nimbostratus
Did you perfom a tcpdump to see if the packet was leaving the F5 towards the server?
CB - paul_79097
Nimbostratus
the thing is, everything is working just fine because I have other rules inside " when HTTP_REQUEST "
and they r working just fine
it seems like the problem lies in if { [IP::remote_addr] equals "216.254.x.x" } {
but once again i logged [IP::remote_addr] inside the local0.info and it shows "216.254.x.x" so for some weird reason that if fails maybe i need to make sure [IP::remote_addr] is actually a "string" ? - The_Bhattman
Nimbostratus
Can you post the entire irule?
CB - paul_79097
Nimbostratus
when CLIENT_ACCEPTED {
if { [IP::client_addr] equals "219.254.86.x" } {
pool apache_webtier member 10.0.1.101:8080
}
}
when HTTP_REQUEST {
if { [HTTP::uri] contains "awstats/awstats.pl" } {
pool apache_webtier member 10.0.1.100:8080
}
if { [HTTP::uri] contains "web01" } {
pool apache_webtier member 10.0.1.101:8080
}
if { [HTTP::uri] contains "web03" } {
pool apache_webtier member 10.0.1.102:8080
}
if { [HTTP::uri] contains "web02" } {
pool apache_webtier member 10.0.1.100:8080
}
} - The_Bhattman
Nimbostratus
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 - paul_79097
Nimbostratus
i was thinking the same thing but first of all, the HTTP_REQUEST won't match in my case and second i added a log in side the
if { [IP::client_addr] equals "219.254.86.x" } {
set client "[IP::client_addr]"
log local0.info " huh $client"
pool apache_webtier member 10.0.1.101:8080
}
and nothing shows in the log
the funny thing is if i make that special REQUEST and match one of those conditions and have that log statement inside it - it will log the ip just fine and it would be the one i need :-/
this is driving me crazy
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