User Tools

Site Tools


networking:firewall:block_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:firewall:block_host [2013/09/12 14:16]
gcooper
networking:firewall:block_host [2018/01/15 12:13] (current)
gcooper
Line 1: Line 1:
 ====== Block Traffic From a Particular Host ====== ====== Block Traffic From a Particular Host ======
 +
 +See also **[[networking:router:mikrotik_manual_blacklist|Manually Add and Remove IP Addresses to a Mikrotik Blacklist]]**
  
 :!: You can use ''DROP'' or ''REJECT'' depending on what you want the blocked host to know. :!: You can use ''DROP'' or ''REJECT'' depending on what you want the blocked host to know.
  
 <file> <file>
-iptables -I INPUT -s 66.184.141.132 -j DROP+iptables -I INPUT -s nnn.nnn.nnn.nnn -j DROP
 </file> </file>
  
Line 10: Line 12:
  
 <file> <file>
-iptables -D INPUT -s 66.184.141.132 -j DROP+iptables -D INPUT -s nnn.nnn.nnn.nnn -j DROP
 </file> </file>
  
Line 22: Line 24:
  
 <file> <file>
-for ip in `grep Itau.com.br /var/log/httpd/error_log|egrep -o "client [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"|sort |uniq|cut -f 2 -d " "`; do iptables -I INPUT -s $ip -j DROP; done+for ip in `grep spammer.com.br /var/log/httpd/error_log|egrep -o "client [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"|sort |uniq|cut -f 2 -d " "`; do iptables -I INPUT -s $ip -j DROP; done
 </file> </file>
  
networking/firewall/block_host.1379017002.txt.gz · Last modified: 2013/09/12 14:16 by gcooper