<?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>Adam Sherman &#187; Networking</title>
	<atom:link href="http://www.sherman.ca/archives/category/system/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sherman.ca</link>
	<description>Mostly random thoughts on software, gear and the great outdoors.</description>
	<lastBuildDate>Fri, 09 Jul 2010 14:12:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone OS 3.0, Tethering and Rogers</title>
		<link>http://www.sherman.ca/archives/2009/06/18/iphone-os-30-tethering-and-rogers/</link>
		<comments>http://www.sherman.ca/archives/2009/06/18/iphone-os-30-tethering-and-rogers/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 14:36:00 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[rogers]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/?p=175</guid>
		<description><![CDATA[I thought I&#8217;d let everyone know that I upgraded my iPhone 3G to iPhone OS 3.0 yesterday and tethering Just Works™ over both Bluetooth PAN and USB. In fact, it&#8217;s much simpler to use than I expected. I have an original 6G data plan with Rogers and according to their FAQ, this is a supported [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d let everyone know that I upgraded my iPhone 3G to iPhone OS 3.0 yesterday and tethering <em>Just Works™</em> over both Bluetooth PAN and USB. In fact, it&#8217;s much simpler to use than I expected.</p>

<p>I have an original 6G data plan with Rogers and according to their <a href="http://www.rogers.com/web/content/wireless-products/iphone_faqs">FAQ</a>, this is a supported feature and I am not going to get a multi-thousand dollar bill next month. <img src='http://www.sherman.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2009/06/18/iphone-os-30-tethering-and-rogers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID With Your Domain</title>
		<link>http://www.sherman.ca/archives/2008/02/07/openid-with-your-domain/</link>
		<comments>http://www.sherman.ca/archives/2008/02/07/openid-with-your-domain/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 13:15:15 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/archives/2008/02/07/openid-with-your-domain/</guid>
		<description><![CDATA[The above indicates that my personal OpenID is being delegated to  https://adam.sherman.pip.verisignlabs.com  which is hosted by the server  https://pip.verisignlabs.com/server .   Since the page at  http://sherman.ca/  contains the above tags, I can now go to any site supporting OpenID and simply use  sherman.ca  as my identifier.]]></description>
			<content:encoded><![CDATA[<p>Since I will eventually be implementing <a href="http://openid.net/">OpenID</a> in a commercial project, I thought I would go ahead and set myself up properly.</p>

<p>There are now a few free OpenID providers and I have setup my own account with <a href="https://pip.verisignlabs.com/" title="VeriSign Labs Personal Identity Provider">VeriSign Labs Personal Identity Provider</a> <i>beta</i>. Of course, I do not wish to expose the actual provider as my <em>OpenID</em>: what if I lose trust in them or they simply stop offering the service one day?</p>

<p>The solution to this is actually quite simple and allows you to use your own domain as your personal OpenID, exactly what I needed. The technical term is <em>delegation</em> and is fully <a href="http://openid.net/specs/openid-authentication-1_1.html#delegating_authentication">documented</a>. To implement this trick using <a href="http://www.wordpress.org">WordPress</a>, simply edit your themes <code>header.php</code> and add two <a href="http://www.html-reference.com/META.htm">meta tags</a>. Of course you can do this with your software of choice, or even plain vanilla HTML. This is what I added to my blog:</p>

<p><pre>
&lt;link rel="openid.server" href="https://pip.verisignlabs.com/server"&gt;
&lt;link rel="openid.delegate" href="https://adam.sherman.pip.verisignlabs.com"&gt;
</pre></p>

<p>The above indicates that my personal OpenID is being delegated to <code>https://adam.sherman.pip.verisignlabs.com</code> which is hosted by the server <code>https://pip.verisignlabs.com/server</code>. Since the page at <code>http://sherman.ca/</code> contains the above tags, I can now go to any site supporting OpenID (look for the logo: <img src="http://openid.net/login-bg.gif"/>) and simply use <code>sherman.ca</code> as my identifier.</p>

<p>I believe that OpenID&#8217;s time has come and I look forward to implementing it for some of my clients in order to give their users the ability to consume services <em>without a registration page</em>.</p>

<div class="posttagsblock"><a href="http://technorati.com/tag/openid" rel="tag">openid</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2008/02/07/openid-with-your-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flushing Leopard&#8217;s DNS Cache</title>
		<link>http://www.sherman.ca/archives/2008/02/04/flushing-leopards-dns-cache/</link>
		<comments>http://www.sherman.ca/archives/2008/02/04/flushing-leopards-dns-cache/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 02:08:40 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/archives/2008/02/04/flushing-leopards-dns-cache/</guid>
		<description><![CDATA[Since I have run into problems similar this fellow, I thought I would  link  to the  original page  and reproduce the instructions here:

... Very useful tip.]]></description>
			<content:encoded><![CDATA[<p>Since I have run into problems similar this fellow, I thought I would <a href="http://feeds.feedburner.com/~r/slowe/content/feed/~3/229133236/">link</a> to the <a href="http://www.hongkiat.com/blog/how-to-clear-dns-cache-in-mac-osx-leopard/">original page</a> and reproduce the instructions here:</p>

<p><code># dscacheutil -flushcache</code></p>

<p>Very useful tip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2008/02/04/flushing-leopards-dns-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zeroconf under Debian Linux</title>
		<link>http://www.sherman.ca/archives/2005/03/19/zeroconf-under-debian-linux/</link>
		<comments>http://www.sherman.ca/archives/2005/03/19/zeroconf-under-debian-linux/#comments</comments>
		<pubDate>Sat, 19 Mar 2005 21:07:12 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2005/03/19/zeroconf-under-debian-linux/</guid>
		<description><![CDATA[This afternoon I quickly setup enough infrastructure on my test server to enable it to use Multicast DNS to resolve local names and answer local queries. Multicast DNS is part of the Zeroconf specification, which Apple has implemented and refers to as Rendezvous. In order for this to work, your system needs to both answer [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I quickly setup enough infrastructure on my test server to enable it to use <a href="http://www.multicastdns.org/">Multicast DNS</a> to resolve local names and answer local queries. <a href="http://www.multicastdns.org/">Multicast DNS</a> is part of the <a href="http://www.zeroconf.org/">Zeroconf</a> specification, which <a href="http://www.apple.com/">Apple</a> has implemented and refers to as <a href="http://www.apple.com/macosx/features/rendezvous/">Rendezvous</a>.</p>

<p>In order for this to work, your system needs to both <em>answer</em> and <em>perform</em> multicast DNS queries. The two pieces you need for this are:</p>

<ul>
<li><a href="http://packages.debian.org/mdnsresponder">mDNSResponder</a>: From <a href="http://www.apple.com/">Apple</a>, and covered under the APSL, but included in [Porchdog Software]&#8216;s <a href="http://www.porchdogsoft.com/products/howl/">Howl</a> package.</li>
<li><a href="http://0pointer.de/lennart/projects/nss-mdns/">nss-mdns</a>: Written by  Lennart Poettering, provides <em>a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing host name resolution via <a href="http://www.multicastdns.org/">Multicast DNS</a></em></li>
</ul>

<p>As of <code>0.3</code>, nss-mdns is already <a href="http://www.debian.org">Debian</a>-ready, simply build a package executing <code>fakeroot dpkg-buildpackage</code> from the unpacked tarball. There is an mDNSResponder package in <em>Sarge</em> which is rumored to be removed shortly due to license problems with APSL, so grab a copy soon.</p>

<p>Once these are installed, simply add <code>mdns</code> to the <code>hosts</code> line of <code>/etc/nsswitch.conf</code> and you&#8217;re done.</p>

<p>You will now be able to resolve &#8220;.local&#8221; hosts from your Debian system and also resolve this system&#8217;s hostname on other local hosts. By editing <code>/etc/mdnsresponder/mDNSResponder.conf</code>, you can advertise any service you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2005/03/19/zeroconf-under-debian-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JINI and JXTA</title>
		<link>http://www.sherman.ca/archives/2005/03/14/jini-and-jxta/</link>
		<comments>http://www.sherman.ca/archives/2005/03/14/jini-and-jxta/#comments</comments>
		<pubDate>Mon, 14 Mar 2005 16:28:48 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2005/03/14/jini-and-jxta/</guid>
		<description><![CDATA[Some days I wish I had way more energy in order to explore all the technology I&#8217;m interested in. How does JXTA figure in relation to JINI? Dan Creswell&#8217;s post about JINI not being RMI brought JINI back to the forefront of my technology todo list. This stuff is cool.]]></description>
			<content:encoded><![CDATA[<p>Some days I wish I had way more energy in order to explore all the technology I&#8217;m interested in.</p>

<p>How does <a href="http://www.jxta.org/">JXTA</a> figure in relation to <a href="http://www.sun.com/software/jini/">JINI</a>?</p>

<p>Dan Creswell&#8217;s <a href="http://www.jroller.com/page/dancres/20050314#jini_rmi">post</a> about <a href="http://www.sun.com/software/jini/">JINI</a> not being RMI brought <a href="http://www.sun.com/software/jini/">JINI</a> back to the forefront of my <em>technology todo list</em>. This stuff is cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2005/03/14/jini-and-jxta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read-Only Root for CompactFlash systems?</title>
		<link>http://www.sherman.ca/archives/2005/02/16/read-only-root-for-compactflash-systems/</link>
		<comments>http://www.sherman.ca/archives/2005/02/16/read-only-root-for-compactflash-systems/#comments</comments>
		<pubDate>Wed, 16 Feb 2005 15:32:54 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2005/02/16/read-only-root-for-compactflash-systems/</guid>
		<description><![CDATA[I just read Debian on Soekris HOWTO and was wondering if there are any additional steps one should take to ensure proper functioning of a Debian system running from a CompactFlash card. For example, would logging and other hammering reduce the life of the card in any significant fashion? Is it worth the hassle of [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="http://roland.entierement.nu/index.php/archives/2005/02/16/debian-on-soekris-howto/">Debian on Soekris HOWTO</a> and was wondering if there are any additional steps one should take to ensure proper functioning of a Debian system running from a CompactFlash card. For example, would logging and other hammering reduce the life of the card in any significant fashion? Is it worth the hassle of going to a read-only root filesystem on the card?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2005/02/16/read-only-root-for-compactflash-systems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Road Warrior Access with OpenVPN</title>
		<link>http://www.sherman.ca/archives/2005/01/16/road-warrior-access-with-openvpn/</link>
		<comments>http://www.sherman.ca/archives/2005/01/16/road-warrior-access-with-openvpn/#comments</comments>
		<pubDate>Sun, 16 Jan 2005 23:36:40 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2005/01/16/road-warrior-access-with-openvpn/</guid>
		<description><![CDATA[Since my previous posts (1 &#38; 2) about using IPsec in tunnel mode to securely connect multiple networks (I&#8217;m up to 17 on the same gateway.), I have needed to add support for &#8220;road warriors&#8221;. While IPsec has low overhead, even in tunnel mode, it requires a lot of effort to configure for use by [...]]]></description>
			<content:encoded><![CDATA[<p>Since my previous posts (<a href="http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/">1</a> &amp; <a href="http://www.sherman.ca/archives/2004/12/09/ipsec-with-linux-269-shorewall">2</a>) about using IPsec in tunnel mode to securely connect multiple networks (I&#8217;m up to 17 on the same gateway.), I have needed to add support for &#8220;road warriors&#8221;.</p>

<p>While IPsec has low overhead, even in tunnel mode, it requires a lot of effort to configure for use by mobile clients. First, we must now <em>assume</em> NATs in the field; whether they are behind the now omnipresent home gateways or on public wireless networks. Secondly, it is my experience that using a VPN system based around bridging has many advantages:</p>

<ul>
<li>supports services requiring broadcasts (SMB Browsing, <a href="http://www.zeroconf.org/">Zeroconf</a>/<a href="http://www.apple.com">Rendezvous</a>, etc.</li>
<li>allows bi-directional routing to remote networks</li>
<li>supports legacy, non-IP, protocols</li>
</ul>

<p>I will elaborate on the routing issues. In our setup, our main gateway connects to 17 remote networks via IPsec. In order for a remote client to access a remote network, both the client and the remote gateway must have the correct routing table.</p>

<p>In light of the above, I decided to use <a href="http://www.openvpn.net/">OpenVPN</a>. It fulfills my main objectives: simplicity and security. Correctly setup, <a href="http://www.openvpn.net/">OpenVPN</a> will perform verification against both the client and server certificates and uses very strong crypto. To set this up you will need a PKI (Public Key Infrastructure).</p>

<p>My server-side configuration:</p>

<pre><code>ca /etc/ssl/certs/ca.crt
ccd-exclusive
cert /etc/ssl/certs/gw.domain.ca.crt
client-config-dir ccd
client-to-client
dev tap0
dh /etc/ssl/dh2048.pem
float
group nogroup
keepalive 10 120
key /etc/ssl/private/gw.domain.ca.key  # This file should be kept secret
local 66.46.199.130
passtos
persist-key
persist-tun
port 1194
proto udp
push "route 10.100.0.0 255.255.0.0"
server-bridge 10.100.0.1 255.255.255.0 10.100.0.90 10.100.0.100
status openvpn-status.log
user nobody
verb 4
</code></pre>

<p>My client-side configuration:</p>

<pre><code>dev tap0
remote gw.domain.ca
tls-remote gw.domain.ca
pull
nobind
passtos
float
tls-client
ca ts-ca.crt
cert adam.crt
key adam.key
keepalive 15 45
persist-tun
persist-key
verb 2
</code></pre>

<p>Note the <code>tls-remote</code> directive. This is critical to ensuring that the client verifies the identity of the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2005/01/16/road-warrior-access-with-openvpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IPsec with Linux 2.6.9 &amp; Shorewall</title>
		<link>http://www.sherman.ca/archives/2004/12/09/ipsec-with-linux-269-shorewall/</link>
		<comments>http://www.sherman.ca/archives/2004/12/09/ipsec-with-linux-269-shorewall/#comments</comments>
		<pubDate>Thu, 09 Dec 2004 17:33:01 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2004/12/09/ipsec-with-linux-269-shorewall/</guid>
		<description><![CDATA[My previous post promised some information about how firewall rules interact with IPsec under Linux 2.6, well here it is. The Shoreline Firewall has full support for declaratively defining IPsec tunnels and hosts under the new IPsec support. To do this however, you will need the policy match netfilter extension from the Patch-o-Matic NG and [...]]]></description>
			<content:encoded><![CDATA[<p>My previous <a href="http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/" title="Linux 2.6 IPsec VPNs">post</a> promised some information about how firewall rules interact with IPsec under Linux 2.6, well here it is.</p>

<p>The <a href="http://www.shorewall.net/">Shoreline Firewall</a> has full support for declaratively defining IPsec tunnels and hosts under the new IPsec support. To do this however, you will need the <em>policy match</em> netfilter extension from the <a href="http://netfilter.org/patch-o-matic/index.html">Patch-o-Matic NG</a> and also 4 other patches:</p>

<ul>
<li>ipsec-01-output-hooks.patch</li>
<li>ipsec-02-input-hooks.patch</li>
<li>ipsec-03-policy-lookup.patch</li>
<li>ipsec-04-policy-checks.patch</li>
</ul>

<p>While these patches are in the <a href="http://netfilter.org/patch-o-matic/index.html">POM-NG</a>, they will not cleanly apply to linux 2.6.9. Ronald Moesbergen was nice enough to port the patches are are available from the <a href="https://lists.netfilter.org/pipermail/netfilter-devel/2004-October/017254.html" title="[Patch] ipsec-nat patches for 2.6.9">list archive</a>.</p>

<p>To apply the patches, simply run <code>patch -p1 &lt; ipsec-*</code> from the top of our kernel source tree. Also copy the policy match extension&#8217;s files from the POM-NG directory into your kernel tree and insert the contents of the two <code>.ladd</code> files into the relevant <code>Makefile</code> and <code>Kconfig</code> file. Then reconfigure, enabling the <em>policy match</em>, and rebuild. Then follow the <a href="http://www.shorewall.net/IPSEC-2.6.html" title="IPSEC using Linux Kernel 2.6">documentation</a>.</p>

<p>If I have time, I&#8217;ll try and add some more information here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2004/12/09/ipsec-with-linux-269-shorewall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux 2.6 IPsec VPNs</title>
		<link>http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/</link>
		<comments>http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/#comments</comments>
		<pubDate>Sun, 21 Nov 2004 10:41:54 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2004/11/21/linux-26-ipsec-vpns/</guid>
		<description><![CDATA[Update: Howtoforge has a good tutorial about setting up &#8220;roadwarrior&#8221; VPNs using IPsec &#38; KAME. Since I was unable to find a clear description of setting up an IPSec-based VPN using the native IPSec stack from USAGI and KAME userland tools that are part of Linux 2.6.x, I thought I would post a short explanation. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> Howtoforge has a good <a href="http://www.howtoforge.com/racoon_roadwarrior_vpn">tutorial</a> about setting up &#8220;roadwarrior&#8221; VPNs using IPsec &amp; KAME.</p>

<p>Since I was unable to find a clear description of setting up an IPSec-based VPN using the native IPSec stack from <a href="http://www.linux-ipv6.org/">USAGI</a> and <a href="http://www.kame.net">KAME</a> userland tools that are part of Linux 2.6.x, I thought I would post a short explanation.</p>

<p><strong>Software</strong></p>

<ul>
<li>Linux Kernel 2.6.8 from <a href="http://www.debian.org">Debian</a> Sarge</li>
<li><a href="http://ipsec-tools.sourceforge.net/">ipsec-tools</a> 0.3.3 from <a href="http://www.debian.org">Debian</a> Sarge</li>
<li><a href="http://www.kame.net">racoon</a> 0.3.3 from <a href="http://www.debian.org">Debian</a> Sarge (This package includes racoon-tool.)</li>
</ul>

<p><strong>Network Topology</strong></p>

<p>I am going to explain a very straightforward topology often found in the field. You have two networks, network A (10.0.0.0/24) and network B (10.0.1.0/24). Each network has router/gateway/firewall system, gateway A (10.0.0.1) and gateway B (10.0.1.1). Each of these gateway systems as an external, public, IP address: 3.3.3.3 &amp; 2.2.2.2.</p>

<p>In this topology, our end goal is to allow a hosts on network A, say 10.0.0.123, to securely contact a host on network B, say 10.0.1.158, via an IPSec tunnel.</p>

<p><strong>Note:</strong> In many cases, I will provide only a single example. You must ensure the other gateway is configured similarly, often by reversing the configuration. This is left as an exercise to the reader.</p>

<p><strong>IPSec</strong></p>

<p>Setting up IPSec involves two steps: keying and policy. Normally, you use <em>racoon</em> to provide keying and <em>setkey</em> to establish policy. I will instead use <em>racoon-tool</em> as convenient shortcut. This tool was written by the <a href="http://www.debian.org">Debian</a> Maintainer of the racoon package in order to emulate some of the nice configuration syntaxt of the <a href="http://www.freeswan.org/">FreeS/WAN</a>, an older IPSec implementation for Linux. It dynamically generates a racoon.conf (<code>/var/lib/racoon/racoon.con</code>) and also sets up the policy based on a single configuration file.</p>

<p>First, we simply state that racoon should use the <code>notify</code> priority when sending messages to syslogd:</p>

<pre><code>global:
        log: notify
</code></pre>

<p>It is helpful to create a <code>%default</code> peer and connection in order to avoid duplication of configuration directives:</p>

<pre><code>peer(%default):
        verify_identifier: on
        hash_algorithm[0]: sha1
        encryption_algorithm[0]: aes
connection(%default):
        src_ip: 3.3.3.3
</code></pre>

<p>The above <code>src_ip</code> directive simply says that our connections will be using our public IP.</p>

<p>Next, we define our peer, gatewayB, identifying it by address:</p>

<pre><code>peer(2.2.2.2):
        peers_identifier: address
</code></pre>

<p>Finally, we define a policy so that packets from networkA to networkB are encrypted via gatewayB:</p>

<pre><code>connection(to-gatewayB):
        dst_ip: 2.2.2.2
        src_range: 10.0.0.0/24
        dst_range: 10.0.1.0/24
        admin_status: enabled
</code></pre>

<p>Unfortunately, I have no idea what the <code>admin_status: enabled</code> directive does, or even whether it is required.</p>

<p>You must also add a key to <code>/etc/racoon/psk.txt</code> for the remote gateway:</p>

<pre><code># Entry for gatewayB
2.2.2.2 0x2eba016ffc2314869ae9f9a3b8901a173242f0c8
</code></pre>

<p>A randomly generated key is best, and can be created with the following command:</p>

<pre><code>$ dd if=/dev/random count=20 bs=1 | xxd -ps
</code></pre>

<p>(The <code>xxd</code> command is part of the <em>vim</em> package.)</p>

<p>Make sure that you can the racoon package configured to use <em>racoon-tool</em> by either editing <code>/etc/defaults/racoon</code> or reconfiguring the package. Also, you should probably reload the tool by executing <code>/etc/init.d/racoon reload</code>. You can then check that your policy is in effect by running <code>setkey -DP</code>. You should get something like the following, followed by a bunch of default policies:</p>

<pre><code>10.0.1.0/24[any] 10.0.0.0/24[any] any
        in ipsec
        esp/tunnel/2.2.2.2-3.3.3.3/unique#16385
        created: Nov 18 23:01:24 2004  lastused:
        lifetime: 0(s) validtime: 0(s)
        spid=1512 seq=9 pid=9800
        refcnt=1
10.0.0.0/24[any] 10.0.1.0/24[any] any
        out ipsec
        esp/tunnel/3.3.3.3-2.2.2.2/unique#16384
        created: Nov 18 23:01:24 2004  lastused: Nov 18 23:05:31 2004
        lifetime: 0(s) validtime: 0(s)
        spid=1505 seq=8 pid=9800
        refcnt=1
</code></pre>

<p>Now that the policy is in effect, the kernel will ask the racoon daemon for a <em>security association</em> (SA), when it needs to deal with a packet matching the policy. Racoon will negotiate an SA with the remote gateway on the fly. (This will not happen until after we&#8217;ve setup the routing, below, but you can see it by using the <code>setkey -D</code> command.)</p>

<p><strong>Routing</strong></p>

<p>In order for a packet to match the policy we have setup, and also be forwarded to the remove gateway, we must adjust the routing table using the <code>ip</code> command (Provided by the <a href="http://www.debian.org">Debian</a> <em>iproute2</em> package.).</p>

<p>The policy we have setup, says that packets coming from 10.0.0.0/24 and going to 10.0.1.0/24 must be encrypted and authenticated. This is achieved by adding a slightly weird entry to the routing table on gatewayA:</p>

<pre><code>$ ip route add 10.0.1.0/24 via 2.2.2.2 src 10.0.0.1
</code></pre>

<p>And on gatewayB:</p>

<pre><code>$ ip route add 10.0.0.0/24 via 3.3.3.3 src 10.0.1.1
</code></pre>

<p>Once you have added the new entries to the routing tables on both gateways, we test the tunnel. If you ping 10.0.1.0 from gatewayA, and then execute <code>setkey -D</code>, you will see the new <em>SA</em> that has been automatically created.</p>

<p>This is the routing table you should have on gateway &#8220;A&#8221;:</p>

<pre><code>root@gatewayA:/tmp# ip route show
3.3.3.0/24 dev eth1  proto kernel  scope link  src 3.3.3.3
10.0.1.0/24 via 3.3.3.1 dev eth1  src 10.0.0.1
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.1
default via 3.3.3.3 dev eth1
</code></pre>

<p>Followed by the routing table present on gateway &#8220;B&#8221;:</p>

<pre><code>root@gatewayB:/tmp# ip route show
2.2.2.0/24 dev eth1  proto kernel  scope link  src 2.2.2.2
10.0.1.0/24 dev eth0  proto kernel  scope link  src 10.0.1.1
10.0.0.0/24 via 2.2.2.1 dev eth1  src 10.0.0.1.1
default via 2.2.2.1 dev eth1
</code></pre>

<p>In the above examples, 2.2.2.1 &amp; 3.3.3.1 are the default gateways that connect your public networks. (The routers usually provided by your ISP.)</p>

<p><strong>Note:</strong> if you have any firewall rules enabled, you are going to have hassles. Notice that the IPSec tunnel doesn&#8217;t have it&#8217;s own device: the encrypted packets are going through a public interface. This will confuse any firewall rules that expect to be able to categorize packets by interface. I intend to figure out a good solution and post it at a later date.</p>

<p><strong>Update:</strong> I now have a fully working IPsec gateway/router/firewall. See <a href="http://www.sherman.ca/archives/2004/12/09/ipsec-with-linux-269-shorewall/" title="IPsec with Linux 2.6.9 &amp; Shorewall">this</a> other post.</p>

<p><strong>Update:</strong> It seems that when the external addresses of the gateways on are different subnets, which was not the case during my testing, you must add a route like <code>ip route add OTHER_NETWORK via LOCAL_DEFAULT_GW src INTERNAL_IP</code>. Otherwise, you will get an error: <code>RTNETLINK answers: Network is unreachable</code>. Please leave a comment if you can clarify this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2004/11/21/linux-26-ipsec-vpns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VoIP and Presence</title>
		<link>http://www.sherman.ca/archives/2004/10/21/voip-and-presence/</link>
		<comments>http://www.sherman.ca/archives/2004/10/21/voip-and-presence/#comments</comments>
		<pubDate>Thu, 21 Oct 2004 19:57:12 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/2004/10/21/voip-and-presence/</guid>
		<description><![CDATA[Corporate and personal communications is undergoing an obvious revolution right before our eyes. I won&#8217;t comment on this aspect of VoIP since there are so many doing so, particularly in the large news publications. However, we&#8217;re missing something: presence. Instant messaging has boomed and become an almost integral part of our society, with youth leading [...]]]></description>
			<content:encoded><![CDATA[<p>Corporate and personal communications is undergoing an obvious revolution right before our eyes. I won&#8217;t comment on this aspect of VoIP since there are so many doing so, particularly in the large news publications. However, we&#8217;re missing something: <em>presence</em>.</p>

<p><a href="http://en.wikipedia.org/wiki/Instant_messenger">Instant messaging</a> has boomed and become an almost integral part of our society, with youth leading this integration. Have we not noticed that this form of communication is almost entirely controlled by a select few corporations? To name a few:</p>

<ul>
<li><a href="http://www.aol.com">AOL</a> (AIM &#38; ICQ)</li>
<li><a href="http://www.msn.com">Microsoft</a> (MSN)</li>
<li><a href="http://www.yahoo.com">Yahoo</a></li>
</ul>

<p>This is all a <em>Bad Thing&trade;</em>! Lets reminisce for a moment about good, old fashioned, email service. This technology is completely decentralized and relies on each entity having their own SMTP system. If I want to send you mail, I simply do a DNS lookup to find your mail server and off I go. This server can either be provided by your ISP, out-sourced to another provider or you may have set it up internally.</p>

<p>Contrast this with IM, where your messages are being routed by a third-party who:</p>

<ul>
<li>Is not receiving money from you</li>
<li>Made you accept a disclaimer that basically guarantees less than nothing</li>
<li>Doesn&#8217;t really want to interface with the other IM providers</li>
</ul>

<p>To actually start discussing VoIP now, the above <em>prevents good presence for VoIP applications</em>.</p>

<p>Thankfully, the defacto VoIP protocol, <a href="http://www.softarmor.com/sipwg/">SIP</a>, has full support for an SMTP-like distrbuted model using <a href="http://www.voip-info.org/wiki-DNS+SRV">SRV</a> records in DNS. This allows the DNS system to be queries for the correct <a href="http://www.softarmor.com/sipwg/">SIP</a> server for a domain and therefore gives us nice, convenient addresses for voice communications using the familiar &#8220;user@domain&#8221; form.</p>

<p>Built on top of <a href="http://www.softarmor.com/sipwg/">SIP</a>, there is <a href="http://www.softarmor.com/simple/">SIMPLE</a> or the S I M P L E. This upgrades your SIP infrastructure to support full presence and <a href="http://en.wikipedia.org/wiki/Instant_messenger">instant messaging</a> capabilities. So far, I know of very few clients that have full SIMPLE support:</p>

<ul>
<li><a href="http://www.xten.com/">X-Ten</a>&#8216;s <a href="http://www.xten.com/index.php?menu=products&#38;smenu=eyebeam">eyeBeam</a> (Commercial, Win32 &#38; Mac OS X)</li>
<li><a href="http://www.pulver.com">Pulver</a>&#8216;s <a href="http://www.pulver.com/communicator/">pulver.Communicator</a> (Win32)</li>
</ul>

<p>Also, I believe that <a href="http://www.microsoft.com">Microsoft</a>&#8216;s Windows Messenger is available in a <a href="http://www.softarmor.com/sipwg/">SIP</a> edition.</p>

<p>A major open instant messaging protocol, <a href="http://www.jabber.org/">Jabber</a>, also has the above mentioned <a href="http://www.voip-info.org/wiki-DNS+SRV">SRV</a> capability. It seems to be under implemented in practice, however, with many people not even bothering. <a href="http://www.jabber.org/">Jabber</a> uses the <a href="http://www.xmpp.org/">XMPP</a> protocol and bridges exist to allow <a href="http://www.softarmor.com/simple/">SIMPLE</a> to interoperate with it.</p>

<p>I&#8217;m rambling here. To get to the point, it seems that integrating <a href="http://www.softarmor.com/sipwg/">SIP</a> hardware devices : Analog Telephone Adapters (ATAs), like those from <a href="http://www.sipura.com/">Sipura</a>, and desk phones like those from <a href="http://www.polycom.com">Polycom</a>; with presence provided either by <a href="http://www.softarmor.com/simple/">SIMPLE</a> or <a href="http://www.xmpp.org/">XMPP</a>, <em>is a problem</em>. See, when you are using a great hardware phone for actual calling, you can&#8217;t do decent presence. How will my <a href="http://www.jabber.org/">Jabber</a> client know that I&#8217;m on the phone in order to set my status to &#8220;On the phone&#8221;?</p>

<p>My conclusion is that we should really be using softphones. Why not? Don&#8217;t we all have laptops and <a href="http://www.bluetooth.com/">Bluetooth</a> headsets? <img src='http://www.sherman.ca/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Well, I intend to get myself fully setup this way. To heck with all the other ways of getting voice service. Also, <a href="http://www.jabber.org/">Jabber</a> isn&#8217;t a great candidate unless you use something like the <a href="http://www.myjabber.net/">myJabber</a> Instant Messaging Client for XMPP and myJabber AE Soft Phone combination, which is non-standard.</p>

<p>More to come on this topic once I get a copy of <a href="http://www.xten.com/index.php?menu=products&#38;smenu=eyebeam">eyeBeam</a> for Mac OS X to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2004/10/21/voip-and-presence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
