<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=AllixD_Firewall_Script</id>
	<title>AllixD Firewall Script - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=AllixD_Firewall_Script"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;action=history"/>
	<updated>2026-04-08T14:27:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;diff=87&amp;oldid=prev</id>
		<title>Erik: Copy from old</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;diff=87&amp;oldid=prev"/>
		<updated>2009-06-02T03:28:07Z</updated>

		<summary type="html">&lt;p&gt;Copy from old&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I use this. It does not allow any incoming data, so it's no good for NFS servers.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 IPT=&amp;quot;/usr/sbin/iptables&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Let's make sure forwarding is DISABLED:&lt;br /&gt;
 echo &amp;quot;0&amp;quot; &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
 &lt;br /&gt;
 # Let's enable SYN cookies (to protect against SYN floods):&lt;br /&gt;
 echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
 &lt;br /&gt;
 # Let's disable TCP timestamps to reduce the TCP stack workload:&lt;br /&gt;
 echo &amp;quot;0&amp;quot; &amp;gt; /proc/sys/net/ipv4/tcp_timestamps&lt;br /&gt;
 &lt;br /&gt;
 # Let's enable reverse path filtering for anti-spoofing:&lt;br /&gt;
 echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/conf/all/rp_filter&lt;br /&gt;
 &lt;br /&gt;
 # Let's ignore PINGs which have been BROADCAST:&lt;br /&gt;
 echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
 &lt;br /&gt;
 # Let's disable source routed packets as they are ridiculous:&lt;br /&gt;
 echo &amp;quot;0&amp;quot; &amp;gt; /proc/sys/net/ipv4/conf/all/accept_source_route&lt;br /&gt;
 &lt;br /&gt;
 # Let's allow redirects from trusted gateways only:&lt;br /&gt;
 echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/conf/all/secure_redirects&lt;br /&gt;
 &lt;br /&gt;
 # Let's log any UFOs which are spotted:&lt;br /&gt;
 echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/conf/all/log_martians&lt;br /&gt;
 &lt;br /&gt;
 # Let's flush-out all the chains in our tables:&lt;br /&gt;
 $IPT -F&lt;br /&gt;
 $IPT -F -t nat&lt;br /&gt;
 $IPT -F -t mangle&lt;br /&gt;
 &lt;br /&gt;
 # Let's delete every non-builtin chains in our tables:&lt;br /&gt;
 $IPT -X&lt;br /&gt;
 $IPT -X -t nat&lt;br /&gt;
 $IPT -X -t mangle&lt;br /&gt;
 &lt;br /&gt;
 # Let's set our INPUT policy to DROP:&lt;br /&gt;
 $IPT -P INPUT DROP&lt;br /&gt;
 &lt;br /&gt;
 # Let's set our OUTPUT policy to ACCEPT, because we can&lt;br /&gt;
 # appreciate this kinda flexibility on a Home PC:&lt;br /&gt;
 $IPT -P OUTPUT ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Let's accept incoming packets which belong to connections&lt;br /&gt;
 # that have ALREADY been initiated:&lt;br /&gt;
 $IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Let's allow all packets initiating new connections LOCALLY:&lt;br /&gt;
 $IPT -A INPUT -i lo -m state --state NEW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Let's log every packet that reaches this rule, right before&lt;br /&gt;
 # it hits our INPUT policy and gets a DROP:&lt;br /&gt;
 $IPT -A INPUT -j LOG --log-prefix &amp;quot;INPUT DROP: &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Let's load the module allowing Connection Tracking for FTP:&lt;br /&gt;
 /sbin/modprobe ip_conntrack_ftp&lt;br /&gt;
 &lt;br /&gt;
 # Let's load the module allowing Connection Tracking for IRC:&lt;br /&gt;
 /sbin/modprobe ip_conntrack_irc&lt;br /&gt;
 &lt;br /&gt;
 # No rc.firewall script is complete without the ubiquitous echo:&lt;br /&gt;
 echo &amp;quot;So let it be written. So let it be done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Erik</name></author>
	</entry>
</feed>