<?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>SDUNIX - A Technology Blog</title>
	<atom:link href="http://blog.sdunix.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sdunix.com</link>
	<description></description>
	<lastBuildDate>Mon, 18 Jun 2012 04:16:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>C++ &#8211; A New Adventure</title>
		<link>http://blog.sdunix.com/2012/06/c-c-a-new-adventure/</link>
		<comments>http://blog.sdunix.com/2012/06/c-c-a-new-adventure/#comments</comments>
		<pubDate>Fri, 15 Jun 2012 02:47:29 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=157</guid>
		<description><![CDATA[I&#8217;ve programmed in a lot of languages; Ruby, Perl, PHP, Python, Visual Basic .NET, I&#8217;m always trying to expand my knowledge base. Now I&#8217;ve decided to dive into C++. Why? Well, I like a challenge. My gut feeling tells me &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2012/06/c-c-a-new-adventure/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve programmed in a lot of languages; <a href="http://ruby-lang.org" target="_blank">Ruby</a>, <a href="http://www.perl.org" target="_blank">Perl</a>, <a href="http://www.php.net" target="_blank">PHP</a>, <a href="http://www.python.org" target="_blank">Python</a>, <a href="http://www.microsoft.com" target="_blank">Visual Basic .NET</a>, I&#8217;m always trying to expand my knowledge base. Now I&#8217;ve decided to dive into C++. Why? Well, I like a challenge. My gut feeling tells me learning C++ will give me some core level programming values that programming in other languages have not necessarily forced me to master. I&#8217;m a firm believer in using the language that fits the bill for the job you are trying to get done, so every language I&#8217;ve worked with so far has been extremely valuable in so many ways.</p>
<p>Another motivating factor is my desire to start contributing to the open source community and build some great applications that run in Linux and BSD, especially ones that run in great environments like <a href="http://www.gnome.org" target="_blank">Gnome</a>, <a href="http://www.kde.org" target="_blank">KDE</a>, <a href="http://www.xfce.org" target="_blank">Xfce</a>, etc.</p>
<p>So I started trying to find a starting point. Loading up main.cpp in vi is an option, and works well, but I want an IDE. Not to mention my only goal isn&#8217;t just to bust out daemons and console based tools, I want to create some user friendly software too.</p>
<p>That landed me at the <a href="http://gtk.org" target="_blank">GTK</a> / <a href="http://qt.nokia.com/products/" target="_blank">Qt</a> decision. Knowing that I&#8217;ll need the C++ background anyway, which toolkit do I really want to use? I love <a href="http://www.gnome.org">Gnome</a> (2 that is), and <a href="http://www.kde.org" target="_blank">KDE</a> is pretty awesome, so I loaded up <a href="http://glade.gnome.org" target="_blank">Glade</a> and <a href="http://qt.nokia.com/products/developer-tools" target="_blank">Qt Creator</a>, and <a href="http://qt.nokia.com/products/developer-tools" target="_blank">Qt Creator</a> sold me instantly. Not only is it a nice IDE to build straight up C++ applications, but it has an awesome form based builder with the power of the Qt SDK, which is eventually where I want to go.</p>
<p><a href="http://qt.nokia.com/products/developer-tools" target="_blank">Qt Creator</a> installed like a gem on both my <a href="http://www.gentoo.org" target="_blank">Gentoo</a> Linux system (emerge dev-util/qt-creator) as well as my <a href="http://www.freebsd.org" target="_blank">FreeBSD</a> 9.0 workstation (/usr/ports/devel/qtcreator).</p>
<p>Again I was left with where to start. A quick <a href="http://www.google.com" target="_blank">Google</a> search of &#8220;C++ Tutorial for Beginners&#8221; brought me to <a href="http://cprogramming.com" target="_blank">cprogramming.com</a>, which has some great tutorials to get me addicted to the adventure. Digging a bit deeper, I found out the creator, Alex Allain, has a book called Jumping into C++ for 20 bucks which is immediately available for download, which is just what I was looking for. Import it into iBooks on your iPad and it&#8217;s awesome. He even recommends a series of books to read if you really want to be an expert which is available at <a href="http://www.cprogramming.com/books.html" target="_blank">http://www.cprogramming.com/books.html</a>.</p>
<p>I&#8217;m off to continue my adventure, it won&#8217;t be a super quick one I&#8217;m sure. I&#8217;ll post back some of my challenges and successes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2012/06/c-c-a-new-adventure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla Mirror</title>
		<link>http://blog.sdunix.com/2012/06/mozilla-mirror/</link>
		<comments>http://blog.sdunix.com/2012/06/mozilla-mirror/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 03:26:00 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=154</guid>
		<description><![CDATA[If you&#8217;ve been following our previous blog entries, you may have noticed we are on a mission to contribute back to the open source community. Recently we&#8217;ve announced that SDUNIX has become an official mirror for the Apache Software Foundation &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2012/06/mozilla-mirror/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following our previous blog entries, you may have noticed we are on a mission to contribute back to the open source community. Recently we&#8217;ve announced that SDUNIX has become an official mirror for the Apache Software Foundation and the GNU Operating System, and to round off our contribution, we&#8217;ve recently added Mozilla.</p>
<p>Mozilla&#8217;s products have revolutionized the way we browse the web and read E-mail in all varieties of operating systems. Their commitment to open source free software is amazing, and more than that, they are all about giving people what they truly want, the power of the web.</p>
<p>A list of Mozilla&#8217;s official mirrors can be found at:</p>
<p><a href="http://www.mozilla.org/community/mirrors.htmlhttp://" target="_blank">http://www.mozilla.org/community/mirrors.html</a></p>
<p>You can visit our Mozilla mirror directly at:</p>
<p><a href="http://mirror.sdunix.com/mozilla" target="_blank">http://mirror.sdunix.com/mozilla</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2012/06/mozilla-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNU Mirror</title>
		<link>http://blog.sdunix.com/2012/05/gnu-mirror/</link>
		<comments>http://blog.sdunix.com/2012/05/gnu-mirror/#comments</comments>
		<pubDate>Wed, 30 May 2012 01:47:46 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=147</guid>
		<description><![CDATA[Last month I announced our participation in The Apache Software Foundation by becoming an official mirror. Now I&#8217;m proud to announce that we&#8217;re officially contributing to The GNU Operating System by facilitating a public mirror to their software repository. Nothing &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2012/05/gnu-mirror/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Last month I <a title="Apache Mirror" href="http://blog.sdunix.com/2012/05/apache-mirror/" target="_blank">announced</a> our participation in <a href="http://www.apache.org" target="_blank">The Apache Software Foundation</a> by becoming an official mirror. Now I&#8217;m proud to announce that we&#8217;re officially contributing to <a href="http://www.gnu.org" target="_blank">The GNU Operating System</a> by facilitating a public mirror to their software repository.</p>
<p>Nothing screams open source free software louder than <a href="http://www.gnu.org" target="_blank">GNU</a> and being a part of distributing their software that we all use and love is hopefully a token of how much we appreciate it. I encourage everyone to go to their website to learn more about the software they provide as their hard work often goes unnoticed or gets called by a different name.</p>
<p>Also, it&#8217;s pronounced g&#8217;noo. GNU stands for &#8220;GNU&#8217;s Not Unix!&#8221;.</p>
<p>Our mirror is listed on the GNU Mirror List at:</p>
<p><a href="http://www.gnu.org/prep/ftp.html" target="_blank">http://www.gnu.org/prep/ftp.html</a></p>
<p>To access the mirror directly, visit:</p>
<p><a href="http://mirror.sdunix.com/gnu" target="_blank">http://mirror.sdunix.com/gnu</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2012/05/gnu-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Mirror</title>
		<link>http://blog.sdunix.com/2012/05/apache-mirror/</link>
		<comments>http://blog.sdunix.com/2012/05/apache-mirror/#comments</comments>
		<pubDate>Tue, 15 May 2012 05:56:28 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=139</guid>
		<description><![CDATA[For a long time I&#8217;ve wanted to contribute to the open source community and I&#8217;m happy to announce that SDUNIX has become an official mirror for the Apache Software Foundation. Our mirror can be found at: http://mirror.sdunix.com/apache Being a part &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2012/05/apache-mirror/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>For a long time I&#8217;ve wanted to contribute to the open source community and I&#8217;m happy to announce that SDUNIX has become an official mirror for the Apache Software Foundation. Our mirror can be found at:</p>
<p><a href="http://mirror.sdunix.com/apache" target="_blank">http://mirror.sdunix.com/apache</a></p>
<p>Being a part of distributing software from the Apache Software Foundation is an honor. Knowing that I&#8217;m helping distribute software that powers a large percent of websites all around the world is something I&#8217;m proud to be apart of.</p>
<p>A full listing of mirrors for the Apache Software Foundation can be found at <a href="http://www.apache.org/mirrors" target="_blank">http://www.apache.org/mirrors</a>.</p>
<p>Learn more about the Apache Software Foundation at <a href="http://www.apache.org" target="_blank">http://www.apache.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2012/05/apache-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable IPv6 on FreeBSD via Tunnel Broker</title>
		<link>http://blog.sdunix.com/2011/11/ipv6-router-via-tunnelbroker-net-on-freebsd/</link>
		<comments>http://blog.sdunix.com/2011/11/ipv6-router-via-tunnelbroker-net-on-freebsd/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 18:32:48 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=76</guid>
		<description><![CDATA[I&#8217;m a big supporter of the effort to bring native IPv6 connectivity to all networks. A significant amount of service providers around the world aren&#8217;t yet providing it to their customers. That leaves most people with the option of bringing &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2011/11/ipv6-router-via-tunnelbroker-net-on-freebsd/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big supporter of the effort to bring native IPv6 connectivity to all networks. A significant amount of service providers around the world aren&#8217;t yet providing it to their customers. That leaves most people with the option of bringing IPv6 to their network by using a tunnel broker which tunnels the IPv6 traffic over existing IPv4 connectivity. I&#8217;ve always been hesitant to do this, mostly because I thought performance and stability just wouldn&#8217;t be there, but after taking the time to learn and implement, I&#8217;ve proven myself wrong.</p>
<p>Today, I don&#8217;t have native IPv6 connectivity, but using <a href="http://tunnelbroker.net/" target="_blank">Hurricane Electric&#8217;s Tunnel Broker</a> service, my networks talk to IPv6 hosts seamlessly and performance and stability is impressive.</p>
<p>The setup I detail here was performed on a FreeBSD 9.0-RC2 installation with a standard residential cable modem connection.</p>
<h3>Educate Yourself</h3>
<p>The first thing you should do is read all about IPv6. There are tons of good articles and resources on the web that help you understand all about it. There are LOTS of great resources at <a href="http://tunnelbroker.net/" target="_blank">tunnelbroker.net</a> and they also have a FREE certification program that tests what you have learned and lets you ensure your IPv6 connectivity is implemented properly. The FreeBSD handbook also has a nice IPv6 which is available at:</p>
<p><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-ipv6.html" target="_blank">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-ipv6.html</a></p>
<p>I suggest you do a lot of reading and get comfortable with the concepts. As you setup your tunnel in FreeBSD, it will all come together.</p>
<h3>Create a Tunnel Broker Account</h3>
<p>The first thing you need to do is create an account at <a href="http://tunnelbroker.net/register.php" target="_blank">tunnelbroker.net</a>. Registration is quick and free. You can setup up to 5 tunnels each with a routed /64 and /48.</p>
<h3>Create a New Regular Tunnel</h3>
<p>You&#8217;ll need to create a new tunnel once you have logged into <a href="http://tunnelbroker.net/" target="_blank">tunnelbroker.net</a>. On the left hand menu, you&#8217;ll see an option to &#8220;Create Regular Tunnel&#8221;. The first thing you will need to enter is your FreeBSD router&#8217;s public IP address, which must be reachable via ICMP. Once you put in your public IP address, it will run a check to make sure it is reachable and eligible to be a tunnel endpoint. If ICMP is being blocked, it will inform you of which remote address requires the ability to reach your public IP address via ICMP so that you may configure your firewall appropriately. It will also automatically recommend a remote endpoint for your tunnel based on your location.</p>
<p>Once your tunnel is created, you&#8217;ll be able to see both endpoints configuration as well as the /64 that was assigned to you. A /48 isn&#8217;t automatically assigned, so if you require this, click on &#8220;Assign /48&#8243;. Here is what my tunnel configuration looks like at <a href="http://tunnelbroker.net/" target="_blank">tunnelbroker.net</a>:</p>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkoAAABvCAIAAACcv3hiAAAVl0lEQVR4nO2d324bxRfHeRa/TqV9hr7E3vSKC4JQRRuhtgEWKT9TpNDQ1jRKRJJSm5SShtYgbkKoa8fO36I8xf4u1rt7ZuacM7O265TN9yNfxPP3zNiZ787Z8Z6PUgAAAKB2fHTZBgAAAACzB/IGAACghkDeAAAA1BBW3tpxo9FoxO3yb4Msw0tZM0qGTP4wiZymw1ufAXSYbroFPwZP41UrBZnHF53ftAEAwH+BSeQtZNm2qzGrL+RtNlSQQQAAuDKEyRtZprO8KBmORYAsqyTFFUh5+c1kbtxF9qYoTHvPs0r1KYopWWW2k6HKm7bjlDoq+xmX8Ftum+fMdFZSasG8RGDSoHoAgCvK5PJG/rJzqm1dqsmbybigksXsxXLDJpa3YBsUy00juAZdeXOLufLmtDeXH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omsE4MaWdpEGu5CodN17tHW0febuTOXpml75/Tzn97cXO6U0TkrgZuaf07NJ+5bmSvdInedkn8ubyQr+o16PUnqRpI/81sSPxvQPACoIiPhkfmt09TvLYXL8/zYokFdCJIW8FMNtmOPa7WkIeeo6FyBP6rr3P3Nw/ubh99u7Mu45a2Vzq2VzmdP/h1L53z5xFWdS9184obzJfoUyW8D22b+JKk3+k6X+HMA8AGRy5spdFa0y2qvGEdhe9Xs2KbOFbph8uZc1rWlxZZmFkZddZ1bfHGw+OJgvj2QOjc8ePlpM17nxISVdPDDvyN0zg5Ijvqyyn1xS0PmRiFMbwT4cgWqAQCmgVQOU0Usv82KT/rKM3PuuIaGzhlRNE3nhNchmlg6Z02l0DPRde67X/eHDxJInbu+9Pr60utPHu+WOIci52XMJdOZYp3T+q3ZLlmq+5OpKXP5jTrjYuN0T+A4CwBAJQiaa7tSRtbc8lI6Z0qVxzuUvqEySWMUr5sp0XVuYWOwsDFIFrZlVXvndObx7kxQ58xFmM7WeXROW0WczgmZk8dRrJCn3Q+RSwCoLrqI6H6CWqGLW3HcskjncqejlM4V+Ca6zs23B41ne3PrvYdbR9lnprk709z9+Id/IuOWhtRNMm7pNtb+zMb1/RbJvlh0DgA+JFwnKNcOxVD6/CsRXow9h1KgcyGvJvBcwRjnUObbg2RhO/yJvz9nqK5yDsU+A+I7h6JFGeW1+s8O98E5MVl/3BKZA4DKovhARpGhVsIa6uWW7ZVHHcrGLa1HCuzpTew58TRNr1x7UPjpdrvqTJTzlo6DWbOXJ54NaOV9qB6wc3FWrj5X4JW50HPiopjnCgAAxiTq2baLgLw8AAAfFnbYrxIE1ovOAQDAhPA9ffBOQecAAKDKoHMAAFBl0DkAAKgy/wOMYcZZ3YYHxgAAAABJRU5ErkJggg==" alt="" />The server and client addresses are used in the FreeBSD GIF(4) tunnel that you will create, and the routed /64 are the addresses that you will be able to assign out to devices on your network.</p>
<h3>Configure the Tunnel in FreeBSD</h3>
<p>Now that the tunnel is created at <a href="http://tunnelbroker.net/" target="_blank">tunnelbroker.net</a>, you can configure the GIF(4) interface on your FreeBSD router. Of course, you don&#8217;t have to configure the tunnel at the router, but it&#8217;s the easiest place to configure it and extend the IPv6 connectivity to the rest of your network. Here is what I added to /etc/rc.conf which will enable IPv6 and configure the gif0 interface at boot:</p>
<blockquote><p>ipv6_activate_all_interfaces=&#8221;YES&#8221;<br />
ipv6_gateway_enable=&#8221;YES&#8221;<br />
gifconfig_gif0=&#8221;68.228.214.44 66.220.18.42&#8243;<br />
ifconfig_gif0_ipv6=&#8221;inet6 2001:470:c:12f4::2 2001:470:c:12f4::1 prefixlen 128&#8243;<br />
ipv6_defaultrouter=&#8221;2001:470:c:12f4::1&#8243;</p></blockquote>
<p>After rebooting, you will see a newly create interface called gif0 that should look something like:</p>
<blockquote><p>gif0: flags=8051metric 0 mtu 1280<br />
tunnel inet 68.228.214.44 &#8211;&gt; 66.220.18.42<br />
inet6 fe80::222:3fff:fef1:ee91%gif0 prefixlen 64 scopeid 0xb<br />
inet6 2001:470:c:12f4::2 &#8211;&gt; 2001:470:c:12f4::1 prefixlen 128<br />
nd6 options=21 options=1</p></blockquote>
<h3>Firewall Configuration</h3>
<p>My first instinct was to ping the remote endpoint&#8217;s IPv6 address using ping6 to see if its working, but it timed out. I quickly realized I needed to allow the new setup through my firewall before it would function. IPv6 traffic will need to be configured in the firewall just as IPv4 does. I utilize PF for my firewall and added the following to /etc/pf.conf, which enables ICMP on the new gif0 interface so I can test connectivity using ping6:</p>
<blockquote><p>pass quick on gif0 proto icmp6 all keep state</p></blockquote>
<p>After issuing a pfctl -f /etc/pf.conf to reload my rules, I was able to use ping6 to ping the remote endpoint&#8217;s IPv6 address:</p>
<blockquote><p>PING6(56=40+8+8 bytes) 2001:470:c:12f4::2 &#8211;&gt; 2001:470:c:12f4::1<br />
16 bytes from 2001:470:c:12f4::1, icmp_seq=0 hlim=64 time=25.047 ms<br />
16 bytes from 2001:470:c:12f4::1, icmp_seq=1 hlim=64 time=22.629 ms<br />
16 bytes from 2001:470:c:12f4::1, icmp_seq=2 hlim=64 time=21.922 ms</p>
<p>&#8212; 2001:470:c:12f4::1 ping6 statistics &#8212;<br />
3 packets transmitted, 3 packets received, 0.0% packet loss<br />
round-trip min/avg/max/std-dev = 21.922/23.199/25.047/1.338 ms</p></blockquote>
<p>I also used ping6 to ping www.freebsd.org and ipv6.google.com and was also successful. At this stage, your router will have connectivity to the IPv6 world.</p>
<h3>Enable IPv6 Connectivity on Entire Network</h3>
<p>Now that your router is IPv6 aware, you can extend IPv6 connectivity to your entire network. Each device on your network can be configured with an address in your routed /64 and then talk to other IPv6 hosts. This is where you have to start thinking outside of the box. We&#8217;re all used to DHCP and NAT, but IPv6 doesn&#8217;t necessarily work the same way. While DHCP can still be used with IPv6, it doesn&#8217;t have to be, and NAT doesn&#8217;t need to be used because addresses assigned from your /64 to devices on your network are publicly routed addresses. For this reason, you should ensure you firewall is filtering traffic according to your security policies so that devices obtaining IPv6 addresses aren&#8217;t all of a sudden open on the Internet. Based on the PF rule we defined above, only ICMP would be enabled on any device behind the router that receives an IPv6 address.</p>
<p>The first thing you need to do is configure your internal network interface with an IPv6 address from your routed /64. This enables devices that are behind the router to connect through the internal network interface, and then through gif0. The address you assign to the internal interface becomes the default gateway for IPv6 hosts behind the router. My internal interface is re1, and I added the following to /etc/rc.conf:</p>
<blockquote><p>ifconfig_re1_ipv6=&#8221;inet6 2001:470:d:12f4::1&#8243;</p></blockquote>
<p>Now you have two options&#8230; You can statically assign IPv6 configurations to your devices that are behind the router, or you can configure your devices to automatically get its IPv6 configuration by configuring the router to advertise available IPv6 addresses using rtadvd. To do so, add the following to /etc/rc.conf:</p>
<blockquote><p>rtadvd_enable=&#8221;YES&#8221;<br />
rtadvd_interfaces=&#8221;re1&#8243;</p></blockquote>
<p>You can start the rtadvd daemon by issuing the command /etc/rc.d/rtadvd start. When bringing up an IPv6 enabled device on your network, it should be automatically configured with IPv6 connectivity. You can test IPv6 connectivity on your hosts being using ICMP, or by visiting websites that are only IPv6 enabled, such as <a href="http://ipv6.google.com/" target="_blank">ipv6.google.com</a>. Other sites, like <a href="http://ipv6.he.net/" target="_blank">ipv6.he.net,</a> will show you the remote address that is being used. If a host is configured with both an IPv4 and IPv6 address, IPv6 will usually be used first, and then IPv4 if that fails. That behavior is dependent on the client, but is generally followed.</p>
<h3>Conclusion</h3>
<p>At this point you should have an IPv6 enabled router that allows network devices behind it to communicate with IPv6 hosts on the Internet. I challenge you to make this only the start of your IPv6 adventure. Complete the <a href="http://ipv6.he.net/certification/" target="_blank">IPv6 certification</a> which will force you to learn about DNS, Reverse DNS, and utilizing IPv6 in real life scenarios. Contact your local ISP and find out when IPv6 connectivity will be available. Learn how IPv6 should be secured in your firewall. After your done, you&#8217;ll feel good knowing your prepared for the IPv6 era.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2011/11/ipv6-router-via-tunnelbroker-net-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IPsec VPN Tunnel on FreeBSD</title>
		<link>http://blog.sdunix.com/2011/11/ipsec-vpn-tunnel-on-freebsd-using-racoon/</link>
		<comments>http://blog.sdunix.com/2011/11/ipsec-vpn-tunnel-on-freebsd-using-racoon/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 21:27:51 +0000</pubDate>
		<dc:creator>Matt Lager</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[racoon]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.sdunix.com/?p=20</guid>
		<description><![CDATA[I recently came across the need to establish an always connected secure VPN between two of my office locations. Each location has a FreeBSD router in place. I&#8217;ve worked with establishing these types of VPN connections using OpenVPN and MPD5 &#8230;<p class="read-more"><a href="http://blog.sdunix.com/2011/11/ipsec-vpn-tunnel-on-freebsd-using-racoon/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I recently came across the need to establish an always connected secure VPN between two of my office locations. Each location has a <a href="http://www.freebsd.org">FreeBSD</a> router in place. I&#8217;ve worked with establishing these types of VPN connections using <a href="http://openvpn.net/">OpenVPN </a>and <a href="http://mpd.sourceforge.net/">MPD5</a> before, but I wanted to try setting up an IP-IP tunnel and secure it using the kernel&#8217;s IPsec implementation and the <a href="http://ipsec-tools.sourceforge.net/">racoon</a> IKE key management daemon the exists in the security/ipsec-tools port. I found a good amount of information on the web regarding this setup, but a lot of it old. I&#8217;ve decided to document this here as a configuration that worked very well for me.</p>
<p>The FreeBSD handbook also has some good information about this setup and can be found at the following link:</p>
<p><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ipsec.html" target="_blank">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ipsec.html</a></p>
<p>Also notice that I&#8217;ve got one endpoint running a production release of FreeBSD, and another running a release candidate version. I did this intentionally to catch and variances that could possibly exist between then two major releases, and didn&#8217;t find anything specific.</p>
<p><strong>NOTE: </strong>Anytime there are FreeBSD options that are the same for both endpoints, I will only show the examples once. For configuration items that are different on each endpoint, I will show examples for each endpoint.</p>
<h3><strong></strong>Initial IP-IP Tunnel Configuration</h3>
<p>Before worrying about the IPsec component, I needed to make sure that raw unencrypted connectivity was in place. The easiest way to do this was to setup an IP-IP tunnel using the GIF(4) interface. I&#8217;ve detailed the setup of both endpoints below. The 192.168.0.0 network will be used to represent public IP addresses, and the 172.16.0.0 network will be used to represent internal IP addresses. You&#8217;ll also notice I&#8217;ve included the static routes that need to be in place so that each endpoint can access the other endpoint&#8217;s network. I&#8217;ve configured this in /etc/rc.conf which will persist the configuration after a reboot.</p>
<blockquote><p><strong>Endpoint 1 &#8211; FreeBSD 9.0-RC2</strong></p>
<p>ifconfig_re0=&#8221;inet 192.168.1.1  netmask 255.255.255.0&#8243; # PUBLIC ADDRESS<strong><br />
</strong>ifconfig_re1=&#8221;inet 172.16.1.1 netmask 255.255.255.0&#8243; # INTERNAL ADDRESS<br />
gif_interfaces=&#8221;gif0&#8243;<br />
gifconfig_gif0=&#8221;192.168.1.1 192.168.2.1&#8243;<br />
ifconfig_gif0=&#8221;inet 172.16.1.1 172.16.2.1 netmask 255.255.255.0&#8243;<br />
static_routes=&#8221;vpnroute&#8221;<br />
route_vpnroute=&#8221;-net 172.16.2.0/24 172.16.2.1&#8243;</p></blockquote>
<blockquote><p><strong>Endpoint 2 &#8211; FreeBSD 8.2-RELEASE-p4<br />
</strong></p>
<p>ifconfig_re0=&#8221;inet 192.168.2.1 netmask 255.255.255.0&#8243; # PUBLIC ADDRESS<strong><br />
</strong>ifconfig_re1=&#8221;inet 172.16.2.1 netmask 255.255.255.0&#8243; # INTERNAL ADDRESS<br />
gif_interfaces=&#8221;gif0&#8243;<br />
gifconfig_gif0=&#8221;192.168.2.1 192.168.1.1&#8243;<br />
ifconfig_gif0=&#8221;inet 172.16.2.1 172.16.1.1 netmask 255.255.255.0&#8243;<br />
static_routes=&#8221;vpnroute&#8221;<br />
route_vpnroute=&#8221;-net 172.16.1.0/24 172.16.1.1&#8243;</p></blockquote>
<p>After configuring the above and rebooting, the gif0 interfaces were created. I tried pinging endpoint 1 from endpoint 2 without success, which was expected as I hadn&#8217;t yet allowed the traffic through the firewall.</p>
<h3>Configuring the Firewall</h3>
<p>I implement a &#8220;block all by default&#8221; firewall, so by default the traffic wasn&#8217;t allowed, including ICMP. The configuration below was pulled directly out of the <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ipsec.html" target="_blank">VPN over IPsec</a> handbook page. I use PF for my firewall, you&#8217;ll need to adapt this to your setup. Note that the rules below not only apply to the IP-IP tunnel, but also the IPsec implementation.</p>
<blockquote><p>pass in quick proto esp from any to any<br />
pass in quick proto ah from any to any<br />
pass in quick proto ipencap from any to any<br />
pass in quick proto udp from any port = 500 to any port = 500<br />
pass in quick on gif0 from any to any<br />
pass out quick proto esp from any to any<br />
pass out quick proto ah from any to any<br />
pass out quick proto ipencap from any to any<br />
pass out quick proto udp from any port = 500 to any port = 500<br />
pass out quick on gif0 from any to any</p></blockquote>
<p>After reloading my firewall rules on both endpoints, I was able to successfully ping each endpoint&#8217;s internal IP address.</p>
<h3>Securing the Tunnel w/ IPsec and Racoon</h3>
<p>Now that we have created a network configuration that enables connectivity between the endpoint&#8217;s internal networks, we must encrypt the traffic. Skipping this step would mean that all traffic crossing the tunnel would be insecure (unless secured by other means). FreeBSD implements IPsec in its kernel, and along with the security/ipsec-tools port, you can encrypt all traffic that is sent through the tunnel.</p>
<h4>Kernel Configuration</h4>
<p>IPsec must be configured into the FreeBSD&#8217;s kernel configuration file, and he kernel must be rebuilt. I added the following option and device to my kernel&#8217;s configuration file, rebuilt, installed, and rebooted.</p>
<blockquote><p>options   IPSEC        #IP security<br />
device    crypto</p></blockquote>
<p>The FreeBSD handbook also mentions the use of the IPSEC_DEBUG option, but I chose not to compile this into the kernel.</p>
<h4>Security Policies</h4>
<p>IPsec security policies must be defined and set to load into the Security Policy Database (SPD). This enables FreeBSD and racoon to encrypt / decrypt traffic between the two endpoints. The rules can be defined in a text file, then loaded at boot. I kept my policies in /usr/local/etc/racoon/setkey.conf and the file contained the following:</p>
<blockquote><p><strong>Endpoint 1:</strong></p>
<p>flush;<br />
spdflush;<br />
spdadd 172.16.1.0/24 172.16.2.0/24 any -P out ipsec esp/tunnel/192.168.1.1-192.168.2.1/use;<br />
spdadd 172.16.2.0/24 172.16.1.0/24 any -P in ipsec esp/tunnel/192.168.2.1-192.168.1.1/use;</p></blockquote>
<blockquote><p><strong>Endpoint 2:</strong></p>
<p>flush;<br />
spdflush;<br />
spdadd 172.16.2.0/24 172.16.1.0/24 any -P out ipsec esp/tunnel/192.168.2.1-192.168.1.1/use;<br />
spdadd 172.16.1.0/24 172.16.2.0/24 any -P in ipsec esp/tunnel/192.168.1.1-192.168.2.1/use;</p></blockquote>
<p>I added the following to my /etc/rc.conf on each endpoint which tells FreeBSD to enable IPsec and load the policies into the SPD:</p>
<blockquote><p>ipsec_enable=&#8221;YES&#8221;<br />
ipsec_file=&#8221;/usr/local/etc/racoon/setkey.conf&#8221;</p></blockquote>
<p>After running /etc/rc.d/ipsec start, I could view the SPD  by issuing the setkey -DP command to ensure the policies were loaded properly.</p>
<h4>Configuring Racoon</h4>
<p>At this stage, we have IP-IP connectivity configured and tested, IPsec has been compiled into the kernel, and the IPsec security policy database contains the policies loaded from the setkey.conf file. Now we must configure the racoon IKE key management daemon. First, you&#8217;ll need to make sure your ports are up to date and install security/ipsec-tools:</p>
<blockquote><p>cd /usr/ports/security/ipsec-tools<br />
make install clean</p></blockquote>
<p>After the port installs, you&#8217;ll first want to copy the racoon sample configuration file into place, and create a psk.txt file that will contain the pre-shared key that will be used during racoon&#8217;s negotiation process, and set the owner / permissions appropriately:</p>
<blockquote><p>cp /usr/local/share/examples/ipsec-tools/racoon.conf.sample /usr/local/etc/racoon/racoon.conf<br />
touch /usr/local/etc/racoon/psk.txt<br />
chown root:wheel /usr/local/etc/racoon/psk.txt<br />
chmod 600 /usr/local/etc/racoon/psk.txt</p></blockquote>
<p>Edit the /usr/local/etc/racoon/psk.txt file. It should contain the remote endpoint&#8217;s public IP address and a unique password:</p>
<blockquote><p><strong>Endpoint 1:</strong></p>
<p>192.168.2.1 SomeMadeUpPassword</p></blockquote>
<blockquote><p><strong>Endpoint 2:</strong></p>
<p>192.168.1.1 SomeMadeUpPassword</p></blockquote>
<p>Next, the racoon.conf file needs to be edited. There are many options to this file, and it&#8217;s probably best to learn all about it via the racoon.conf(5) man page. That being said, the one below is based on a lot of what I&#8217;ve found on the web, and works really nicely for me.</p>
<blockquote><p><strong>Endpoint 1:</strong></p>
<p># $KAME: racoon.conf.sample,v 1.28 2002/10/18 14:33:28 itojun Exp $</p>
<p>path include &#8220;/usr/local/etc/racoon&#8221; ;<br />
path pre_shared_key &#8220;/usr/local/etc/racoon/psk.txt&#8221; ;<br />
log debug;</p>
<p>padding # options are not to be changed<br />
{<br />
maximum_length 20; # maximum padding length<br />
randomize off; # enable randomize length<br />
strict_check off; # enable strict check<br />
exclusive_tail off; # extract last one octet<br />
}</p>
<p>listen # address [port] that racoon will listening on<br />
{<br />
isakmp 192.168.1.1 [500];<br />
}</p>
<p>timer # timing options. change as needed<br />
{<br />
counter 5; # maximum trying count to send<br />
interval 20 sec; # maximum interval to resend<br />
persend 1; # the number of packets per a send<br />
phase1 60 sec;<br />
phase2 25 sec;<br />
}</p>
<p>remote 192.168.2.1 [500]<br />
{<br />
exchange_mode aggressive,main;<br />
doi ipsec_doi;<br />
situation identity_only;<br />
lifetime time 8 hour;<br />
initial_contact on;<br />
passive off;<br />
proposal_check obey;<br />
generate_policy off;</p>
<p>proposal {<br />
encryption_algorithm blowfish;<br />
hash_algorithm sha1;<br />
authentication_method pre_shared_key;<br />
dh_group 5;<br />
}</p>
<p>}</p>
<p>sainfo anonymous<br />
{<br />
pfs_group 5;<br />
lifetime time 12 hour ;<br />
encryption_algorithm blowfish,3des,des;<br />
# authentication_algorithm hmac_md5,hmac_sha1;<br />
authentication_algorithm hmac_sha1;<br />
compression_algorithm deflate ;<br />
}</p></blockquote>
<blockquote><p><strong>Endpoint 2:</strong></p>
<p># $KAME: racoon.conf.sample,v 1.28 2002/10/18 14:33:28 itojun Exp $</p>
<p>path include &#8220;/usr/local/etc/racoon&#8221; ;<br />
path pre_shared_key &#8220;/usr/local/etc/racoon/psk.txt&#8221; ;<br />
log debug;</p>
<p>padding # options are not to be changed<br />
{<br />
maximum_length 20; # maximum padding length<br />
randomize off; # enable randomize length<br />
strict_check off; # enable strict check<br />
exclusive_tail off; # extract last one octet<br />
}</p>
<p>listen # address [port] that racoon will listening on<br />
{<br />
isakmp 192.168.2.1 [500];<br />
}</p>
<p>timer # timing options. change as needed<br />
{<br />
counter 5; # maximum trying count to send<br />
interval 20 sec; # maximum interval to resend<br />
persend 1; # the number of packets per a send<br />
phase1 60 sec;<br />
phase2 25 sec;<br />
}</p>
<p>remote 192.168.1.1 [500]<br />
{<br />
exchange_mode aggressive,main;<br />
doi ipsec_doi;<br />
situation identity_only;<br />
lifetime time 8 hour;<br />
initial_contact on;<br />
passive off;<br />
proposal_check obey;<br />
generate_policy off;</p>
<p>proposal {<br />
encryption_algorithm blowfish;<br />
hash_algorithm sha1;<br />
authentication_method pre_shared_key;<br />
dh_group 5;<br />
}</p>
<p>}</p>
<p>sainfo anonymous<br />
{<br />
pfs_group 5;<br />
lifetime time 12 hour ;<br />
encryption_algorithm blowfish,3des,des;<br />
# authentication_algorithm hmac_md5,hmac_sha1;<br />
authentication_algorithm hmac_sha1;<br />
compression_algorithm deflate ;<br />
}</p></blockquote>
<h4>Starting Racoon</h4>
<p>Now that everything is in place, you&#8217;ll want to add racoon to start at boot in /etc/rc.conf, and then start it on both sides to and check to make sure the negotiation was successful. I found the best way to do this is to add the configuration lines to each endpoint&#8217;s /etc/rc.conf, then start racoon and review the SAD tables and racoon log files. First add the lines to /etc/rc.conf:</p>
<blockquote><p>racoon_enable=&#8221;yes&#8221;<br />
racoon_flags=&#8221;-l /var/log/racoon.log&#8221;</p></blockquote>
<p>Start racoon on each host:</p>
<blockquote><p>/usr/local/etc/rc.d/racoon start</p></blockquote>
<p>After starting racoon, ping endpoint 2&#8242;s internal IP address from endpoint 1, this will get the negotiation process under way if it&#8217;s not already. There are two ways to validate that the negotiation was successful. The first is to review the /var/log/racoon.log file and check for signs of success. You should see something like:</p>
<blockquote><p>2011-11-21 12:15:16: INFO: IPsec-SA established: ESP/Tunnel 192.168.1.1[500]-&gt;192.168.2.1[500] spi=56832670(0x363329e)</p></blockquote>
<p>The other way is to use setkey to dump the SAD tables, which will only exist if the IPsec negotiation was successful:</p>
<blockquote><p>setkey -D</p></blockquote>
<p>You should see output displaying the encryption algorithms that are being used, as well as other information.</p>
<h3>Validating Encryption</h3>
<p>Before you can sleep at night knowing your VPN is secure, you should run some simple tests to make sure traffic is being encrypted. tcpdump is a good way to do this. On one endpoint, or both, use tcpdump to dump the public interface&#8217;s traffic and look to make sure you see ESP records:</p>
<blockquote><p>tcpdump -n -i re0 host 192.168.1.1 and dst 192.168.2.1<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on re0, link-type EN10MB (Ethernet), capture size 65535 bytes<br />
18:51:29.800977 IP 192.168.1.1 &gt; 192.168.2.1: ESP(spi=0x0693d993,seq=0&#215;7), length 116<br />
18:51:31.713245 IP 192.168.1.1 &gt; 192.168.2.1: ESP(spi=0x0693d993,seq=0&#215;8), length 116</p></blockquote>
<p>If encryption isn&#8217;t working place, you&#8217;ll see something more along the lines of:</p>
<blockquote><p>18:56:47.315538 IP 192.168.1.1.63035 &gt; 192.168.2.1.22: Flags [F.], seq 0, ack 41, win 913, options [nop,nop,TS val 160362725 ecr 375854087], length 0</p></blockquote>
<h3>Conclusion</h3>
<p>If everything has gone to plane, you should have a secure IPsec VPN tunnel between to FreeBSD endpoints. Though this setup is slightly more complex, I prefer it over other VPN methods when it&#8217;s relating to a permanent VPN.</p>
<p>Once nice thing about the tunnel method is the interface that the tunnel is created on, in our case gif0, can be worked with just like any other interface. Traffic graphs can be generated showing just VPN traffic using SNMP and <a href="http://cacti.net/" target="_blank">Cacti</a>. Firewall rules can clearly be defined at the interface level. Best of all, everything can be automated at boot using standard rc.conf variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sdunix.com/2011/11/ipsec-vpn-tunnel-on-freebsd-using-racoon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
