<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ipsidixit.net</title>
	<atom:link href="http://www.ipsidixit.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipsidixit.net</link>
	<description>A far off place</description>
	<lastBuildDate>Fri, 05 Mar 2010 14:05:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IPv6 and default routes</title>
		<link>http://www.ipsidixit.net/2010/03/05/ipv6-and-default-routes/</link>
		<comments>http://www.ipsidixit.net/2010/03/05/ipv6-and-default-routes/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:02:13 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/?p=233</guid>
		<description><![CDATA[Following on from my first tutorial, we have a box set up which has basic IPv6 connectivity. There&#8217;s a firewall in place with a simple but sufficient configuration. And we can ping6 from this box to remote IPv6 destinations.
All of this has, so far, made use only of one network interface (in my case eth0) to set [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png"><img class="alignleft size-full wp-image-227" style="margin-left: 15px; margin-right: 15px; margin-top: 10px; margin-bottom: 10px;" title="IPv6 Logo" src="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png" alt="" width="100" height="60" /></a>Following on from <a href="http://www.ipsidixit.net/2010/02/24/228/">my first tutorial</a>, we have a box set up which has basic IPv6 connectivity. There&#8217;s a firewall in place with a simple but sufficient configuration. And we can ping6 from this box to remote IPv6 destinations.</p>
<p>All of this has, so far, made use only of one network interface (in my case <em>eth0</em>) to set things up. However looking ahead to the next step I am aware that I will want devices <em>inside</em> my network (i.e. my workstations, etc.) to have IPv6 connectivity <em>through</em> this device I am setting up. In other words, this device must, as it does today for IPv4, act as a <em>router</em>.</p>
<p>With IPv4 this is, at a basic level (so forgetting about firewalling and so on) very easy: enable IPv4 forwarding and away you go.</p>
<p>For IPv6? A little more complicated&#8230;</p>
<p><span id="more-233"></span></p>
<h2>sysctl.conf</h2>
<p>My first step was to jump in to /etc/sysctl.conf and, just as I have IPv4 forwarding enabled here, do the same for IPv6. There&#8217;s even a (likely commented out) entry already there to help you. So I change it to show:</p>
<pre style="padding-left: 30px;">net.ipv6.conf.all.forwarding = 1</pre>
<p>Reboot (or if you prefer manually involve the same change via sysctl or simply dropping the value in via /proc/sys/) and it takes effect.</p>
<h2>Why has it all stopped working?</h2>
<p>After doing this, the first thing I noticed was that suddenly I could no longer ping6 to my test destination. I find that the default route has disappeared from the route table (ip -6 route show)</p>
<p>It turns out that once the device is defined to be a router (i.e. that IPv6 forwarding is enabled) it stops acting on received Router Advertisements from the ISP, arriving on my WAN link eth0.</p>
<p>I was pretty miffed at first, but of course on reflection this is entirely sensible behaviour &#8211; I do not actually know who is sending me a given router advertisement. I have no knowledge of how the ISP has built its IPv6 infrastructure, and while I would hope that only the ISP can send an IPv6 Router Advertisement towards me, maybe not? What if someone else manages to do it too?</p>
<p>That&#8217;s why an IPv6 router, even in this context, as a home gateway, needs to treat a Router Advertisement with care!</p>
<h2>What to do?</h2>
<p>With IPv6 forwarding enabled it is possible to allow the RA to be accepted. In sysctl.conf set:</p>
<pre style="padding-left: 30px;">net.ipv6.conf.all.accept_ra = 1</pre>
<p>However this then permits the interface(s) to autoconfig so far as addressing is concerned, but still does not pick up a default route. There is also a sysctl of net.ipv6.conf.all.accept_ra_defrtr which could be useful (if you trust your RA in the first place, that is) but anyway I could not make it work as I&#8217;d expect.</p>
<p>So really it comes down to making sure that, once IPv6 forwarding is enabled, that a default route is manually defined. Something along the lines of:</p>
<pre style="padding-left: 30px;">ip -6 route add default via fe80::207:cbff:aaaa:bbbb dev eth0</pre>
<p>seems to do the trick<br />
Of course the difficulty here is how you obtain the address of the required gateway. My ISP had not told me what it was. I obtained it by looking at what the default route had been prior to enabling IPv6 forwarding. Of course I could also have simply run <em>tcpdump -i eth0 ip6</em> and waited for a to show up.To make this permanent, a suitable line can be added to /etc/network.interfaces, so mine now looks similar to:</p>
<pre style="padding-left: 30px;">iface eth0 inet6 static
address 2a01:e35:8b25:aaaa::1
netmask 64
gateway fe80::207:cbff:aaaa:bbbb</pre>
<p>So with IPv6 forwarding enabled <em>and </em> a default route successfully restored, we can now proceed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/03/05/ipv6-and-default-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 &#8211; logging and shorewall6</title>
		<link>http://www.ipsidixit.net/2010/02/25/231/</link>
		<comments>http://www.ipsidixit.net/2010/02/25/231/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:42:32 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[shorewall]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2010/02/25/231/</guid>
		<description><![CDATA[Following on from my early success at get IPv6 running, I soon hit a significant issue: firewall logging.

Now this need not be a &#8220;blocker&#8221; for everyone, but I take my firewall logging duties quite seriously&#8230;!
shorewall IPv4 logging
Currently I have IPv4 shorewall configured to log not using the standard syslog mechanism, but instead to use ulogd [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-weight: normal; font-size: 13px;"><a href="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png"><img class="alignleft size-full wp-image-227" style="margin-top: 10px; margin-bottom: 10px; margin-left: 15px; margin-right: 15px;" title="IPv6 Logo" src="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png" alt="" width="100" height="60" /></a>Following on from <a href="http://www.ipsidixit.net/2010/02/24/228/" target="_blank"><span style="color: #000000;">my early success at get IPv6 running</span></a>, I soon hit a significant issue: firewall logging.</p>
<p></span></h1>
<p>Now this need not be a &#8220;blocker&#8221; for everyone, but I take my firewall logging duties quite seriously&#8230;!</p>
<h2>shorewall IPv4 logging</h2>
<p>Currently I have IPv4 <a id="mn7m" title="shorewall IPv4 logging configuration and options" href="http://www.shorewall.net/shorewall_logging.html"><span style="color: #000000;">shorewall configured to log</span></a> not using the standard syslog mechanism, but instead to use <a id="w_zy" title="ulogd" href="http://www.netfilter.org/projects/ulogd/index.html"><span style="color: #000000;">ulogd</span></a> instead. This allows me to easily log firewall activity to an entirely separate set of log files very easily. It is entirely not mandatory, but it&#8217;s neat and tidy. I then have <a id="pe_m" title="fwlogwatch" href="http://fwlogwatch.inside-security.de/"><span style="color: #000000;">fwlogwatch</span></a> to nightly analyse the logs and automatically email the interesting bits to me for occasional checking.</p>
<p>To enable this I have appropriate pointers to use of ULOG in shorewall&#8217;s <span style="font-family: 'Courier New';">policy</span> and <span style="font-family: 'Courier New';">rules </span>files as follows:</p>
<div><span id="more-231"></span></div>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';"><span style="text-decoration: underline;">policy</span></span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">ext all DROP ULOG<br />
</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
</blockquote>
<p>and, for example:</p>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';"><span style="text-decoration: underline;">rules</span></span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<div><span style="font-family: 'Courier New';">.</span></div>
<p><span style="font-family: 'Courier New';">ACCEPT:ULOG all fwall 47<br />
.<br />
.<br />
.</span></p></blockquote>
<p>One then has an appropriate config in <span style="font-family: 'Courier New';">/etc/ulogd.conf</span> to file things where you want them.</p>
<h2>shorewall6 IPv6 logging</h2>
<div>Having installed <em>shorewall6</em> in a simple form and got it working, I naively assumed I could log in a similar manner as with the IPv4 version of shorewall. Oh no &#8211; I find <em>ulogd</em> is no longer supported in <em>shorewall6</em> and the choices are:</div>
<ul>
<li>syslog</li>
<li>nflog</li>
</ul>
<p>The <em>syslog</em> option I specifically did not want, so I decided I&#8217;d better find out about <em>nflog</em> (Net Filter Log). It turns out that nflog is actually more commonly referred to as <em>ulogd2</em>, and is a dramatically enhanced version of the original <em>ulog</em>. In fact it&#8217;s so different that it is, for all practical purposes, and entirely different thing. Trying to relate <em>ulog</em> to <em>ulog2</em> is a pretty futile exercise. Work on the basis that they are pretty much unrelated and it&#8217;ll prove less frustrating.</p>
<div>
<p>Anyway, the learning curve with <em>ulogd2</em> was a bit steep, but it turns out to be a very neat product. Here I will present some key points that should help you to get it up, running and integrated on a Ubuntu system. Oh, and it&#8217;s not available as a pre-built package&#8230; Sorry &#8211; didn&#8217;t I mention that?</p>
</div>
<h2>Implementing NFLOG (aka ulogd2) on a Ubuntu firewall</h2>
<p>The first step to follow is to get hold of the <em>ulogd2</em> source tree and build it. I worried that this would take me some time, but found a <a id="cgq:" title="Pollux's blog" href="https://www.wzdftpd.net/blog/index.php?2008/04/05/19-ulogd2-the-new-userspace-logging-daemon-for-netfilter-iptables-part-2">tremendously helpful article</a> someone had already written which aided me a lot. (Thank you Pollux!)</p>
<div>If you&#8217;re familiar with building from source, that page will give you most of what you need. Here are a few points to add:</div>
<ul>
<li>I&#8217;d suggest leaving the build <span style="font-family: 'Courier New';">PREFIX</span> unspecified (i.e. default) so it will ultimately install in the <span style="font-family: 'Courier New';">/usr/local/</span> hierarchy. This means you can get it all working in parallel with an existing <em>ulogd</em> installation &#8211; much cleaner and safer!</li>
<li>Since we want to emulate <em>ulogd</em> just in so far as we are able to log to a disk file, disable any of the <em>Postgres</em> or <em>MySQL</em> build options to make things more compact and simple (unless of course you want to make use of these neat new features within <em>ulogd2</em>!)</li>
<li>Much of the article referenced assume that you <em>will</em> be logging to a database &#8211; keep it simple for now and ignore that.</li>
</ul>
<h2>ulogd2 config highlights</h2>
<div>Once <em>ulogd2</em> is installed, you need to copy the supplied <span style="font-family: 'Courier New';">ulogd.conf </span>from the source tree you used to build into <span style="font-family: 'Courier New';">/usr/local/etc</span>.</div>
<div>The contents of this file took a little working out, but here I present the key elements required in order to have <em>ulogd2</em> set up to allow:</div>
<ul>
<li>IPv6 to be logged to one file</li>
<li>IPv4 to be logged to another file (this used to be done using the original <em>ulogd</em>)</li>
</ul>
<div>Once completed and the two shorewall configs tweaked to make use of it, this new ulogd2 <em>replaces</em> the previously used ulogd. Note that this is optional: you can have both versions of ulogd coexist. However it&#8217;s a lot cleaner and easier to maintain if just one subsystem is used. But that&#8217;s entirely a personal choice.</div>
<h3>plugins section</h3>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_inppkt_NFLOG.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_inppkt_ULOG.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_inpflow_NFCT.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_IFINDEX.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_IP2STR.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_IP2BIN.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_PRINTPKT.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_HWHDR.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_PRINTFLOW.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_filter_MARK.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_LOGEMU.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_SYSLOG.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_OPRINT.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_NACCT.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_PCAP.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_PGSQL.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_MYSQL.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">#plugin=&#8221;/usr/local/lib/ulogd/ulogd_output_DBI.so&#8221;</span></div>
<div><span style="font-family: 'Courier New';">plugin=&#8221;/usr/local/lib/ulogd/ulogd_raw2packet_BASE.so&#8221;</span></div>
</blockquote>
<h3>stacks section</h3>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';"># this is a stack for logging packets to syslog after a collect via NFLOG</span></div>
<div><span style="font-family: 'Courier New';">stack=log4:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,emu4:LOGEMU</span></div>
<div><span style="font-family: 'Courier New';">stack=log6:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,emu6:LOGEMU</span></div>
</blockquote>
<h3>log section</h3>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';"># Using log4 for IPv4</span></div>
<div><span style="font-family: 'Courier New';">[log4]</span></div>
<div><span style="font-family: 'Courier New';">group=4</span></div>
<div><span style="font-family: 'Courier New';">numeric_lable=4</span></div>
<div><span style="font-family: 'Courier New';"># Using log6 for IPv6</span></div>
<div><span style="font-family: 'Courier New';">[log6]</span></div>
<div><span style="font-family: 'Courier New';">group=6</span></div>
<div><span style="font-family: 'Courier New';">numeric_label=6</span></div>
</blockquote>
<h3>log-specific sections</h3>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';"># IPv4</span></div>
<div><span style="font-family: 'Courier New';">[emu4]</span></div>
<div><span style="font-family: 'Courier New';">file=&#8221;/var/log/firewall/nflog4.log&#8221;</span></div>
<div><span style="font-family: 'Courier New';">sync=1</span></div>
<div><span style="font-family: 'Courier New';"># IPv6</span></div>
<div><span style="font-family: 'Courier New';">[emu6]</span></div>
<div><span style="font-family: 'Courier New';">file=&#8221;/var/log/firewall/nflog6.log&#8221;</span></div>
<div><span style="font-family: 'Courier New';">sync=1</span></div>
</blockquote>
<h2>Changes to shorewall configs</h2>
<div>And finally we need to tweak <em>shorewall</em> and <em>shorewallt6</em> to use the new log facility. For shorewall6 that means simply adding the appropriate <span style="font-family: 'Courier New';">NFLOG</span> references within the policies and/or rules. For shorewall IPv4 one simply has to replace existing <span style="font-family: 'Courier New';">ULOG</span> references with an appropriate <span style="font-family: 'Courier New';">NFLOG</span> reference.</div>
<h3>shorewall6 additions</h3>
<p>So my (very very over-logged &#8211; but then my IPv6 is still at the experimental stage&#8230;!) <span style="font-family: 'Courier New';">policy</span> file is now:</p>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';">#Source         Dest            Policy          Log             Burst/Limit</span></div>
<div><span style="font-family: 'Courier New';">fwall           all             DROP            NFLOG(6)</span></div>
<div><span style="font-family: 'Courier New';">int             all             DROP            NFLOG(6)</span></div>
<div><span style="font-family: 'Courier New';">ext             all             DROP            NFLOG(6)</span></div>
<div><span style="font-family: 'Courier New';">all             all             DROP            NFLOG(6)</span></div>
</blockquote>
<div>And to test logging from individual rules I&#8217;ve specified <span style="font-family: 'Courier New';">rules</span> as:</div>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';">ACCEPT:NFLOG(6) ext     fwall   ipv6-icmp</span></div>
<div><span style="font-family: 'Courier New';">ACCEPT:NFLOG(6) fwall   ext     ipv6-icmp</span></div>
</blockquote>
<h3>shorewall (IPv4) changes</h3>
<p>And over in my IPv4 shorewall I just changed any reference to <span style="font-family: 'Courier New';">ULOG</span> to read <span style="font-family: 'Courier New';">NFLOG(4)</span>, for example, where <span style="font-family: 'Courier New';">policy</span> previously read:</p>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';">office all DROP ULOG</span></div>
</blockquote>
<div>it now reads</div>
<blockquote style="border: none; margin: 0 0 0 40px;">
<div><span style="font-family: 'Courier New';">office all DROP NFLOG(4)</span></div>
<div><span style="font-family: 'Courier New';"><br />
</span></div>
</blockquote>
<h2>In Summary</h2>
<div>If you are implementing IPv6 with <em>shorewall6</em>, <em>ulog</em> cannot be used for logging. You must either go back to the crude-but-efective use of <em>syslog</em> or go forward to <em>NFLOG</em> / <em>ulogd2</em>. Implementing <em>ulogd2</em> is not entirely trivial, since it is not yet a pre-built package for Ubuntu. However building and implementing it is far from impossible if you&#8217;ve a little experience in such matters. And as a bonus, once implemented you can drop the original ulog and integrate both IPv4 and IPv6 logging within NFLOG.</div>
<div>Worth noting is that while we&#8217;ve achieved an elegant split between IPv4 and IPv6 firewall logs using <em>ulog2d</em>, while I can continue to process my IPv4 logs every night using <em>fwlogwatch</em>, as before, the processing and analysis of the IPv6 logs is another issue altogether! <em>fwlogwatch</em> is an old tool and does not process IPv6 log files. I&#8217;ll sort that out in a later article.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/02/25/231/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 at home &#8211; a guide to getting started</title>
		<link>http://www.ipsidixit.net/2010/02/24/228/</link>
		<comments>http://www.ipsidixit.net/2010/02/24/228/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:36:50 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[radvd]]></category>
		<category><![CDATA[shorewall]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2010/02/24/228/</guid>
		<description><![CDATA[With IPv6 slowly becoming more visible, it was time to get to grips with it. While absolutely not essential (yet!) it seemed like a fun idea: my ADSL provider offers native IPv6 in parallel with IPv4, and my hosting provider is running an IPv6 beta. So I can do native IPv6 end to end between [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: x-large;"><span style="text-decoration: underline;"><strong><a href="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png"><img class="alignleft size-full wp-image-227" style="margin-left: 15px; margin-right: 15px; margin-top: 10px; margin-bottom: 10px;" title="IPv6 Logo" src="https://www.ipsidixit.net/wp-content/2010/02/IPv6-logo.png" alt="" width="100" height="60" /></a></strong></span></span></p>
<p>With IPv6 slowly becoming more visible, it was time to get to grips with it. While absolutely not essential (yet!) it seemed like a fun idea: my ADSL provider offers native IPv6 in parallel with IPv4, and my hosting provider is running an IPv6 beta. So I can do native IPv6 end to end between my home and a remote host. &#8220;Home&#8221; in this case consists of a Linux firewall running iptables, fronted by shorewall. Two ethernet ports: one to the ADSL modem (my &#8220;external&#8221; interface) and one to the house infrastructure (&#8220;internal&#8221;)</p>
<p>The Ubuntu server distribution in use is, like most Linux distros, fully IPv6 ready. For example, do an ifconfig and we see</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">Link encap:Ethernet  HWaddr 00:40:63:f5:f9:3c </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet addr:88.XXX.XX.XXX  Bcast:88.178.87.255  Mask:255.255.255.0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 addr: fe80::240:63ff:fef5:f93c/64 Scope:Link</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX packets:14086899 errors:0 dropped:0 overruns:0 frame:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> TX packets:15607323 errors:0 dropped:0 overruns:0 carrier:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> collisions:0 txqueuelen:1000 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX bytes:1837525573 (1.8 GB)  TX bytes:666354591 (666.3 MB)</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> Interrupt:16 Base address:0&#215;8000 </span></div>
<p>Now I may not know much about IPv6 on Linux yet, but I can see that I&#8217;ve got a line beginning &#8220;inet addr&#8221; which looks kinda IPv6-ish. Good start. Let&#8217;s go&#8230;</p>
<p><span id="more-228"></span></p>
<h1>IPv4 &#8211; today</h1>
<p>As it stands, my home firewall performs the following functions:</p>
<ul>
<li>It acts as a DHCP <em>client</em> on its <em>external</em> interface, in order to pick up from the ISP the IPv4 address, plus the DNS server(s) being offered. In fact my IPv4 address is fixed, so strictly speaking I don&#8217;t need to act as a DHCP client on this interface, but it&#8217;s no real effort to do so and it means I get the DNS servers automatically.</li>
<li>It acts as a DHCP <em>server</em> on its <em>internal</em> interface, in order to supply IP addresses to the many and various client devices within the house, along with DNS information. (I actually use <a id="cuqm" title="dnsmasq" href="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a> for this purpose &#8211; tremendous piece of software)</li>
<li>It performs NAT between the internal devices and the Internet, courtesy of <a id="e66t" title="iptables" href="http://www.netfilter.org/">iptables</a>.</li>
<li>It acts as a firewall between the internal devices and the Internet, again courtesy of iptables.</li>
</ul>
<p>Since no one in their right mind writes &#8220;raw&#8221; iptables configs of any complexity, I use <a id="rljr" title="shorewall" href="http://www.shorewall.net/"><span style="color: #000000;">shorewall</span></a> to administer the NAT and firewall functions &#8211; mostly using the shorewall cli, sometimes using the shorewall GUI within <a id="hk_w" title="Webmin" href="http://www.webmin.com/"><span style="color: #000000;">Webmin</span></a>.</p>
<p>To top things off, I also have a VPN tunnel running between the firewall and a host machine, using <a id="wr0b" title="OpenVPN" href="http://openvpn.net/"><span style="color: #000000;">OpenVPN</span></a>.</p>
<h1>So what do I need to know even <em>before</em> I think of starting with IPv6?</h1>
<p>So as far as I know all the raw elements are available to me: ISP support, host support and all the bit &#8216;n bobs that Linux offers. So how do I string them together? In fact, hang on a sec before that: Just what is my goal?? The engineer in me frankly just wants to have a damn good play with IPv6, but it&#8217;s still good to have an initial goal to provide some sort of framework and direction.</p>
<p>Hence I set myself the somewhat arbitrary goals as follows:</p>
<ul>
<li>Between my firewall and my remote host enable simple IPv6 connectivity. ping, ssh, etc.</li>
<li>Between my firewall and my remote host enable VPN connectivity (i.e. shift the existing IPv4 tunnel to IPv6)</li>
<li>While leaving the rest of the household blissfully ignorant (and hence unaffected) by IPv6, enable two specific workstations (one Windows, one Linux) to have dual IPv4/IPv6 stacks such that they default to using IPv4 except for traffic destined to the remote host or some other IPv6 end-point, which will go IPv6 end-to-end (i.e. workstation &lt;&#8211;&gt; firewall &lt;&#8211;&gt; host)</li>
</ul>
<p>Note that there are a lot of things that I am not yet trying to do. Specifically I am not setting up any gateways to allow IPv4 &lt;&#8211;&gt; IPv6 inter-working. For now I will have all my existing IPv4 functionality, with an entirely optional layer of IPv6 for those clients who (a) can talk native IPv6 and (b) have an IPv6 end-point to which they wish to connect. The inter-working side of things is a level of complication that in the first instance I want to avoid. Start simple and build up.</p>
<h1>IPv6 Basics</h1>
<p>Before anything else there are some IPv6 &#8220;basics&#8221; that need a little explanation and clarification. As with any technology, the problem is not with finding information. The problem is with finding out which information is useful and which is entirely irrelevant.</p>
<h2>IPv6 Addresses</h2>
<p>The one thing everyone knows about IPv6 is that it&#8217;s got funny looking, and rather large, addresses. Where once we had stuff like good old 192.168.0.1, now I might have fe80::240:63ff:fef5:f93c/64. And that&#8217;s one of the shorter ones&#8230;!</p>
<p>So what do I really need to know about IPv6 addresses, leaving aside the stuff that&#8217;s not required? Here goes.</p>
<p>IPv6 addresses consist of 128 bits. Why? Simple: to provide enough addresses that we&#8217;re not likely to run out, as we are perilously close to doing with IPv4. Just how big is &#8220;128 bits&#8221;? In decimal terms, such numbers have up to 39 digits. Here&#8217;s one:</p>
<pre style="padding-left: 30px;">340282366920938463463374607431768211455</pre>
<p>In order to make things more manageable, IPv6 addresses are not written as long, decimal numbers. Instead they are written in hexadecimal, broken up in to 16-bit fields by colons. Here&#8217;s an IPv6 address lifted from the official IPv6 HowTo:</p>
<pre style="padding-left: 30px;">2001:0db8:0100:f101:0210:a4ff:fee3:9566</pre>
<p>To further simplify things, leading zeros can be omitted. Also, contiguous blocks of zeros can also be omitted. For example:</p>
<pre style="padding-left: 30px;">2001:0db8:0100:f101:0000:0000:0000:0001</pre>
<p>can be reduced down to</p>
<pre style="padding-left: 30px;">2001:db8:100:f101::1</pre>
<p>The most extreme example of this is when the localhost address is considered (analogous to IPv4&#8217;s 127.0.0.1) and can be condensed down from</p>
<pre style="padding-left: 30px;">0000:0000:0000:0000:0000:0000:0000:0001</pre>
<p>to</p>
<pre style="padding-left: 30px;">::1</pre>
<p>Note, however, that the use of &#8216;::&#8217; and leading-zero suppression is purely a shorthand. <em>All</em> IPv6 addresses are 128-bits in length &#8211; these are just cosmetic tricks to make the writing and typing of them a little more friendly.</p>
<p>Just as IPv4 addresses have netmasks, so with IPv6 addresses. More of that when we look specifically at routing later on.</p>
<p>Also, normally we find that the upper 64 bits are considered to be &#8220;network&#8221; bits and the lower 64 bits are &#8220;host&#8221; bits.</p>
<h3>Network bits</h3>
<p>The leading 16 bits of the network portion of an IPv6 address are &#8220;special&#8221; in so far as some values are reserved as having special meaning. I am not here going to define all the possible values in use. I am confining myself to what matters within the context of the exercise at hand. And for those purposes the two values might be seen.</p>
<h4>Local link addresses prefix</h4>
<p><span style="font-family: 'Courier New';">fec</span><em><span style="font-family: 'Courier New';">x</span></em> (where <em>x</em> is any hex digit, but is normally 0) &#8211; Such addresses are local link addresses. Under Linux, when an IPv6-capable interface is enabled, such an address &#8220;automatically&#8221; appears. It is used solely to talk with other devices on the same link: hi, anything there? anyone looking for a router? Note that such addresses are <em>not</em> used for &#8220;normal&#8221; data &#8211; they are purely for local link management. And now we know where that IPv6-looking address came from in my original <em>ifconfig</em> command:</p>
<pre style="padding-left: 30px;">inet6 addr: fe80::240:63ff:fef5:f93c/64 Scope:Link</pre>
<p>(and notice that friendly Linux even puts the &#8220;Link&#8221; there to remind you that it&#8217;s a link address)</p>
<div>
<h4>Global unicast address prefix</h4>
<p><span style="font-family: 'Courier New';">2</span><em><span style="font-family: 'Courier New';">xxx</span></em> and <span style="font-family: 'Courier New';">3</span><em><span style="font-family: 'Courier New';">xxx</span></em> &#8211; These are so-called &#8220;global unicast&#8221; addresses, analogous to IPv4 &#8220;normal&#8221; addresses (i.e. not private, not multicast, etc.)</p>
</div>
<h3>Host bits</h3>
<p>The bottom 64 bits of an IPv6 address are, essentially, whatever you want them to be. They can be manually defined or, more often, are computed by using the interfaces MAC address (if it has one).</p>
<p>So here&#8217;s a simple enough address:</p>
<pre style="padding-left: 30px;">2001:0db8:100:f101::1</pre>
<p>Given the <span style="font-family: 'Courier New';">2001:</span>prefix, so we know it&#8217;s a global unicast address from an ISP. And the bottom 64 bits consists of just &#8216;1&#8242; (all the zeros are magic&#8217;ed away by the &#8216;::&#8217;)</p>
<p>But what of this &#8220;computed from the MAC address&#8221;? Recalling the ifconfig I showed back at the start:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">Link encap:Ethernet  HWaddr 00:40:63:f5:f9:3c </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet addr:88.XXX.XX.XXX  Bcast:88.178.87.255  Mask:255.255.255.0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 addr: fe80::240:63ff:fef5:f93c/64 Scope:Link</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX packets:14086899 errors:0 dropped:0 overruns:0 frame:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> TX packets:15607323 errors:0 dropped:0 overruns:0 carrier:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> collisions:0 txqueuelen:1000 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX bytes:1837525573 (1.8 GB)  TX bytes:666354591 (666.3 MB)</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> Interrupt:16 Base address:0&#215;8000 </span></div>
<p>Note the hardware MAC address: 00:40:63:f5:f9:3c (and remember that those digits and colons are nothing at all to do with IPv6 notation &#8211; they are bog-standard, traditional L2 MAC address format)</p>
<div>
<p>Now look at the last part of the IPv6 link address: you will see that there is more than a passing resemblance between them &#8211; although also note that they are not identical either. The details of how one is morphed in to the other is not of direct concern to us &#8211; all we need to know here is that one follows from the other.</p>
<h3>A complete example</h3>
<p>Here&#8217;s one I prepared earlier&#8230;.. <img src='http://www.ipsidixit.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  This is the output from <em>ifconfig</em> on my host system, after the main interface has been fully configured and all addresses allocated:</p>
</div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">Link encap:Ethernet  HWaddr 00:16:3e:2e:50:36 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet addr:217.70.191.54  Bcast:217.70.191.255  Mask:255.255.252.0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 addr: fe80::216:3eff:fe2e:5036/64 Scope:Link</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 addr: 2001:4b98:41::d946:bf36:54/64 Scope:Global</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX packets:122352 errors:0 dropped:0 overruns:0 frame:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> TX packets:68714 errors:0 dropped:0 overruns:0 carrier:0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> collisions:0 txqueuelen:1000 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> RX bytes:34644771 (34.6 MB)  TX bytes:62489400 (62.4 MB)</span></div>
<p>What have we got? The interesting parts break down as follows:</p>
<ol>
<li>The interface has a L2 MAC address of <span style="font-family: 'courier new';">00:16:3e:2e:50:36</span></li>
<li>The IPv4 addressing is as it always has been &#8211; No change there.</li>
<li>We have a Link address of <span style="font-family: 'courier new';">fe80::216:3eff:fe2e:5036</span> which should now look familiar: the <em>fe80:</em> prefix and the appearance of the L2 MAC address.</li>
<li>And we now have a Global address of <span style="font-family: 'courier new';">2001:4b98:41::d946:bf36:54</span> which is familiar at least in so much as it has a prefix of <em>2001:</em> The rest of the address&#8217;s derivation is not of direct concern here. (In fact, after the ISP-specific part, other elements of it are derived from VLAN addresses and other such stuff. No matter.)</li>
</ol>
<h2>Goodbye <em>ifconfig</em>, hello <em>ip</em></h2>
<p>Since time immemorial Linux users have been familiar with the command <em>ifconfig</em>. Thus far in this document I&#8217;ve used it too, for the sake of familiarity. But dear <em>ifconfig</em> has actually been deprecated now for many years. It lives on, and we all still use it, but with the advent of IPv6 it does now seem an appropriate moment to bid it goodbye. It&#8217;s time to use the <em>ip</em> command, in its many forms. While it&#8217;s true that <em>ifconfig</em> can still achieve <em>most</em> of what is required, it sometimes falls short. Also, using <em>ip</em> let&#8217;s us more clearly and easily distinguish between IPv4 and IPv6, which is maybe not a bad thing!</p>
<p>Compare the <em>ifconfig</em> output from above with a couple of examples of the <em>ip</em> command:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip addr show dev eth0</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> link/ether 00:16:3e:2e:50:36 brd ff:ff:ff:ff:ff:ff</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet 217.70.191.54/22 brd 217.70.191.255 scope global eth0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 2001:4b98:41::d946:bf36:54/64 scope global </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 fe80::216:3eff:fe2e:5036/64 scope link </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<p>This is analogous to the simple <em>ifconfig</em>: we&#8217;ve got L2 MAC, IPv4, and a couple of IPv6 addresses showing.</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip -4 addr show dev eth0</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet 217.70.191.54/22 brd 217.70.191.255 scope global eth0</span></div>
<p>Look how much neater that is, even just for IPv4: no L2 MAC, no IPv6, just the IPv4-related information.</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip -6 addr show</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 16436 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 ::1/128 scope host </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qlen 1000</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 2001:4b98:41::d946:bf36:54/64 scope global </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 fe80::216:3eff:fe2e:5036/64 scope link </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<p>And similarly here: we just get IPv6-related information, and nothing else.</p>
<div>It may take a little effort to get used to it, but it&#8217;s worth the effort. And feel free to make use of <em>alias</em> to make life even easier. If you tire of typing <em>-6</em> after each invocation of IP, then do something like:</div>
<p style="padding-left: 30px;"><span style="font-family: 'Courier New';">alias ip6=&#8217;ip -6&#8242;</span></p>
<p>and then you can just enter:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ip6 addr show</span></div>
<p>which is quite neat.</p>
<h2>Key subsystems</h2>
<p>The last part of this <em>IPv6 Basics</em> section is to introduce the functional building blocks within Linux which seem to get mentioned in connection with IPv6.</p>
<p>We now know about IPv6 addresses types that matter to us, we have met the command(s) we will use to inspect and manipulate things such as interfaces, routes and so on. We have also assumed that there is something similar to IPv4 <em>iptables </em>(and we&#8217;ll come back to that in some detail later as to how we actually use <em>iptables</em> under IPv6). However what subsystems such as DHCP exist and are of interest to us? When reading up on IPv6 Linux implementation one comes across the following mentioned frequently, and you may quickly form the impression that they are three important elements in an IPv6 firewall/router. They are:</p>
<ul>
<li>dhcp6c</li>
<li>dhcp6s</li>
<li>radvd</li>
</ul>
<h3>dhcp6c</h3>
<p>dhcp6c is a Linux DHCP IPv6 client. It is directly comparable to the IPv4 dhclient or dhclient3. It will, for a nominated interface, call out and ask for an IPv6 address which it can allocate to that interface. It may also, optionally, pick up other information, typically DNS-related.</p>
<h3>dhcp6s</h3>
<p>dhcp6s is a Linux DHCP IPv6 server. It is comparable to the IPv4 dhcpd or, in my network, dnsmasq. Just as in the IPv4 environment, it hands out addresses to other devices and, optionally, other information such as DNS data.</p>
<h3>radvd</h3>
<p>radvd is a Router Advertisement Daemon. This is less easy to directly compare to the IPv4 environment. It can hand out, to requesting devices, an IPv6 prefix (not a full address&#8230;) and a default route to be used. From this the receiving device can then automatically decide upon a host portion to add to the prefix to give it a full IPv6 address. So at first sight, it seems to be a rather inadequate imitation of a DHCP server!</p>
<p>One might very easily conclude that all three are required. After all, we may well use a DHCP client on the Internet side, and a DHCP server for the private network sounds pretty much essential. And a router advertisement daemon? Not entirely sure what it is, but gets a lot of mentions so I probably need that too! In actual fact the only one of these you are likely to need is readvd. You might need any combination of them, depending upon your precise circumstances. But probably not.</p>
<p><span style="font-size: medium;"><br />
</span></p>
<h2>DHCP client I get, but what&#8217;s with DHCP server <em>versus</em> radvd?</h2>
<p>This is an area of considerable confusion! When bouncing around Google trying to find information on setting up IPv6 one minute we appear to be required to use DHCP server, the next minute we appear to need radvd. Which is which and when do I use them? Do I need both?</p>
<p>Well, the answer to the last question, &#8220;Do I need both of them?&#8221;, it &#8220;Probably not, but you might&#8230;&#8221;</p>
<p>Coming from familiarity with the world of IPv4 one instinctively tends to feel comfortable with the concept of dhcp6s &#8211; and while it can be used, radvd may well be simpler and easier in practice. Or, maybe, both&#8230; The attraction of rad is that the server does not need to concern itself with any state: no records of addresses allocated &#8211; since it dos not allocate any. It just says &#8220;Hey, this is the prefix, work the rest out for yourelf.&#8221; which is attractively simple! The DHCP server alternative has to remember which address is where and when. The case where you might want both would be where you want to have rad handle the job of initiating address allocation, and then have DHCP pick up to add some icing on the cake: DNS information being the common case.</p>
<p>And us here? We&#8217;re going to go with the simpler case, and have radvd handle the job of responding to IPv6-capable devices within our internal network and tell them just enough to allocate addresses themselves and use a default route.</p>
<p>So it actually seems to come down to a pair of subsystems being required:</p>
<ul>
<li><em>dhcp6c</em> talks out to the ISP to handle &#8220;outside&#8221; IPv6 addressing.</li>
<li><em>radvd</em> talks internally to all devices to handle &#8220;inside&#8221; IPv6 addressing.</li>
</ul>
<p>Well, maybe&#8230; But in these early days of IPv6 there is far from a standard view of how these things are to work. And, as I discovered, your ISP may not actually themselves offer an IPv6 DHCP server at all! In my case that was the situation, although I have little doubt that as time progresses and IPv6 implementations mature such services will become more standard.</p>
<p>But for now, my implementation will be reduced down to simply running radvd on the firewall, with the IPv6 configuration on Internet side being handled semi-statically.</p>
<p>Just one subsystem to be used: radvd. No DHCP client. No DHCP server. Who said IPv6 was complicated?!?</p>
<h1>Setting up the firewall box</h1>
<p>So at last we get to the actual practicalities of getting IPv6 up and running on the home firewall. The system in question is a Ubuntu-based device. The differences for another Linux system should be fairly negligible (package names maybe, some config file locations, etc.)</p>
<h2>Packages to install</h2>
<p>All we need to install is radvd if its not already present. Under Ubuntu something like:</p>
<pre style="padding-left: 30px;">sudo apt-get install radvd</pre>
<p>should do the job.</p>
<h2>Careful now&#8230;.</h2>
<p>And already we come to potentially our first issue!!! Once radvd is up and running on the firewall it will, potentially, start chatting to devices on the home network which are, by default, on the look out for IPv6 routers. Whether it does this by default depends upon the installed configuration file used, and which interface points where, but it&#8217;s a real possibility. And that may not be entirely a good thing. Be on the look out for workstations suddenly getting really really slow when, for example, browsing the web. I would suggest disabling IPv6 on any devices which may be susceptible to it. There are numerous ways to do that. On Windows in all its flavours? I have not the faintest idea. Under Linux? <a id="b2v8" title="Here are some suggestions" href="http://www.ubuntugeek.com/how-to-disable-ipv6-in-ubuntu.html"><span style="color: #000000;">Here are some suggestions</span></a>. Depending upon what is on your home network this may not be required, but if you do run in to the &#8220;slow web&#8221; issue, be alert to it.</p>
<p>Technical note: for the curious, if you do hit the IPv6 crawl of death issue, it&#8217;s actually due to certain services on clients stations being IPv6 aware and thus trying to resolve DNS requests via IPv6. They try, take an age to fail, and eventually fall back to IPv4. But it&#8217;s ugly. I wish I could say that I foresaw the issue and planned accordingly. More truthful would be to say that during my diddling around with radvd I got loud complaints from another user on the home network&#8230; <img src='http://www.ipsidixit.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Setting up the connection towards the Internet&#8230; no hang on, actually not yet&#8230;</h2>
<p>The first task is to get the public (in my case eth0) interface up and running IPv6. Before actually doing that we need to pause for a moment and consider the implications of what might happen if we indeed succeed in bringing up the IPv6 ISP-connected interface! We are then wide-open to the world, and just asking to be attacked. The only sensible thing to do is to first set up an IPv6 firewall to provide some level of protection before we throw ourselves open.</p>
<p>Sorry. But that&#8217;s life. Of course if your public-side connection is already protected via some firewall, then you can skip this. But it probably isn&#8217;t, so pay attention. With IPv4 most home networks make use of, by necessity, NAT. While not done for reasons of security it does nonetheless provide as a side-effect a modest level of security in so far as it tends to block unsolicited incoming connections. So even with a poorly configured firewall under IPv4, the use of NAT hides a multitude of nasties from us. But in the brave new world of IPv6 one hugely important difference from IPv4, but one that everyone seems to gloss over, is that NAT is not required. And indeed since not required, it does not exist. All IPv6 devices on the &#8220;inside&#8221; network will have, in effect, public addresses. No port-forwarding, no NAT, none of that. And while that&#8217;s actually a very refreshing thing in general (NAT and large firewalls are a real pain) it does means we can no longer rely on the default level of safety that NAT provides. A tightly configured firewall is absolutely essential.</p>
<p>To drive IPv6 <em>iptables</em> I use <em>shorewall6</em>. I highly recommend it. Here I am going to run through, without too much explanation, the steps to set up a very basic &#8220;block almost everything except a bit of stuff for testing&#8221; IPv6 firewall on the system. Here goes.</p>
<p>Install the package:</p>
<pre style="padding-left: 30px;">apt-get install shorewall6</pre>
<p>The basic level of configuration then has to take place. Navigate to the configuration files:</p>
<pre style="padding-left: 30px;">cd /etc/shorewall6/</pre>
<p>Set up the following files in a similar manner as shown here:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong><span style="text-decoration: underline;">interfaces</span></strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ext     eth0     -</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">int     eth1     -</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong><span style="text-decoration: underline;">zones</span></strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">int     ipv6</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ext     ipv6</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">fwall   firewall </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><span style="text-decoration: underline;"><strong>policy</strong></span></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">#Source  Dest    Policy     Log     Burst/Limit</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">fwall     all     DROP</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">int       all     DROP</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ext       all     DROP</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">all       all     DROP</span></div>
<p style="padding-left: 30px;"><span style="font-family: 'Courier New';"> <span style="text-decoration: underline;"><strong>rules</strong></span><br />
# Allow only ping &#8211; for testing<br />
</span></p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ACCEPT     ext     fwall     ipv6-icmp</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ACCEPT     fwall     ext     ipv6-icmp</span></div>
<p style="padding-left: 30px;"><span style="font-family: 'Courier New';"><br />
Within <span style="text-decoration: underline;"><strong>shorewall6.conf</strong></span> ensure these lines as as follows:<br />
.<br />
.<br />
.<br />
STARTUP_ENABLED=Yes<br />
.<br />
.<br />
.<br />
IP_FORWARDING=Keep<br />
</span></p>
<p>What we have there is a minimal firewall configuration, which blocks absolutely everything except pings to and from the firewall box itself.</p>
<p>Start up the firewall with e.g.:</p>
<pre style="padding-left: 30px;">/etc/init.d/shorewall6 start</pre>
<p>And then</p>
<pre style="padding-left: 30px;">shorewall6 show config</pre>
<p>should give you a pretty lengthy IPv6 <em>iptables</em> config.</p>
<p>So, with precautions now in place, we may proceed.</p>
<p>[EDIT: shorewall6 and logging may or may not be an issue... See my article here: <a href="http://www.ipsidixit.net/2010/02/25/231/">http://www.ipsidixit.net/2010/02/25/231/</a>]</p>
<h2>OK, <em>finally</em> setting up the connection towards the Internet&#8230;</h2>
<p>Here is the starting point, with an automatically assigned, MAC-derived, link address:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip6 add show dev eth0</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qlen 1000</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 fe80::240:63ff:fef5:f93c/64 scope link </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forev</span>er</div>
<h2>Configuring the addressing</h2>
<p>My ISP is free.fr (a French ISP) From them I have a fixed IPv4 address and a fixed IPv6 address. My IPv6 address prefix is 2a01:e35:8b25:7ea0::/64 which looks pretty random but of course is not.</p>
<p>The part <em>2a01:e3</em> is, from previous knowledge, a global unicast prefix (the <em>2xxx:</em> indicates that) and the full form <em>2a01:e3</em> is the RIPE-allocated prefix used by Free. The next part, <em>58 b2 57 ea</em>? Well, I write is deliberately in that format to show that it breaks down to (decimal): 88 178 87 234. This, by no coincidence at all, is my current IPv4 address! Of course Free mapping subscribers&#8217; IPv4 addresses into their IPv6 prefix is entirely arbitrary on their part. It indeed seems like a good idea, but is absolutely not required. In the future, for example, IPv4 addresses will not be used in the first place, so no such mapping would be possible.</p>
<p>Of course their network prefix is, as per standard IPv6, 64 bits in length. So the second 64 bits (the host portion) is entirely mine to use as I see fit. That is a seriously large amount of address space, all <em>globally</em> routable, and all entirely mine to use as I wish.</p>
<p>Since my ISP themselves run radvd (or some equivalent) on their routers, when everything is IPv6 enabled on my firewall system, the Internet-facing interface, eth0, should automatically pick up the required prefix and use it. However in addition to the ISP-prefix + MAC-derived host portion I also want a simplified address on the interface. It&#8217;s absolutely not required, but I want it to make my life slightly easier.</p>
<p>So prior to the reboot I edit</p>
<pre style="padding-left: 30px;">/etc/network/interfaces</pre>
<p>and add a section as follows:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">iface eth0 inet6 static</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> address 2a01:e35:8b25:7ea0::1</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> netmask 64</span></div>
<p>With this I am specifying that <em>in addition</em> to any automatic address the interface picks up, I also want to statically assign a PREFIX+::1 address to the interface.</p>
<p>After the boot I inspect the results and see:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip6 addr show dev eth0</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qlen 1000</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c/64 scope global dynamic </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft 86369sec preferred_lft 86369sec</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 2a01:e35:8b25:7ea0::1/64 scope global tentative </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> inet6 fe80::240:63ff:fef5:f93c/64 scope link </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> valid_lft forever preferred_lft forever</span></div>
<p>Excellent! We see the <em>link</em> address that was there previously. And now we have two <em>global</em> addresses. The one marked <em>dynamic</em> which is clearly the MAC-derived address (notice how the prefix is as expected &#8211; this was picked up not from any of our config but from a remotely received router advertisement from the ISP) and the one marked <em>tentative</em> which is as manually configured by me.</p>
<h2>Testing</h2>
<p>When we set up the shorewall6 firewall, everything was marked as blocked except for ipv6-icmp. Ostensibly this was to permit what we are about to do now, a ping test, which makes use of ICMP. However it was also in the knowledge that the Router Advertisements which we picked up from the ISP, and which gave us the prefix to be used for the dynamic address, are also, coincidentally, ICMP6. Two birds with one stone: we allow pings to go in and out, and also allow IPv6 Router Advertisements to pass unhindered.</p>
<p>So, to test our interface, let&#8217;s try something:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ping6 ipv6.google.com</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">PING ipv6.google.com(2a00:1450:8006::69) 56 data bytes</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">64 bytes from 2a00:1450:8006::69: icmp_seq=1 ttl=54 time=39.4 ms</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">64 bytes from 2a00:1450:8006::69: icmp_seq=2 ttl=54 time=38.4 ms</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">64 bytes from 2a00:1450:8006::69: icmp_seq=3 ttl=54 time=35.6 ms</span></div>
<p>It works!!</p>
<p>Which is great, but where&#8217;s the routing and so forth that is being used here? Let&#8217;s look at that too:</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip6 neigh show</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">fe80::207:cbff:fea5:1a68 dev eth0 lladdr 00:07:cb:a5:1a:68 router REACHABLE</span></div>
<p>That&#8217;s kind of like our IPv4 ARP table: where is, in Layer 2 terms, the next hop? And we see it at the given link address, with a corresponding MAC address, and a marker of REACHABLE. That REACHABLE can change as entries get set up and then age out, and values such as DELAY or STALE might also be seen.</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip6 route show</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">2a01:e35:8b25:7ea0::/64 dev eth0  proto kernel  metric 256  expires 85889sec mtu 1480 advmss 1420 hoplimit 0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">fe80::/64 dev eth1  proto kernel  metric 256  mtu 1500 advmss 1440 hoplimit 0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">fe80::/64 dev eth0  proto kernel  metric 256  mtu 1480 advmss 1420 hoplimit 0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">default via fe80::207:cbff:fea5:1a68 dev eth0  proto kernel  metric 1024  expires 1283sec mtu 1480 advmss 1420 hoplimit 64</span></div>
<p>Note that the default route is, automatically, via the adjacent router we learned about from the router advertisement.</p>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>ip6 monitor</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">192.168.0.3 dev eth1 lladdr 00:18:8b:86:f3:52 STALE</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">ff02::1:fff5:f93c via ff02::1:fff5:f93c dev eth0  metric 0 </span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"> cache  mtu 1480 advmss 1420 hoplimit 0</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">fe80::207:cbff:fea5:1a68 dev eth0 lladdr 00:07:cb:a5:1a:68 router REACHABLE</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">192.168.0.3 dev eth1 lladdr 00:18:8b:86:f3:52 STALE</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">fe80::207:cbff:fea5:1a68 dev eth0 lladdr 00:07:cb:a5:1a:68 router STALE</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">.</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">.</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">.</span></div>
<div>The <em>monitor</em> command is quite interesting. It shows the significant state changes as they occur. Here we can see IPv4 ARP entries aging out, and IPv6 neighbors becoming active and then stale.</div>
<div>And of course to really shine a light on what&#8217;s happening, we could do something like:</div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';"><strong>tcpdump ip6 -i eth0</strong></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">&#8230;</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:58.856832 IP6 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c &gt; 2a00:1450:8006::6a: ICMP6, echo request, seq 1, length 64</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:58.897135 IP6 fe80::207:cbff:fea5:1a68 &gt; ff02::1:fff5:f93c: ICMP6, neighbor solicitation, who has 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c, length 32</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:58.897305 IP6 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c &gt; fe80::207:cbff:fea5:1a68: ICMP6, neighbor advertisement, tgt is 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c, length 32</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:58.897664 IP6 2a00:1450:8006::6a &gt; 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c: ICMP6, echo reply, seq 1, length 64</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:59.856858 IP6 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c &gt; 2a00:1450:8006::6a: ICMP6, echo request, seq 2, length 64</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'Courier New';">16:00:59.892915 IP6 2a00:1450:8006::6a &gt; 2a01:e35:8b25:7ea0:240:63ff:fef5:f93c: ICMP6, echo reply, seq 2, length 64</span></div>
<p style="padding-left: 30px;">.<br />
.<br />
.</p>
<p style="padding-left: 30px;">So at this point we now know that we have basic IPv6 connectivity in and out of the firewall.</p>
<h2>Summary</h2>
<p>What we&#8217;ve done here, after a quick recap of IPv6 addressing techniques, is to:</p>
<li style="padding-left: 30px;">Enable a default &#8220;block almost everything&#8221; IPv6 firewall.</li>
<li style="padding-left: 30px;">Understand the three major subsystems which might b used on an IPv6 router/firewall (<em>dhcp6c, dhcp6s, radvd</em>)</li>
<li style="padding-left: 30px;">Understand that we possibly only need <em>radvd</em> and to install it on the firewall.</li>
<li style="padding-left: 30px;">Assign an automatic address to our Internet-facing interface, based upon a received router advertsiement.</li>
<li style="padding-left: 30px;">Assign a static address to the same interface, in addition to the automatic address.</li>
<li style="padding-left: 30px;">See how we can examine IPv6 information relating to interfaces, route tables and neighbours.</li>
<li style="padding-left: 30px;">Monitor IPv6 activity for troubleshooting purposes.</li>
<li style="padding-left: 30px;">Do a simple ping test to confirm that we have basic IPv6 connectivity from the firewall out to the IPv6-Internet.</li>
<p>In the next part I will look at extending IPv6 inside the private network, and examining options for moving the VPN to a native IPv6 implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/02/24/228/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bless me father for I have punched</title>
		<link>http://www.ipsidixit.net/2010/02/04/bless-me-father-for-i-have-punched/</link>
		<comments>http://www.ipsidixit.net/2010/02/04/bless-me-father-for-i-have-punched/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 14:43:57 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/?p=224</guid>
		<description><![CDATA[Several newspapers report today (e.g. here and here) that a British judge this week chose not to jail a violent criminal because he was religious.
The judge said &#8220;You are a religious man and you know this is not acceptable behaviour.&#8221;
The fact that the judge in question is Cherie Blair, wife of former-prime minister Tony Blair, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.ipsidixit.net/wp-content/2010/02/cherie-blair-415x350.jpg"><img class="alignleft size-thumbnail wp-image-225" style="margin-left: 15px; margin-right: 15px; margin-top: 10px; margin-bottom: 10px;" title="cherie-blair-415x350" src="https://www.ipsidixit.net/wp-content/2010/02/cherie-blair-415x350-150x150.jpg" alt="" width="150" height="150" /></a>Several newspapers report today (e.g. <a href="http://goo.gl/t7j3" target="_blank">here</a> and <a href="http://goo.gl/fjuR" target="_blank">here</a>) that a British judge this week chose not to jail a violent criminal because he was religious.</p>
<p>The judge said &#8220;You are a religious man and you know this is not acceptable behaviour.&#8221;</p>
<p>The fact that the judge in question is Cherie Blair, wife of former-prime minister Tony Blair, just confirms that this couple appear able to justify almost anything in their own minds based upon their beliefs and superstitions.</p>
<p>Apparently the UK&#8217;s National Secular Society has complained about it, but in true British don&#8217;t-kick-up-a-fuss tradition not much more will happen.</p>
<p>So remember: before violently assaulting someone in Britain, say a prayer. No, not to ask for any sort of forgiveness for what you will do, just pray that you get this lunatic women as your judge afterwards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/02/04/bless-me-father-for-i-have-punched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leave them kids alone</title>
		<link>http://www.ipsidixit.net/2010/02/02/221/</link>
		<comments>http://www.ipsidixit.net/2010/02/02/221/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 11:39:05 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2010/02/02/221/</guid>
		<description><![CDATA[Pope Benedict XVI is apparently set to visit Britain soon. However he has also decided to attack the laws giving gay couples similar rights to married (heterosexual) couples, as a variation on the church&#8217;s more general disgust with anyone who does not share their own twisted sexual views
Aware that this is unpopular (the laws have widespread [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.ipsidixit.net/wp-content/2010/02/pope.jpg"><img class="alignleft size-thumbnail wp-image-222" style="margin-left: 20px; margin-right: 20px; margin-top: 10px; margin-bottom: 10px;" title="pope" src="https://www.ipsidixit.net/wp-content/2010/02/pope-150x150.jpg" alt="" width="150" height="150" /></a>Pope Benedict XVI is <a id="hnwh" title="apparently set to visit Britian soon" href="http://news.bbc.co.uk/2/hi/uk_news/8492597.stm">apparently set to visit Britain soon</a>. However he has also decided to attack the laws giving gay couples similar rights to married (heterosexual) couples, as a variation on the church&#8217;s more general disgust with anyone who does not share their own twisted sexual views</p>
<p>Aware that this is unpopular (<a id="r-l_" title="Economist link re 2008 Social Attitudes Survey" href="http://www.economist.com/world/britain/displaystory.cfm?story_id=15407965"><span style="color: #000000;">the laws have widespread support</span></a>) he has chosen a rather devious and obfuscated line of attack.</p>
<p>He singles out for criticism the UK&#8217;s Equality Bill, currently passing through Parliament. He tells us the effect of some of the legislation designed to achieve this goal has been to impose unjust limitations on the freedom of religious communities to act in accordance with their beliefs. <em>Unjust</em>. That&#8217;s the key word there. And then goes on:</p>
<div><span style="font-family: verdana, helvetica, arial, sans-serif; color: #464646;"> </span></div>
<blockquote><p>&#8220;In some respects it actually violates the natural law upon which the equality of all human beings is grounded and by which it is guaranteed.&#8221;</p></blockquote>
<div><span style="font-family: verdana, helvetica, arial, sans-serif; color: #464646;"> </span><span style="font-size: x-small;"> </span></div>
<p>Of course the concept of Natural Law is wonderfully vague. One assumes he is referring to some or other Aquinas-style philosophy of everything is OK, so long as it is OK with God too. However that aside, what is he really objecting to? Well, that is made fairly clear by further Church-comment on the matter. Firstly we are told that:</p>
<div><span style="font-family: verdana, helvetica, arial, sans-serif; color: #464646;"> </span><span style="font-size: x-small;"> </span></div>
<blockquote><p>Religious leaders have voiced concern that the Equality Bill may force churches to employ sexually active gay people and transsexuals when hiring staff other than priests or ministers.</p></blockquote>
<p><span id="more-221"></span>I love the language. &#8220;Forcing them to employ gay people.&#8221; For them, gay = evil. Well, more accurately sex = evil. Gay  = double evil. Which is all the more amusing considering the proportion of Catholic priests who themselves are gay.</p>
<p>Here&#8217;s a suggestion Mr Pope: if you&#8217;re so worried about sexual deviance, why don&#8217;t you stop fretting about homosexuals and instead cease employing and empowering paedophiles (gay <em>and</em> straight)? Clear out the layers of child abusers and their protectors who still litter your organisation and then I will at least take as non-hypocritical your objection to what you view as &#8220;sexual deviance&#8221; (although let me be unequivocally clear: I do not view homosexuality as any sort of &#8220;deviance&#8221; &#8211; what consenting adults choose to do in private is none of my business, except in so far as I robustly defend their right to do it)</p>
<h2>Adoption</h2>
<p>The other subtle line of gay-bashing from the Catholic Church yesterday concerns the desire for Catholic adoption agencies to function outside of the law. The proposed act would not allow child adoption agencies to discriminate against gay couples when considering their suitability as adoptive parents. Let&#8217;s get out of the way the issue of whether or not gay couples should adopt children: personally I have no issue with it at all. For me, the suitability of a couple (or indeed a single person) to care for a child has nothing to do with what they do in the bedroom. It has everything to do with other factors far removed from their sexuality. However I do not have a great objection, as such, to those who think that the ideal for children is father-figure + mother-figure, even if I do not agree with it. And, given that, it may seem that I would thus not object to a Catholic adoption agency holding similar views and wishing to implement them, despite not actively supporting them myself.</p>
<p>However what this issue really raises is actually glossed over most of the time: just what <em><strong>is</strong></em> a &#8220;Catholic adoption agency&#8221;? Why on earth does the UK have religiously-affiliated adoption agencies? Adoption is a childcare issue. Adoption is a social issue. Adoption is absolutely not a religious issue.  The very fact that adoption agencies are religiously affiliated infuriates and worries me, since there is only one reason I can think of why they are so: it is to perpetuate their religious beliefs, using desperately vulnerable children as the weapon of choice.</p>
<p>The Catholic church&#8217;s argument is intellectually offensive: Catholics run adoption agencies. Catholics think gay parents are wrong. Therefore Catholics don&#8217;t want to allow them to adopt children. And, to boot, if you try and stop us behaving in that manner we&#8217;ll cry &#8220;Religious oppression!&#8221;</p>
<p>So not only does the church wish to use orphans and the parent-less as its foot-soldiers, it wants to be above the law too. This is not about religious freedom at all. No one requires that an adoption agency be religiously affiliated. Would it be acceptable for the Catholic church to run some other business and practice their discrimination? How about a Catholic garage, but if you are gay you can&#8217;t have your car mended there? People would say &#8220;Oh, but don&#8217;t be silly.&#8221; But that is exactly what is happening here. A business or charity setting itself up to provide a service BUT only if it is allowed to be outside both the law and the commonly-held standards of morality within the country. And it&#8217;s all OK because it&#8217;s a religious belief. It staggers me that people allow it.</p>
<h2>Go away</h2>
<p>The only glimmer of good news is that reports indicate that already about half of all Catholic adoption agencies in the UK have shut down due to their inability to comply with the current and future legislation. And I say hooray to that. Parent-less <a id="gyii" title="children do not need religious bigotry and hatred" href="http://richarddawkins.net/articles/118"><span style="color: #000000;">children do not need religious bigotry and hatred</span></a> guiding their future. To the Pope I say: Take your absurd beliefs and your sick, twisted morality and keep it to yourself. Preach all you like to a consenting adult audience. Our society defends your right to do that. But by definition that means keep away from those of us who do not consent to hear you or have our lives affected by you, and leave our children alone, as they cannot even give consent.</p>
<p>If you care so much about children, stop your priests from abusing them</p>
<p>This has nothing to do with true religious freedom, which is about who or what to worship, if anything, and in a manner of your choosing. It is rather all about intolerance, hatred and superstition. This man is free to visit the UK, but he should be loudly condemned by any right-thinking person.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/02/02/221/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Passion for nails</title>
		<link>http://www.ipsidixit.net/2010/01/11/218/</link>
		<comments>http://www.ipsidixit.net/2010/01/11/218/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 13:48:45 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2010/01/11/218/</guid>
		<description><![CDATA[I love the Internet. Not for the more typical use of finding what you need to know quickly and easily, but rather for the effortless ability to tell you what you did not need to know.
In the space of ten minutes or so today I moved from fruit juice to triclavianism, via the Cathars.
Started with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.ipsidixit.net/wp-content/2010/01/420px-Angel_Holding_the_Instruments_of_the_Passion.jpg"><img class="alignleft size-thumbnail wp-image-219" style="margin-left: 20px; margin-right: 20px; margin-top: 10px; margin-bottom: 10px;" title="420px-Angel_Holding_the_Instruments_of_the_Passion" src="https://www.ipsidixit.net/wp-content/2010/01/420px-Angel_Holding_the_Instruments_of_the_Passion-150x150.jpg" alt="" width="150" height="150" /></a>I love the Internet. Not for the more typical use of finding what you need to know quickly and easily, but rather for the effortless ability to tell you what you did <em>not</em> need to know.</p>
<p>In the space of ten minutes or so today I moved from fruit juice to triclavianism, via the Cathars.</p>
<p>Started with a quick visit to Wikipedia to get some information on the chemical composition of passion-fruit juice. But then you just can&#8217;t resist haring off down those links that you find and end up in the most byzantine (tee hee) backwaters of medieval theology&#8230; Or at least I can&#8217;t.</p>
<p>So my dull juice enquiry ends up with me discovering that triclavianism was declared a sin by Pope Innocent III, much to the annoyance of the Albigenses and the Waldensians, who heretically insisted that only <em>three</em> nails were used to hang Jesus from the cross, and he got a spear in the <em>left</em> side. The Pope&#8217;s infallible word was that <em>four</em> nails were used and he got speared on the <em>right</em> side.</p>
<p>Which is wonderful enough. Until you cross-reference to <a id="zuh2" title="The Catholic Encyclopedia" href="http://www.newadvent.org/cathen/" target="_blank"><span style="color: #000000;">The Catholic Encyclopedia</span></a> (&#8220;Copyright © 2009 by Kevin Knight. Dedicated to the Immaculate Heart of Mary.&#8221;), subsection &#8220;Holy Nails&#8221;, where we discover that there are apparently still in existence up to <em>30</em> of the original nails used.</p>
<p>Who&#8217;d have thought it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2010/01/11/218/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BMW France &#8211; To be avoided</title>
		<link>http://www.ipsidixit.net/2009/12/10/204/</link>
		<comments>http://www.ipsidixit.net/2009/12/10/204/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 07:49:53 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[bmw]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[customer]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2009/12/10/204/</guid>
		<description><![CDATA[More fine customer service from the French arm of a large company&#8230;
BMW France &#8211; you just lost my business. A few weeks ago my wife bought a new car. A BMW. Fine car. Superbly designed and tremendous quality. As a car, we are delighted with it.
Next year I&#8217;ll be replacing my car. I had my [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-211" style="margin-left: 20px; margin-right: 20px; margin-top: 10px; margin-bottom: 10px;" title="bmw" src="https://www.ipsidixit.net/wp-content/2009/12/bmw-150x95.png" alt="bmw" width="150" height="95" />More fine customer service from the French arm of a large company&#8230;</p>
<p>BMW France &#8211; you just lost my business. A few weeks ago my wife bought a new car. A BMW. Fine car. Superbly designed and tremendous quality. As a car, we are delighted with it.</p>
<p>Next year I&#8217;ll be replacing my car. I had my eye on a sparkling new BMW estate. But so long as I have to buy it from BMW France, it&#8217;s not going to happen. Shame, as I really do like the cars. I just can&#8217;t stand the company. In the short time we&#8217;ve had the new car I&#8217;ve had two major issues. Neither concern the quality of the car itself.<span id="more-204"></span></p>
<p>BMW France have a typical finance package for new cars: rental for 3 years, then option to purchase. And, like many of their competitors, sometimes they offer that with the extra attraction of a &#8220;No money down&#8230;&#8221; package. Fantastic. We&#8217;ll have that please. It&#8217;s then that the dealer starts to play games&#8230;</p>
<h3>Gissus ya focking money</h3>
<p>Now I admit that BMW France do not directly benefit (as far as I can tell) from the scam they operate. But I also have no doubt at all that it&#8217;s conducted with the full knowledge and connivance of HQ. They need a &#8220;deposit&#8221; to secure the order. Never mind the clearly printed terms &amp; conditions from BMW. They want 10% of the full purchase price to proceed with the order.</p>
<p>Frankly I was about to walk away then, but since my wife was really keen on the car I kept quiet and paid the money, with the dealer solemnly promising me it gets returned on the very same day the car is delivered. Needless to say that&#8217;s a load of bullshit. They lie. They have no intention of returning the money than. It took two weeks of waiting and getting increasingly pissed with the dealer before the money comes back, and then with not a word of apology or explanation for the delay. Still, you can see the attraction for the BMW dealer: not only does he sell a car but he gets the customer to lend him a large lump of money, interest free, for a period of some weeks or months. Good scam.</p>
<h3>Dear customer. Screw you.</h3>
<p>OK. So the purchase was over. At least she can enjoy the car now? Disaster struck: after less than a month the car suffers a puncture. Bad luck. Hard to tell what did it, but we think it was some large-ish stones that had fallen on to the road. Now, a short detour: like many BMWs, this one has no spare tyre. Also, oddly, it does not have run-flat tyres either. It has a &#8220;temporary reinflation&#8221; kit to repair the type and get you home or to the nearest garage. Not wildly keen on that, but that&#8217;s life. Trouble was in this case that at least part of the tire damage was to the sidewall, kinda where it meets the bottom of the tire. That was clearly visible as damaged. Maybe more &#8211; who can tell? Anyway, you don&#8217;t try a temporary repair on a tyre with a suspect sidewall.</p>
<p>What to do? Well, we had no worries actually: when we bought the car we had asked about the lack of a spare wheel. &#8220;No problem&#8221; the dodgy dealer tells us, and he then showed us chapter and verse in the handbook that comes with the car. The BMW handbook assures you that if you suffer a puncture (or indeed any other sort of failure &#8211; but it singles out punctures for explicit mention) you are in good hands: just call the number given and all will be well. You&#8217;ll be rescued, helped, sorted out and generally taken care of.</p>
<p>Fantastic! So despite being still shaken up by the puncture, my wife (Woman. On her own. Unable to move her car.) calls the BMW care-line for help. Bottom line from BMW: &#8220;Go fuck yourself. Not our problem.&#8221; I paraphrase slightly &#8211; I don&#8217;t think they swore. The operator asked for details of the puncture. My wife is a helpful sort and describes it accurately, how the tyre is completely flat and how she can see damage to the sidewall as well. &#8220;Oh well, that&#8217;s not a puncture. That&#8217;s an *accident*. Speak to your insurance company about it. Goodbye.&#8221;</p>
<p>It would be funny if it wasn&#8217;t true. &#8220;That&#8217;s not a puncture. That&#8217;s an accident.&#8221; I am still unable to tell anyone what sort of puncture is NOT an accident. Presumably one you do on purpose?</p>
<h3>Hello Audi, Hello Mercedes. Hello anyone but BMW.</h3>
<p>So there we have it. My wife has a tremendous car, which she enjoys very much. Maybe you might buy one too? If you&#8217;re in France, good luck to you. You are expected to make an interest-free loan of an indefinite period to the dealer before you even get your car. And once you&#8217;ve got it the after-care you were promised is just non-existent. They&#8217;ve got your money and don&#8217;t give a flying shit about you anymore.</p>
<p>When I go car shopping for my new car in a few months time I&#8217;ll be anywhere but at the local BMW dealer. Maybe the others are just as bad? Well, we&#8217;ll see. They sure couldn&#8217;t be a lot worse. You conned me once BMW France. You won&#8217;t get a second chance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2009/12/10/204/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bit torrent web clients</title>
		<link>http://www.ipsidixit.net/2009/10/12/196/</link>
		<comments>http://www.ipsidixit.net/2009/10/12/196/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 09:02:45 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/2009/10/12/196/</guid>
		<description><![CDATA[As detailed in previous posts, I have a server at home which I use to download and seed torrents (and, before you ask, yes most of the torrent are indeed legal!!) The torrent-side of this server needs to be remotely accessible and manageable to me from a number of places, so some sort of web-interface [...]]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: #ffffff;"><img class="alignleft size-full wp-image-197" style="margin: 10px;" title="deluge32" src="https://www.ipsidixit.net/wp-content/2009/10/deluge32.png" alt="deluge32" width="64" height="64" />As detailed in <a href="http://www.ipsidixit.net/2008/01/14/home-server-intro/" target="_blank">previous posts</a>, I have a server at home which I use to download and seed torrents (and, before you ask, yes most of the torrent are indeed legal!!) The torrent-side of this server needs to be remotely accessible and manageable to me from a number of places, so some sort of web-interface is required.</span></p>
<p>There are surprisingly few good web-based applications out there to do this. For a long time I&#8217;ve been using <a id="un7e" title="torrentflux-b4rt" href="http://tf-b4rt.berlios.de/" target="_blank">torrentflux-b4rt</a> to provide a web-interface to <a id="tvpi" title="BitTornado" href="http://www.bittornado.com" target="_blank">BitTornado</a>. It&#8217;s a great piece of software, but I&#8217;m now stopping using it. It&#8217;s always been a bit bloated and heavy, but once set up the way you want it, this has not mattered too much.<span id="more-196"></span> The main reason I am moving away from it is that there are a few smaller issues which will, alas, never get fixed. From monitoring the project for some time it is clear that there is negligible development work taking place on it. For me the final issues were:</p>
<ul>
<li>one process per torrent &#8211; this get incredibly &#8220;expensive&#8221; in terms of CPU and, particularly, memory when one runs many torrents concurrently.</li>
<li>inability to manage bandwidth overall: I can set a per torrent bandwith cap, but not an &#8220;all torrent combined cap&#8221;. I&#8217;ve mitigated the effects of this in the past by using QoS under iptables, but it&#8217;s a headache I could do without.</li>
<li>minor bugs here and there. Since the development seems permanently stalled, maybe I could fix them myself? To that end I spent some time looking at the code-base. In line with the project&#8217;s history and breadth, I find a lump of code that might take weeks of effort to understand enough to fix some minor bugs. I do not have that time.</li>
</ul>
<p>So what to use?</p>
<p>I spent some hours dabbling with <a id="fk39" title="rutorrent" href="http://code.google.com/p/rutorrent/" target="_blank">rutorrent</a>, which sits on top of the <a id="k9z7" title="rtorrent" href="http://libtorrent.rakshasa.no/" target="_blank">rtorrent</a> client.It&#8217;s a nice GUI, but has a fatal flaw: it sits on top of rtorrent&#8230;&#8230;! Now rtorrent itself seems fine in isolation &#8211; a curses-based cli client (so kinda halfway between a pure cli and a GUI) but it just does not seem right. rtorrent cannot natively daemonize itself &#8211; it has to be started up under &#8220;screens&#8221; and then detached and left to run in a headless mode, while rutorrent find it and talk to it. This is really not nice or reliable.</p>
<p>So I&#8217;ve ended up, for now, using <a id="efp:" title="deluge" href="http://deluge-torrent.org/" target="_blank">Deluge</a>. This looks interesting! For a start it&#8217;s architected sanely: core daemon, with various GUI/cli options on top, of which the web interface interests me most. The web-server is self-contained (not a choice I prefer, but I understand why they do it) It has the key features such as &#8220;overall limits&#8221; for all torrents taken together. It&#8217;s also very &#8220;light&#8221;: one daemon process for all torrents. The web interface is far from perfect, but it shows signs of very active development in this direction. The AJAX-ified interface is not quite complete, but is very usable and shows great promise.</p>
<p>I&#8217;ve not looked at the code yet, so cannot comment on how accessible it is. However there seems to be a working plugin-API which could allow some interesting dabbling without getting to grips with the entire project&#8217;s code.</p>
<p>Early days, but I tentatively recommend Deluge as worth a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2009/10/12/196/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon France &#8211; Adieu, not Au Revoir</title>
		<link>http://www.ipsidixit.net/2009/09/18/amazon-france-adieu-not-au-revoir/</link>
		<comments>http://www.ipsidixit.net/2009/09/18/amazon-france-adieu-not-au-revoir/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 06:11:33 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/?p=193</guid>
		<description><![CDATA[You know how it goes: you discover a company that pleases you and can&#8217;t stop raving about it to friends and family. I&#8217;ve been like that regarding Amazon for some years. These days I mainly used Amazon France: books, toys, cameras, you name it. In the last couple of years I&#8217;ve spent more than 2000 [...]]]></description>
			<content:encoded><![CDATA[<p>You know how it goes: you discover a company that pleases you and can&#8217;t stop raving about it to friends and family. I&#8217;ve been like that regarding Amazon for some years. These days I mainly used Amazon France: books, toys, cameras, you name it. In the last couple of years I&#8217;ve spent more than 2000 Euros with Amazon France. I was what I would think of as a Good Customer.</p>
<p>I was even, ironically, signed up as one of their Premium Customers, which ensured they got even MORE business out of me!</p>
<p>I liked their prices &#8211; not always cheapest, but close enough.</p>
<p>I liked their web-site.</p>
<p>I liked their customer service &#8211; when something &#8220;went wrong&#8221; they would sort it out. It has to be said, though, that my experience of Amazon&#8217;s customer service is more based upon dealing with Amazon UK in times past, not so much with Amazon France.</p>
<p>So I was a keen customer and advocate, and spent oodles of money with Amazon. So how come today I cancel my Premium account and, once my final orders have limped in some time next week, will cancel my whole account and never, ever, darken their web site again?<span id="more-193"></span></p>
<h2>Things go wrong&#8230; I know</h2>
<p>I work in customer service, albeit of a rather different type. Things go wrong. People make mistakes. Stuff fails. That&#8217;s why customer service exists &#8211; to sort it out and make things good again.</p>
<p>Amazon France, though, seem to take a rather different view. It appears that their view of customer service is to tell me why I am wrong, to ignore the bits where it&#8217;s clear that they are wrong and to generally drop dead before saying &#8220;Hey sorry! We screwed up &#8211; this is what we&#8217;re doing to fix it!&#8221;</p>
<p>This post is not the place to bore anyone with the minutiae. But this week I had reason to contact Amazon France&#8217;s customer service regarding three separate orders (see what I mean about a good customer!! Three orders on the go at once!)</p>
<p>Most of the issues were within their direct control.</p>
<p>What do I expect? I expect to be listened to. To be understood. To, if appropriate, receive an apology. To be told what action is being taken to rectify things. Simple stuff. Customer Service 101.</p>
<p>What do I get? Evasion. Defensiveness. Lack of rectifying action. No apology.</p>
<p>Based upon my recent experience, Amazon France treat their customers like fools. They will push back on things they think they can push back on, and simply ignore any things which are indefensible.</p>
<p>Amazon France has lied to me (and I don&#8217;t use the word &#8220;lie&#8221; lightly). It has treated me like an idiot. It doesn&#8217;t care about me.</p>
<h2>We won&#8217;t meet again</h2>
<p>Time to explore the alternatives. Books? I&#8217;ll see what <a href="http://www.fnac.com/" target="_blank">FNAC</a> are like these days. Photographic equipment? I used <a href="http://www.missnumerique.com/" target="_blank">Miss Numerique</a> once or twice. Time to go back. Toys? <a href="http://www.king-jouet.com/" target="_blank">King Jouet </a>here I come! And so on. I&#8217;m actually rather looking forward to it.</p>
<p>It was nice having it all consolidated under Amazon before. But all things must come to an end. Treat your customer like dirt and what can you expect?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2009/09/18/amazon-france-adieu-not-au-revoir/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sockstress mitigation on Linux using Shorewall</title>
		<link>http://www.ipsidixit.net/2009/09/16/sockstress-mitigation-on-linux-using-shorewall/</link>
		<comments>http://www.ipsidixit.net/2009/09/16/sockstress-mitigation-on-linux-using-shorewall/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 08:09:45 +0000</pubDate>
		<dc:creator>sgroarke</dc:creator>
				<category><![CDATA[FPage]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.ipsidixit.net/?p=191</guid>
		<description><![CDATA[This week&#8217;s hot security issue in the networking world is sockstress.
Nasty little vulnerability, found in all known TCP implementations. Given the right circumstances (read up on it) it allows a very neat DoS attack to be mounted on a large destination with minimal attacking resource. And the really elegant part is that it exploits a [...]]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s hot security issue in the networking world is <a href="https://www.cert.fi/haavoittuvuudet/2008/tcp-vulnerabilities.html" target="_blank">sockstress</a>.</p>
<p>Nasty little vulnerability, found in all known TCP implementations. Given the right circumstances (<a href="https://www.cert.fi/haavoittuvuudet/2008/tcp-vulnerabilities.html" target="_blank">read up on it</a>) it allows a very neat DoS attack to be mounted on a large destination with minimal attacking resource. And the really elegant part is that it exploits a fundamental weakness in the very architecture of TCP as implemented on all major platforms.<span id="more-191"></span></p>
<p>This short post is not going to go in to details of sockstress, nor even the various fixes that vendors have made available &#8211; for those read the widely-available advisories and get patched! All I want to document here is how to implement the Linux iptable mitigation solution <a href="http://kbase.redhat.com/faq/docs/DOC-18730" target="_blank">published by Red Hat</a> on a host using <a href="http://www.shorewall.net/" target="_blank">Shorewall</a> as its <a href="http://www.netfilter.org/projects/iptables/index.html" target="_blank">iptables</a> front-end. An interesting aside is that Linux vendors, as Red Hat here being an example, are not directly issuing patches for this. Given the nature of the vulnerability they appear to be adopting an approach of leaving the base implementation of TCP unchanged but using existing tool sets to protect the system. Whether this is a good or bad approach depends on your technological ideology more than anything. Personally I like it, but I can see that for a desktop, non-technical user environment it may be less than ideal. Still, I&#8217;m protecting servers here, so the point is moot.</p>
<p>So, how to mitigate on a machine using Shorewall? Actually very simple, but for some reason I couldn&#8217;t even find a clear pointer to this on the Shorewall site, let alone anywhere else. All you need to do is drop the set of iptables mitigation rules in to file <em>/etc/shorewall/start </em>and then restart Shorewall. Easy as that.</p>
<p>You might typically expect to find a dummy of such a file (and its partner <em>/etc/shorewall/stop </em>- not used here) in situ. However, on my systems anyway (<a href="http://www.ubuntu.com/products/whatIsubuntu/serveredition" target="_blank">Ubuntu Server Edition</a>) neither was present.</p>
<p>But create them as required, add these (or other arbitrary) iptables commands, check the persmisions are <em>-rw-r&#8211;r&#8211;</em>, owner:group are root:root, and restart Shorewall. If you want to check the rules have &#8220;taken&#8221; you can do an <em>iptables -S </em>and/or <em>iptables -L </em>to observe them.</p>
<p>Note that the exact values used in the rules are, as the Red Hat advisory points out, going to be site specific. However the values given are a pretty good starting (and for many of us, finishing) point.</p>
<p>For completeness, here are the iptables rules as per the Red Hat advisory, 16 Sep 2009. <em>If in doubt, check the original!</em></p>
<blockquote><p><em></em><em><span style="color: #008000; padding: 0px; margin: 0px;"># The following rule accepts a packet that is associated with an established connection,<br />
# or that is starting a new connection that is associated with an existing connection:</span><br />
</em>iptables -A INPUT -p tcp -m conntrack &#8211;ctstate RELATED,ESTABLISHED -j ACCEPT<em><br />
<span style="color: #008000; padding: 0px; margin: 0px;"># The following rule removes the source address (from the recent list) of a packet<br />
# that has the FIN flag set and that is also in the recent list:</span><br />
</em>iptables -A INPUT -p tcp &#8211;tcp-flags FIN FIN -m recent &#8211;remove<em><br />
<span style="color: #008000; padding: 0px; margin: 0px;"># The following rule adds the source address of the packet to the recent list.<br />
# If an entry for the packet already exists in the recent list, the entry is updated:</span><br />
</em>iptables -A INPUT -p tcp -m recent &#8211;set<em><br />
<span style="color: #008000; padding: 0px; margin: 0px;"># The following rule drops the packet if it is seen at least 10 times in the last<br />
# five minutes:</span><br />
</em>iptables -A INPUT -p tcp -m recent &#8211;update &#8211;seconds 300 &#8211;hitcount 10 -j DROP</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ipsidixit.net/2009/09/16/sockstress-mitigation-on-linux-using-shorewall/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
