Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Block IP

From Tech-Wiki


Technical reference for Block IP.

Reference

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)

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

Or

when CLIENT_ACCEPTED {
   if { not ( [class match [IP::client_addr] equals SMTP-Relay_Data-Group] ) } {
       reject
   }
}

Same using static IP hard coded:

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

See also