Forum Discussion
Vince_Beltz_959
Nimbostratus
Oct 22, 2009Drop Doesn't
I've implemented the following iRule to filter out certain user agents from connecting to our servers. Testing with Firefox and the Modify Headers add-on, it seems to work - I get a disconnected messa...
hoolio
Cirrostratus
Oct 23, 2009Those logs show that the iRule appears to be working. On the TCP connection from client port 38440, the client makes a request with a legal UA and is redirected. On the same TCP connection, the UA changes to Azuerus and the connection is closed. Did the server get an HTTP request from the "Azureus" client? Did the "Azureus" client get a response or just a TCP close?
The rest of the logs seem to indicate that any restricted UA request is closed successfully.
If it's not working, you could add more debug logging to show the server connection and request being sent:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri] with UA [HTTP::header User-Agent]"
switch -glob [string tolower [HTTP::header "User-Agent"]] {
"*torrent*" -
"*azureus*" -
"*windows-media-player*" -
"*microsoft-webdav-miniredir*" {
log local0. "[IP::client_addr]:[TCP::client_port]: Matched UA check. Closing TCP connection."
TCP::close
}
default {
log local0. "[IP::client_addr]:[TCP::client_port]: UA check didn't match, redirecting."
HTTP::redirect http://targetsite.tld
}
}
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port]: connection to [IP::server_addr]:[TCP::server_port]"
}
when HTTP_REQUEST_SEND {
clientside {
log local0. "[IP::client_addr]:[TCP::client_port]: UA [HTTP::header User-Agent], request to [HTTP::uri]"
}
}
Thanks,
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
