Forum Discussion
sys-team_172267
Mar 10, 2016Nimbostratus
Blocking specific "USER AGENT" version and lower by iRule
Hello,
i want to use iRule to block requests that contain some "USER AGENT" version and lower("=<").
how can i do it?
Thanks.
Kai_Wilke
Mar 11, 2016MVP
Hi Sys-team,
I'm afraid, you can't block user-agents by using a "version < X" syntax. You have to block them one-by-one by using
-glob
wildcard matches.
Example to block Internet Explorer below v11:
when HTTP_REQUEST {
switch -glob -- [HTTP::header value "User-Agent"] "*MSIE 2*" - "*MSIE 3*" - "*MSIE 4*" - "*MSIE 5*" - "*MSIE 6*" - "*MSIE 7*" - "*MSIE 8*" - "*MSIE 9*" - "*MSIE 10*" {
HTTP::respond 200 content "Unsupported Brwoser"
}
}
Note: A great source for user-agent string values can be found here... http://www.useragentstring.com/pages/useragentstring.php
Cheers, Kai
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