<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to block an IP in Linux</title>
	<atom:link href="http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html</link>
	<description>Java, ATG, Seam, and related Technologies</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:00:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mark</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-145392</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 26 Aug 2011 16:37:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-145392</guid>
		<description>Just wanted to add that on RedHat based systems, you can do that last little bit of saving the configuration for use on reboot just using the init scripts, i.e.

/etc/init.d/iptables save

which will save the current configuration to the file /etc/sysconfig/iptables, which is always used to restore on reboot.

i.e. the block script would be (either run as root or with a sudo command):

#!/bin/bash
iptables -I INPUT -s $1 -j DROP
/etc/init.d/iptables save

and then there is no need to do the equivalent of the line in the /etc/network/interfaces file (which doesn&#039;t exist in RedHat based systems).</description>
		<content:encoded><![CDATA[<p>Just wanted to add that on RedHat based systems, you can do that last little bit of saving the configuration for use on reboot just using the init scripts, i.e.</p>
<p>/etc/init.d/iptables save</p>
<p>which will save the current configuration to the file /etc/sysconfig/iptables, which is always used to restore on reboot.</p>
<p>i.e. the block script would be (either run as root or with a sudo command):</p>
<p>#!/bin/bash<br />
iptables -I INPUT -s $1 -j DROP<br />
/etc/init.d/iptables save</p>
<p>and then there is no need to do the equivalent of the line in the /etc/network/interfaces file (which doesn&#8217;t exist in RedHat based systems).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-97063</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 15 Feb 2011 01:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-97063</guid>
		<description>Works for me.  Just what I was looking for.</description>
		<content:encoded><![CDATA[<p>Works for me.  Just what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-83642</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Wed, 15 Dec 2010 11:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-83642</guid>
		<description>Qoalu,

If you have not already figured this out, ensure that you made the script executable: chmod 755 ./block</description>
		<content:encoded><![CDATA[<p>Qoalu,</p>
<p>If you have not already figured this out, ensure that you made the script executable: chmod 755 ./block</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devon</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-64433</link>
		<dc:creator>Devon</dc:creator>
		<pubDate>Tue, 03 Aug 2010 13:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-64433</guid>
		<description>Qoalu,

you created the &quot;block&quot; file and it&#039;s contents are the shell script at the top of this post?  Are you sure it&#039;s not working?  The iptables commands should take effect immediately when called manually or via my script above.  If you add the iptables command to the interfaces file you will need to bounce the interface, or you can just run the command yourself manually.

Devon</description>
		<content:encoded><![CDATA[<p>Qoalu,</p>
<p>you created the &#8220;block&#8221; file and it&#8217;s contents are the shell script at the top of this post?  Are you sure it&#8217;s not working?  The iptables commands should take effect immediately when called manually or via my script above.  If you add the iptables command to the interfaces file you will need to bounce the interface, or you can just run the command yourself manually.</p>
<p>Devon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Qoalu</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-64324</link>
		<dc:creator>Qoalu</dc:creator>
		<pubDate>Mon, 02 Aug 2010 11:23:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-64324</guid>
		<description>Hallo,

I created a file in /home called block, ran it with &quot;block X.X.X.X&quot; and &quot;./block X.X.X.X&quot;. Neither works. What am I doing wrong.

Let&#039;s say I add the ip manually to the /etc/network/interfaces like this:

iptables -A INPUT -s X.X.X.X -j DROP 


When will the directive activate, do I need to restart the interfaces?

Regards, Qoalu.</description>
		<content:encoded><![CDATA[<p>Hallo,</p>
<p>I created a file in /home called block, ran it with &#8220;block X.X.X.X&#8221; and &#8220;./block X.X.X.X&#8221;. Neither works. What am I doing wrong.</p>
<p>Let&#8217;s say I add the ip manually to the /etc/network/interfaces like this:</p>
<p>iptables -A INPUT -s X.X.X.X -j DROP </p>
<p>When will the directive activate, do I need to restart the interfaces?</p>
<p>Regards, Qoalu.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JD</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-62008</link>
		<dc:creator>JD</dc:creator>
		<pubDate>Thu, 01 Jul 2010 21:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-62008</guid>
		<description>Thanks for the quick reply! 
Sorry, I was reading many of your articles and ended up posting that comment on the wrong article; it was meant for &quot;Using IPTables to Prevent SSH Brute Force Attacks&quot;.

Please delete it if you wish, I&#039;ll repost in the correct one if that is Ok.

Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks for the quick reply!<br />
Sorry, I was reading many of your articles and ended up posting that comment on the wrong article; it was meant for &#8220;Using IPTables to Prevent SSH Brute Force Attacks&#8221;.</p>
<p>Please delete it if you wish, I&#8217;ll repost in the correct one if that is Ok.</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devon</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-62003</link>
		<dc:creator>Devon</dc:creator>
		<pubDate>Thu, 01 Jul 2010 21:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-62003</guid>
		<description>If you use this method all of the blocked IPs end up in this file: /etc/network/iptables.save so you can easily see them.  If you&#039;re asking more generally how to get firewall/iptables log entries segregated into their own log then I recommend using syslog-ng and setting things up a bit like this:

.....
destination firewall { file(&quot;/var/log/firewall.log&quot;); };
 ......
filter f_firewall { match(&quot;Firewall&quot;); };
......
filter f_kernel     { facility(kern) and not filter(f_firewall); };
......
log { 
    source(s_sys); 
    filter(f_firewall); 
    destination(firewall); 
};</description>
		<content:encoded><![CDATA[<p>If you use this method all of the blocked IPs end up in this file: /etc/network/iptables.save so you can easily see them.  If you&#8217;re asking more generally how to get firewall/iptables log entries segregated into their own log then I recommend using syslog-ng and setting things up a bit like this:</p>
<p>&#8230;..<br />
destination firewall { file(&#8220;/var/log/firewall.log&#8221;); };<br />
 &#8230;&#8230;<br />
filter f_firewall { match(&#8220;Firewall&#8221;); };<br />
&#8230;&#8230;<br />
filter f_kernel     { facility(kern) and not filter(f_firewall); };<br />
&#8230;&#8230;<br />
log {<br />
    source(s_sys);<br />
    filter(f_firewall);<br />
    destination(firewall);<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jd</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-62001</link>
		<dc:creator>jd</dc:creator>
		<pubDate>Thu, 01 Jul 2010 21:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-62001</guid>
		<description>How would you go about adding these blocks to a separate log file? Say /var/log/iptables.log.

Thanks.</description>
		<content:encoded><![CDATA[<p>How would you go about adding these blocks to a separate log file? Say /var/log/iptables.log.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rhalff</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-46088</link>
		<dc:creator>rhalff</dc:creator>
		<pubDate>Thu, 17 Sep 2009 13:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-46088</guid>
		<description>Apparently you can also do something like:

ip ro add blackhole 87.106.97.229</description>
		<content:encoded><![CDATA[<p>Apparently you can also do something like:</p>
<p>ip ro add blackhole 87.106.97.229</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Using IPTables to Prevent SSH Brute Force Attacks &#124; Devon Hillard Tech Blog</title>
		<link>http://www.digitalsanctuary.com/tech-blog/debian/how-to-block-an-ip-in-linux.html/comment-page-1#comment-6165</link>
		<dc:creator>Using IPTables to Prevent SSH Brute Force Attacks &#124; Devon Hillard Tech Blog</dc:creator>
		<pubDate>Sun, 25 May 2008 06:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/security/how-to-block-an-ip-in-linux.html#comment-6165</guid>
		<description>[...] also recommend using the script in my post on blocking IP addresses using iptables to deal with any persistent folks, or people poking too hard on your web site, or other [...]</description>
		<content:encoded><![CDATA[<p>[...] also recommend using the script in my post on blocking IP addresses using iptables to deal with any persistent folks, or people poking too hard on your web site, or other [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/24 queries in 0.005 seconds using disk: basic
Object Caching 373/394 objects using disk: basic

Served from: www.digitalsanctuary.com @ 2012-02-08 05:52:10 -->
