Forum Discussion
Pankaj_70057
Jan 26, 2012Nimbostratus
To block some specific traffic from F5 for specific virtual directory
Here is the our requirement so if possible can you send me actual iRule to fulfill this requirement. Site: https://www.xyz.com/bac Allowed below host: 174.26.53.0/24 172.56.36.2 175.63.54.0/24 Block: ...
hooleylist
Jan 26, 2012Cirrostratus
Hi Pankaj,
You can try to implement this type of logic in an iRule, but it may be simple to bypass:
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=30900
That said, here is an example that could provide some protection. First, create an address data group containing the hosts and networks which can access /bac*. Then use an iRule like this which references a data group named allowed_hosts_dg:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/bac*" {
if {not [class match [IP::client_addr] equals allowed_hosts_dg]}{
HTTP::respond 403 content {Blocked!}
}
}
}
}
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