Forum Discussion
TMcGov_92811
Nimbostratus
Jan 23, 2009Using matchclass to check Source IP with HTTP_REQUEST?
F5 Posting
Hi,
With this iRule I am hoping to direct certain Source IP addresses to Pool-A while directing other HTTP Requests based on URIs to other pools. The syntax is...
hoolio
Cirrostratus
Jan 26, 2009If you aren't and don't plan to add other iRules to this VIP, you could replace the pool_selected variable logic and just disable the HTTP_REQUEST event for clients who are in the datagroup. This would apply to all iRules on the VIP though.
when CLIENT_ACCEPTED {
Check if the client IP is in the testips datagroup
if { [matchclass [IP::client_addr] equals $::testips] } {
Select poolA
pool poolA
Disable the HTTP_REQUEST event for this TCP connection as it isn't needed
event HTTP_REQUEST disable
}
}
when HTTP_REQUEST {
Check the requested path
switch -glob [HTTP::path] {
"*/cf/*" -
"*/hf/*" {
pool poolB
}
"*/asweb/* {
pool poolC
}
"*/vh/* {
pool poolD
}
default {
pool poolE
}
}
}
Aaron
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