CodeGrabber
{ USER }
posts: 23
last: 28-Apr-2008
|
| TITLE: |
Quick and Dirty Host Blocking in Linux |
| DESCRIPTION: |
Very simple hosting block technique |
| Submitted: |
28-Apr-2008 00:47:58 ( 19w 0d 10h ago ) |
Language: |
BASH (*.sh) |
| Views: |
216 |
Lines of Code: |
10 LINES |
| Rating: |
 ( rated! )
{ 0.00 / 5 }
|
Difficulty: |
Intermediate |
|
If you are being attacked or abused by a particular host, just enter the following command to deny all access to the host:
/sbin/route add -host reject
Replace with the IP address of the host you want to block. The address will stay blocked until you bounce the interface. Alternatively, you could allow access by:
/sbin/route del -host reject
For a more permanent rejection, of course, use your firewall. If you really want this to persist, add the command to rc.local or whatever your favorite is.