Forum Discussion

Birama_SY's avatar
Birama_SY
Icon for Nimbostratus rankNimbostratus
Jul 05, 2019

iRule for Whitelist basepath

He guys,

I am new on F5 BIG-IP.

I want to allow the url: https://test.biranetworxx.com/* and restrict the basepath https://test.biranetworxx.com/provider/test* for only one IP.

 

https://test.biranetworxx.com/* must be avail for all

https://test.biranetworxx.com//provider/test* must be avail only for a single IP 185.XX.XX.120

 

Could you please advice.

 

I tried to do that with ltm policy but the restriction is not applied. And I can 't see the problem.

 

 

Thanking you for your time and response

 

regards

  • when HTTP_REQUEST {
        set uristring [string tolower [HTTP::uri]]
     
        switch  $uritring {
            "/test/blockeduri/" { 
                if { [IP::client_addr] equals x.x.x.x } {
                    #allowed ip
                } else {
                    #blocked - wrong IP
                     drop
                }
        }
        default {}
        }
    }
     

    Should be something along these lines. Though if you have several IP adresses to whitelist I recommend doing it as a data-group.

    • Birama_SY's avatar
      Birama_SY
      Icon for Nimbostratus rankNimbostratus
      Dear Heino Thank you very much for your Time. I will apply it and keep you informed Best regards Birama SY