F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

F5_LB_Eng's avatar
F5_LB_Eng
Icon for Cirrostratus rankCirrostratus
Jan 22, 2014

Need Irule to block traffic from certain IPs

Hi All,

 

Could some help me to get a irule to block traffic from certain IPs for a URL.

 

Regards Prasanna AR

 

3 Replies

  • Here is one example that only allows specific IP's/networks

     

    when CLIENT_ACCEPTED { set clientip [IP::client_addr] if { not ( [class match [IP::client_addr] equals Customer_Allowed_IP] ) } { reject log local0. "Client Source IP: $clientip has been denied access to: [IP::local_addr]:[TCP::local_port]" } }

     

  • Hi prasanna, something like this ?

    when HTTP_REQUEST {
    if {[IP::client_addr] eq "10.1.1.1"} {
    log locla0. "matching"
    }
    }
    
  • Thanks for your reply...

     

    i want to redirect to these IP address to sorry page URL...