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 would remove the quotes between the address
something like
[IP::addr [IP::client_addr] equals 219.254.86.x]
CB - The_Bhattman
Nimbostratus
Looking at your code again I see that there is nothing wrong with the synax that would not allow pools to be accessed.
Okay time for a really stupid question. The x in the post is really you removing for public viewing - meaning there is actually a forth octet, yes?
CB - paul_79097
Nimbostratus
Okay time for a really stupid question. The x in the post is really you removing for public viewing - meaning there is actually a forth octet, yes?
:-D YEP - The_Bhattman
Nimbostratus
I don't see how your irule sytax is failing you. Have you simplified your Irule so that it's forced to make one evaluationwhen CLIENT_ACCEPTED { if { [IP::client_addr] equals "219.254.86.x" } { log local0. "If you see this in the LTM logs then it has meet the conditional statement" pool apache_webtier member 10.0.1.101:8080 } }
CB - paul_79097
Nimbostratus
just tried that, without any HTTP_REQUEST - nothing ... - The_Bhattman
Nimbostratus
How about:when CLIENT_ACCEPTED { Log local0. "This is the Client IP: [IP::client_addr]" if { [IP::client_addr] equals "219.254.86.x" } { log local0. "If you see this in the LTM logs then it has meet the conditional statement" pool apache_webtier member 10.0.1.101:8080 } else { log local0. "if you see this in the LTM logs then it means you have not matched the conditional statement" }
CB - paul_79097
Nimbostratus
Thats nice, butttttaaaaa i'm working on a "live" env. and that would log every single user :-/ - paul_79097
Nimbostratus
interesting !
the outputClient IP: [IP::client_addr]
- The_Bhattman
Nimbostratus
Change out the braces with quoteswhen HTTP_REQUEST { if { [HTTP::uri] eq "/myinfo" } { HTTP::respond 200 Content " client info Client IP: [IP::client_addr] " } }
CB - paul_79097
Nimbostratus
works like a charm:
Client IP: 216.254.86.x
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