<?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=Simple_firewall</id>
	<title>Simple firewall - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Simple_firewall"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Simple_firewall&amp;action=history"/>
	<updated>2026-04-08T17:41:23Z</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=Simple_firewall&amp;diff=184&amp;oldid=prev</id>
		<title>Erik: Copy from old</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Simple_firewall&amp;diff=184&amp;oldid=prev"/>
		<updated>2009-06-06T23:24:31Z</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;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;</summary>
		<author><name>Erik</name></author>
	</entry>
</feed>