Forum Discussion
mbamusa_59409
Nimbostratus
Nov 02, 2010packet filter based on URL
HI ALL ,
i have a web site published over the internet (ie www.mysite.com)and i want to prevent access to some suburl (ie. www.mysite.com/admin)for this website to be accessed from outside how could i acheve this using eaither packet filtering or irule .
thank you .
3 Replies
- Chris_Miller
Altostratus
Here's an iRule to accomplish it.when HTTP_REQUEST { if { [HTTP::host] eq "www.mysite.com" and [HTTP::uri] starts_with "/admin" and ![class match [IP::client_addr] eq inside_addresses] } { discard }}
This requires that you create an address-type "datagroup" containing the IPs you want to allow. Let me know if you have any issues. - mbamusa_59409
Nimbostratus
hi chris
thank you for your kind replay
let's assume that 192.168.1.0/24 is the subnet which i want them to access the link and discard evrey thing else who we could write this ?
and what if the link is not like www.mysite.com/admin and it's like www.admin.mysite.com ?
regards - Chris_Miller
Altostratus
This should work.when HTTP_REQUEST { if { [HTTP::host] eq "www.admin.mysite.com" and ![IP::addr [IP::client_addr]/24 eq 192.168.1.0] } { discard }}
Let me know if it doesn't.
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