DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Ban IPs From A Server

  • submit to reddit
        Use the code below to permanently ban an IP address from accessing your server.

iptables -A INPUT -s ip.address -j DROP


Snippets Manager replied on Wed, 2009/02/25 - 9:47am

To block a range of ip addresses using iptables, use the following: iptables -I INPUT -m iprange --src-range - -j DROP example: iptables -I INPUT -m iprange --src-range -j DROP