<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>AllixD Firewall Script - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 14:27:25 GMT</lastBuildDate>
		<item>
			<title>Erik: Copy from old</title>
			<link>https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;diff=87&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=AllixD_Firewall_Script&amp;diff=87&amp;oldid=prev</guid>
			<description>&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;</description>
			<pubDate>Tue, 02 Jun 2009 03:28:07 GMT</pubDate>
			<dc:creator>Erik</dc:creator>
			<comments>https://www.slackwiki.com/Talk:AllixD_Firewall_Script</comments>
		</item>
</channel></rss>