<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.jon.geek.nz/index.php?action=history&amp;feed=atom&amp;title=Firewall</id>
	<title>Firewall - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jon.geek.nz/index.php?action=history&amp;feed=atom&amp;title=Firewall"/>
	<link rel="alternate" type="text/html" href="https://wiki.jon.geek.nz/index.php?title=Firewall&amp;action=history"/>
	<updated>2026-05-06T19:30:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.7</generator>
	<entry>
		<id>https://wiki.jon.geek.nz/index.php?title=Firewall&amp;diff=1712&amp;oldid=prev</id>
		<title>Johnno at 00:04, 16 June 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.jon.geek.nz/index.php?title=Firewall&amp;diff=1712&amp;oldid=prev"/>
		<updated>2009-06-16T00:04:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:04, 16 June 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot; &gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # SSH Whitelist&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # SSH Whitelist&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ${IPTABLES} -A INPUT -p TCP --dport 22 -s 192.168.0.0/24 -j ACCEPT&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ${IPTABLES} -A INPUT -p TCP --dport 22 -s 192.168.0.0/24 -j ACCEPT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ${IPTABLES} -A INPUT -p TCP --dport 22 -s &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;202.78.240.7&lt;/del&gt;/32 -j ACCEPT&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ${IPTABLES} -A INPUT -p TCP --dport 22 -s &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;ipaddress&amp;gt;&lt;/ins&gt;/32 -j ACCEPT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # Throttle SSH from everywhere else&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # Throttle SSH from everywhere else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_jon_geek_nz:diff::1.12:old-1711:rev-1712 --&gt;
&lt;/table&gt;</summary>
		<author><name>Johnno</name></author>
	</entry>
	<entry>
		<id>https://wiki.jon.geek.nz/index.php?title=Firewall&amp;diff=1711&amp;oldid=prev</id>
		<title>Johnno: New page: Sick of chunderheads from Romania trying to hammer down your SSH door? Use keys. Disable passwords. Then, use this iptables script. Whitelist your SSH. For all other IPs, they&#039;re allowed t...</title>
		<link rel="alternate" type="text/html" href="https://wiki.jon.geek.nz/index.php?title=Firewall&amp;diff=1711&amp;oldid=prev"/>
		<updated>2009-06-15T23:31:18Z</updated>

		<summary type="html">&lt;p&gt;New page: Sick of chunderheads from Romania trying to hammer down your SSH door? Use keys. Disable passwords. Then, use this iptables script. Whitelist your SSH. For all other IPs, they&amp;#039;re allowed t...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sick of chunderheads from Romania trying to hammer down your SSH door? Use keys. Disable passwords. Then, use this iptables script. Whitelist your SSH. For all other IPs, they&amp;#039;re allowed two connection attempts per minute, after which they get one sticky connection per minute, which should piss them off, after which they get dropped.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 echo Adding iptables firewall rules&lt;br /&gt;
 IPTABLES=/sbin/iptables&lt;br /&gt;
 &lt;br /&gt;
 # set chain policies&lt;br /&gt;
 ${IPTABLES} -F&lt;br /&gt;
 ${IPTABLES} -t nat -F&lt;br /&gt;
 ${IPTABLES} -P INPUT ACCEPT&lt;br /&gt;
 ${IPTABLES} -P FORWARD ACCEPT&lt;br /&gt;
 ${IPTABLES} -P OUTPUT ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # allow established connections&lt;br /&gt;
 ${IPTABLES} -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # SSH Whitelist&lt;br /&gt;
 ${IPTABLES} -A INPUT -p TCP --dport 22 -s 192.168.0.0/24 -j ACCEPT&lt;br /&gt;
 ${IPTABLES} -A INPUT -p TCP --dport 22 -s 202.78.240.7/32 -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Throttle SSH from everywhere else&lt;br /&gt;
 ${IPTABLES} -A INPUT -p TCP --dport 22 -m hashlimit --hashlimit-mode srcip --hashlimit 2/minute --hashlimit-burst 1 --hashlimit-name SSH_OK -j ACCEPT&lt;br /&gt;
 ${IPTABLES} -A INPUT -p TCP --dport 22 -m hashlimit --hashlimit-mode srcip --hashlimit 1/minute --hashlimit-burst 1 --hashlimit-name SSH_DODGY -j REJECT&lt;br /&gt;
 ${IPTABLES} -A INPUT -p TCP --dport 22 -j DROP&lt;/div&gt;</summary>
		<author><name>Johnno</name></author>
	</entry>
</feed>