<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Simple firewall - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=Simple_firewall&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 17:41:21 GMT</lastBuildDate>
		<item>
			<title>Erik: Copy from old</title>
			<link>https://www.slackwiki.com/index.php?title=Simple_firewall&amp;diff=184&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Simple_firewall&amp;diff=184&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;This script should suit most people well - simply edit the EXT_IF variable below and replace it with your network interface that's connected to the net.&lt;br /&gt;
--rworkman&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 # Define variables&lt;br /&gt;
 IPT=/usr/sbin/iptables		# change if needed&lt;br /&gt;
 EXT_IF=eth0			# external interface (connected to internet)&lt;br /&gt;
 &lt;br /&gt;
 # Enable TCP SYN Cookie Protection&lt;br /&gt;
 # ** comment the line below if it throws an error;&lt;br /&gt;
 # ** TCP_SYN_COOKIES must be enabled in the kernel&lt;br /&gt;
 # ** for this to work&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;
 &lt;br /&gt;
 # Disable ICMP Redirect Acceptance&lt;br /&gt;
 echo 0 &amp;gt; /proc/sys/net/ipv4/conf/all/accept_redirects&lt;br /&gt;
 &lt;br /&gt;
 # Do not send Redirect Messages&lt;br /&gt;
 echo 0 &amp;gt; /proc/sys/net/ipv4/conf/all/send_redirects&lt;br /&gt;
 &lt;br /&gt;
 # Enable bad error message protection&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses&lt;br /&gt;
 &lt;br /&gt;
 # Enable broadcast echo protection&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts&lt;br /&gt;
 &lt;br /&gt;
 # Disable source-routed packets&lt;br /&gt;
 echo 0 &amp;gt; /proc/sys/net/ipv4/conf/all/accept_source_route&lt;br /&gt;
 &lt;br /&gt;
 # Log spoofed packets, source-routed packets, and redirect packets&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/conf/all/log_martians&lt;br /&gt;
 &lt;br /&gt;
 # Set default policy to DROP&lt;br /&gt;
 $IPT -P INPUT DROP&lt;br /&gt;
 $IPT -P OUTPUT ACCEPT&lt;br /&gt;
 $IPT -P FORWARD DROP&lt;br /&gt;
 &lt;br /&gt;
 # Flush old rules&lt;br /&gt;
 $IPT -F&lt;br /&gt;
 &lt;br /&gt;
 # Allow loopback traffic&lt;br /&gt;
 $IPT -A INPUT -i lo -j ACCEPT&lt;br /&gt;
 $IPT -A OUTPUT -o lo -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Allow packets of established connections and those &lt;br /&gt;
 #   which are related to established connections&lt;br /&gt;
 $IPT -A INPUT -i $EXT_IF -p all -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Allow incoming ssh from internet &lt;br /&gt;
 # ** (uncomment the line below if you want to allow incoming ssh)&lt;br /&gt;
 #$IPT -A INPUT -i $EXT_IF -p tcp --destination-port 22 -m state --state NEW -j ACCEPT &lt;br /&gt;
 &lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</description>
			<pubDate>Sat, 06 Jun 2009 23:24:31 GMT</pubDate>
			<dc:creator>Erik</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Simple_firewall</comments>
		</item>
</channel></rss>