Forum Discussion

Jason_19901's avatar
Icon for Nimbostratus rankNimbostratus
Apr 05, 2011

iRule Help

I am trying to create an iRule to look at the URI and then based on IP address, either allow or deny. Any help would be great!





5 Replies

  • Is this something like what you're looking to do?


  • Sorry 'bout that. Teaches me to watch what window I'm in when cutting and pasting. Try this one:





    The final iRule described here seems close. If this isn't it, let me know.
  • so that rule will be able to say...if coming from Remote IP, do not allow and if the IP is NOT REMOTE, allow...correct? what is the DEBUG for? what is the HTTP:PATH used for? sorry for the to iRules
  • Yes, the example that Joel points you to is pretty close to what I understand that you need.

    It does implement Data Groups to allow for multiple IP Addresses, etc.

    Here is a static example. Perhaps you can combine pieces of the two to get exactly what you are needing.

    when HTTP_REQUEST {
       if { [[string tolower [HTTP::uri]] starts_with "/website/login.aspx" ] and [IP::addr [IP::client_addr] equals ""] } {
       else {