<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iptables &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="http://lifelinux.com/tag/iptables/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:39:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.9</generator>
	<item>
		<title>How Do I Block An IP Address On Linux Server ?</title>
		<link>http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/</link>
					<comments>http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Tue, 31 Jan 2012 11:06:46 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[block ip iptables]]></category>
		<category><![CDATA[block ip linux]]></category>
		<category><![CDATA[block ip unix]]></category>
		<category><![CDATA[block ip via iptables]]></category>
		<category><![CDATA[block ip with iptables]]></category>
		<category><![CDATA[destination port]]></category>
		<category><![CDATA[firewall script]]></category>
		<category><![CDATA[interface name]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[ip subnet]]></category>
		<category><![CDATA[ip table blocking]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[iptables firewall]]></category>
		<category><![CDATA[iptables-restore command]]></category>
		<category><![CDATA[iptables-save]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux block ip]]></category>
		<category><![CDATA[linux block ip address]]></category>
		<category><![CDATA[linux command to block ip]]></category>
		<category><![CDATA[linux drop ip address]]></category>
		<category><![CDATA[linux server]]></category>
		<category><![CDATA[linux server how to block ip/user]]></category>
		<category><![CDATA[log target]]></category>
		<category><![CDATA[public interface]]></category>
		<category><![CDATA[sbin]]></category>
		<category><![CDATA[server port]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[session block]]></category>
		<category><![CDATA[spoof]]></category>
		<category><![CDATA[syntax]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1326</guid>

					<description><![CDATA[<p>I run CentOS on my server, and I often find that my server is being attacked by other computers. Brute force SSH attacks, port scanning, viruses scanning for the ability to spread, things like that. In this article, I&#8217;ll show you how to block an IP address on Linux server using IPTables. The First, I&#8217;ll [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/">How Do I Block An IP Address On Linux Server ?</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>I run CentOS on my server, and I often find that my server is being attacked by other computers. Brute force SSH attacks, port scanning, viruses scanning for the ability to spread, things like that. In this article, I&#8217;ll show you how to block an IP address on Linux server using IPTables.<br />
<span id="more-1326"></span><br />
The First, I&#8217;ll assume you are already using iptables. If you need help setting that up, read <a href="http://www.lifelinux.com/how-to-install-iptables-on-redhat-centos-linux/">this article</a>.</p>
<h2>How do I block an IP address ?</h2>
<p>Example I want to block incoming request from IP <span style="color: #ff0000;">1.2.3.4</span>, login as root and type the following command</p>
<pre># iptables -I INPUT -s <span style="color: #ff0000;">1.2.3.4</span> -j DROP</pre>
<p><strong>Where,</strong><br />
&#8211; I: Inserts the chain at the top of the rules.<br />
&#8211; s: Match source IP address.<br />
&#8211; j: Jump to the specified target chain when the packet matches the current rule.</p>
<p>To drop packets coming in on interface eth0 from <span style="color: #ff0000;">1.2.3.4</span>, type the following command</p>
<pre># iptables -I INPUT -i eth0 -s <span style="color: #ff0000;">1.2.3.4</span> -j DROP</pre>
<h2>How do I block a subnet ?</h2>
<p>Use the following syntax to block <span style="color: #ff0000;">10.0.0.0/8</span></p>
<pre># iptables -I INPUT -s <span style="color: #ff0000;">10.0.0.0/8</span> -j DROP</pre>
<h2>How do I save blocked IP address ?</h2>
<p>To save blocked IP address to iptables config file, type the following command</p>
<pre># service iptables save</pre>
<p>Or</p>
<pre># /etc/init.d/iptables save</pre>
<h2>How Do I Unblock An IP Address?</h2>
<p>First, you need to display blocked IP address along with line number and other information, type the following command</p>
<pre># iptables -L INPUT -n --line-numbers
# iptables -L INPUT -n --line-numbers | grep 1.2.3.4</pre>
<p>Sample outputs:</p>
<pre>Chain INPUT (policy DROP)
num  target     prot opt source               destination
1    DROP       all  --  1.2.3.4              0.0.0.0/0
2    LOCALINPUT  all  --  0.0.0.0/0            0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
4    ACCEPT     udp  --  203.162.4.1          0.0.0.0/0           udp spts:1024:65535 dpt:53</pre>
<p>To unblock 1.2.3.4 you must delete line number 1, enter:</p>
<pre># iptables -D INPUT 1</pre>
<g:plusone href="http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/">How Do I Block An IP Address On Linux Server ?</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-do-i-block-an-ip-address-on-linux-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Flush/Remove All Iptables Rules In Linux</title>
		<link>http://lifelinux.com/how-to-flushremove-all-iptables-rules/</link>
					<comments>http://lifelinux.com/how-to-flushremove-all-iptables-rules/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 19 May 2011 02:50:58 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[centos linux]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[fedora core]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[flush firewall]]></category>
		<category><![CDATA[gnu linux]]></category>
		<category><![CDATA[init script]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[stop firewall]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=633</guid>

					<description><![CDATA[<p>By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. Type the following command to see its # cat /etc/sysconfig/iptables Or # iptables -L Temporarily delete all the firewall rules At first, create flush.iptables script with following command # vi flush.iptables Add the following content #!/bin/sh iptables -F iptables -X iptables -t nat -F iptables [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-flushremove-all-iptables-rules/">How To Flush/Remove All Iptables Rules In Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. Type the following command to see its</p>
<pre>
# cat /etc/sysconfig/iptables
</pre>
<p><span id="more-633"></span><br />
Or </p>
<pre>
# iptables -L
</pre>
<h3>Temporarily delete all the firewall rules</h3>
<p>At first, create flush.iptables script with following command</p>
<pre>
# vi flush.iptables
</pre>
<p>Add the following content</p>
<pre>
#!/bin/sh
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
</pre>
<p>Finally, run flush.iptables script with the following command</p>
<pre>
# sh flush.iptables
</pre>
<p>After running flush.iptables script, if you restart the iptables, you&#8217;ll see all the default rules again. So, flush is only temporary.</p>
<h3>Permanently remove all the default firewall rules</h3>
<p>Step 1. Flush all these rules temporarily, as we discussed above.<br />
Step 2. Saving firewall rules to /etc/sysconfig/iptables. Type the following command</p>
<pre>
# /etc/init.d/iptables save
</pre>
<p>Or</p>
<pre>
# iptables-save > /etc/sysconfig/iptables
</pre>
<g:plusone href="http://lifelinux.com/how-to-flushremove-all-iptables-rules/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-flushremove-all-iptables-rules/">How To Flush/Remove All Iptables Rules In Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-flushremove-all-iptables-rules/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Save/Restore Iptables Rules</title>
		<link>http://lifelinux.com/how-to-saverestore-iptables-rules/</link>
					<comments>http://lifelinux.com/how-to-saverestore-iptables-rules/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 18 May 2011 05:49:46 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[iptables-restore command]]></category>
		<category><![CDATA[iptables-save command]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux server]]></category>
		<category><![CDATA[ubuntu iptables]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>
		<category><![CDATA[ubuntu save firewall]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=598</guid>

					<description><![CDATA[<p>Save Iptables rules Rules created with the iptables command are stored in memory. If the system is restarted before saving the iptables rule set, all rules are lost. To save netfilter rules, type the following command as root: # /etc/init.d/iptables save If you are using IPv6, enter: # /etc/init.d/ip6tables save The above commands will write [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-saverestore-iptables-rules/">How To Save/Restore Iptables Rules</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><h3>Save Iptables rules</h3>
<p>Rules created with the <strong>iptables</strong> command are stored in memory. If the system is restarted before saving the iptables rule set, all rules are lost. To save netfilter rules, type the following command as root:</p>
<pre>
# /etc/init.d/iptables save 
</pre>
<p><span id="more-598"></span><br />
If you are using IPv6, enter:</p>
<pre>
# /etc/init.d/ip6tables save 
</pre>
<p>The above commands will write the current iptables configuration to <strong>/etc/sysconfig/iptables</strong>. The next time the system boots, the iptables init script reapplies the rules saved in /etc/sysconfig/iptables. You can also save the iptables rules to a separate file for distribution, backup or other purposes. Type the following command as root</p>
<pre>
# iptables-save > /root/iptables.rules
</pre>
<p>If you are using IPv6, enter:</p>
<pre>
# ip6tables-save  > /root/iptables.rules
</pre>
<h3>Restore Iptables rules</h3>
<p>To restore it use the command iptables-restore, type the following command as root:</p>
<pre>
# iptables-restore < /root/iptables.rules
</pre>
<p>If you are using IPv6, enter:</p>
<pre>
# ip6tables-restore < /root/iptables.rules
</pre>
<g:plusone href="http://lifelinux.com/how-to-saverestore-iptables-rules/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-saverestore-iptables-rules/">How To Save/Restore Iptables Rules</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-saverestore-iptables-rules/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Enable/Disable Firewall On Centos / RedHat / Fedora</title>
		<link>http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/</link>
					<comments>http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 18 May 2011 05:34:36 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[administration tool]]></category>
		<category><![CDATA[boot time]]></category>
		<category><![CDATA[chkconfig command]]></category>
		<category><![CDATA[disable firewall]]></category>
		<category><![CDATA[firewall service]]></category>
		<category><![CDATA[init script]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ipv4]]></category>
		<category><![CDATA[packet filtering]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[service command]]></category>
		<category><![CDATA[system tool]]></category>
		<category><![CDATA[system v]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=590</guid>

					<description><![CDATA[<p>Iptables should be installed by default on all CentOS 3.x, 4.x and 5.x installations. You can check to see if iptables is installed on your system by: # rpm -q iptables Sample output iptables-1.3.5-5.3.el5_4.1 How to enable firewall Login as root and type the following command # /etc/init.d/iptables start # chkconfig iptables on If you [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/">How To Enable/Disable Firewall On Centos / RedHat / Fedora</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Iptables</strong> should be installed by default on all CentOS 3.x, 4.x and 5.x installations. You can check to see if iptables is installed on your system by:</p>
<pre>
# rpm -q iptables
</pre>
<p><span id="more-590"></span><br />
Sample output</p>
<pre>
iptables-1.3.5-5.3.el5_4.1
</pre>
<h3>How to enable firewall</h3>
<p>Login as root and type the following command</p>
<pre>
# /etc/init.d/iptables start
# chkconfig iptables on
</pre>
<p>If you are using IPv6, enter:</p>
<pre>
# /etc/init.d/ip6tables start
# chkconfig ip6tables on
</pre>
<p>And to see if iptables is actually running, we can check that the iptables modules are loaded, type the following command</p>
<pre>
# lsmod | grep ip_tables
</pre>
<p>Something look like:</p>
<pre>
ip_tables              29288  1 iptable_filter
x_tables               29192  6 ip6t_REJECT,ip6_tables,ipt_REJECT,xt_state,xt_tcpudp,ip_tables
</pre>
<h3>How to disable firewall</h3>
<p>Login as root and type the following command</p>
<pre>
# /etc/init.d/iptables stop
# chkconfig iptables off
</pre>
<p>If you are using IPv6, enter:</p>
<pre>
# /etc/init.d/ip6tables stop
# chkconfig ip6tables off
</pre>
<g:plusone href="http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/">How To Enable/Disable Firewall On Centos / RedHat / Fedora</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-enabledisable-firewall-on-centos-redhat-fedora/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Anti SYN Flood with IPTables</title>
		<link>http://lifelinux.com/anti-syn-flood-with-iptables/</link>
					<comments>http://lifelinux.com/anti-syn-flood-with-iptables/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 21 Apr 2011 05:53:05 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[--hitcount]]></category>
		<category><![CDATA[anti syn flood]]></category>
		<category><![CDATA[connecttion limited by iptables]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[limit connection]]></category>
		<category><![CDATA[syn flood]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=288</guid>

					<description><![CDATA[<p>#!/bin/sh # A simple shell to build a Firewall anti SYN Flood # Under CentOS, Fedora and RHEL / Redhat Enterprise Linux # servers. # ---------------------------------------------------------------------------- # Written by LongVNIT # (c) 2009 lifeLinux under GNU GPL v2.0+ IPT="iptables" MODPROBE="modprobe" IF="eth0" IP="192.168.1.112" PORT="22 80 443" CHECK_TIME=60 BAN_TIME=120 HITCOUNT=10 MOD="ip_tables ip_conntrack iptable_filter ipt_state" # Load Module [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/anti-syn-flood-with-iptables/">Anti SYN Flood with IPTables</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><pre>
#!/bin/sh
# A simple shell to build a Firewall anti SYN Flood
# Under CentOS, Fedora and RHEL / Redhat Enterprise Linux
# servers.
# ----------------------------------------------------------------------------
# Written by LongVNIT <http://www.lifelinux.com/>
# (c) 2009 lifeLinux under GNU GPL v2.0+

IPT="iptables"
MODPROBE="modprobe"
IF="eth0"
IP="192.168.1.112"
PORT="22 80 443"
CHECK_TIME=60
BAN_TIME=120
HITCOUNT=10
MOD="ip_tables ip_conntrack iptable_filter ipt_state"

# Load Module
for M in $MOD
do
	$MODPROBE $M
done

# Flush IPTables
$IPT -F
$IPT -X
$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP

# Define SYN_CHECK CHAIN
$IPT -N SYN_CHECK

# BAN IP IN 
$IPT -t mangle -A PREROUTING -p TCP -d $IP -m recent --name SYN --update --seconds $BAN_TIME --hitcount $HITCOUNT -j DROP

# DROP INVALID PACKET
$IPT -A INPUT -p TCP ! --syn -m state --state NEW -j DROP

# ACCPET ALL ESTABLISHED PACKET
$IPT -A INPUT -i $IF -m state --state ESTABLISHED -j ACCEPT

# CHECK SYN
for P in $PORT
do
	$IPT -A INPUT -i $IF -p TCP -d $IP --dport $P -m state --state NEW -j SYN_CHECK
done

# ACCEPT
for P in $PORT
do
	$IPT -A INPUT -i $IF -p TCP -d $IP --dport $P -m state --state NEW -j ACCEPT
done

# SYN_CHECK CHAIN
$IPT -A SYN_CHECK -m recent --set --name SYN
$IPT -A SYN_CHECK -m recent --name SYN --update --seconds $CHECK_TIME --hitcount $HITCOUNT -j LOG --log-level 5 --log-prefix "SYN_FLOOD"
$IPT -A SYN_CHECK -m recent --name SYN --update --seconds $CHECK_TIME --hitcount $HITCOUNT -j DROP
</pre>
<g:plusone href="http://lifelinux.com/anti-syn-flood-with-iptables/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/anti-syn-flood-with-iptables/">Anti SYN Flood with IPTables</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/anti-syn-flood-with-iptables/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
