Block IP

From Tech-Wiki
Revision as of 17:20, 28 March 2021 by Fabricio.Lima (Talk | contribs)

Jump to: navigation, search

Back to iRules

In order to block (or allow) connections based on static IP, or a data group, first, create a data group of type IP addr then use the code below (use 'not' if you want to allow instead)

if { [class match [IP::remote_addr] equals ip_blacklist] } { 
   reject
}

Or

when CLIENT_ACCEPTED {
   if { [IP::addr [IP::client_addr] equals xx.xx.xx.xx/xx] } {
       reject
   }
}