Forum Discussion

mbamusa_59409's avatar
Icon for Nimbostratus rankNimbostratus
Nov 02, 2010

packet filter based on URL




i have a web site published over the internet (ie i want to prevent access to some suburl (ie. this website to be accessed from outside how could i acheve this using eaither packet filtering or irule .



thank you .


3 Replies

  • Here's an iRule to accomplish it.

    when HTTP_REQUEST {
       if { [HTTP::host] eq "" 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.
  • hi chris



    thank you for your kind replay




    let's assume that 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 and it's like ?



  • This should work.

    when HTTP_REQUEST {
       if { [HTTP::host] eq "" and ![IP::addr [IP::client_addr]/24 eq] } {
         discard }}

    Let me know if it doesn't.