Forum Discussion

edel1826_339422's avatar
edel1826_339422
Icon for Nimbostratus rankNimbostratus
Nov 01, 2017
Solved

iRule - Restricting IP addresses for a portion of URI

This iRule was originally meant to Allow only the IP addresses within the specified Data Group when visiting URI containing "/DEVCENTRAL". Every other IP not in the Data Group would get a 403 - Forb...
  • Gonzalex_330537's avatar
    Nov 01, 2017

    So basically you need to allow access to all uri containing "devcentral" word, from specific IPs only, unless "/devcentral/site/test", in which case, access should be allowed to all IPs.

     

    I think there are few ways. One possibility is:

     

    A :: the uri contains "devcentral"

     

    B :: the uri is different from "/devcentral/site/test"

     

    C :: the client IP does not match the IP list

     

     

    if [(A && B) && C] {

     

    403 deny access

     

    }