<?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>Your Warranty Is Void.com &#187; How-To&#8217;s</title>
	<atom:link href="http://www.yourwarrantyisvoid.com/category/howtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yourwarrantyisvoid.com</link>
	<description>Linux, Hardware, Software and Chaos. What more is there?</description>
	<lastBuildDate>Wed, 18 Jan 2012 03:59:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Networking: Bringing IPv6 into your network using pfSense</title>
		<link>http://www.yourwarrantyisvoid.com/2011/12/01/networking-bringing-ipv6-into-your-network-using-pfsense/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/12/01/networking-bringing-ipv6-into-your-network-using-pfsense/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 23:06:05 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=1047</guid>
		<description><![CDATA[The Internet as we know it is undergoing a significant change.  With the last IPv4 addresses being allocated out, the Internet has officially run out of address space.  IPv6 is the next-generation IP addressing system that aims to resolve this issue however the changes proposed are drastically different than the current IP schema currently in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-1049" title="he-pfsense-ipv6-logo" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/he-pfsense-ipv6-logo.png" alt="Hurricane Electric, PfSense and IPv6" width="497" height="172" />The Internet as we know it is undergoing a significant change.  With the last IPv4 addresses being allocated out, the Internet has officially run out of address space.  IPv6 is the next-generation IP addressing system that aims to resolve this issue however the changes proposed are drastically different than the current IP schema currently in place and for most is quite a daunting task to switch. In this post, we will cover some basic IPv6 information and some fundamental differences between v4 and v6 (aside from tons of IPs), and finally we will build out a pfSense firewall with IPv6 using pfSense and a free IPv6 tunnel provided by Hurricane Electric. Read more to get started on the cutting-edge of Internet infrastructure.<span id="more-1047"></span></p>
<h1>IPv6 Introduction</h1>
<h2>First, the basics&#8230;.</h2>
<p>Understanding IPv6 networking may first come off as an extremely complicated endeavor however it&#8217;s not that much different from IPv4.  The biggest thing about IPv6 is the massive amount of IPs that are made available by the change in the network protocol.  To put it in perspective, the entirety of the existing IPv4 address space consists of approximately 4,228,250,625 addresses (from 0.0.0.0 to 255.255.255.255, or 255^4 including private network blocks and multicast addresses) An IPv6 network block (like the /64 network block that we&#8217;ll get from Hurricane Electric) contains  18,446,744,073,709,551,616 IPs.  The /64 network assigned to us from Hurricane Electric is only a minuscule fraction of the entire IPv6 address space.</p>
<p>An IP address in IPv4 uses four numbers in a dotted quad notation with numbers between 0 and 255, like 192.168.1.4 and will include a subnet mask like 255.255.255.0.  This is used to establish the &#8220;network&#8221; that an IP address is a member of. An IPv6 address is radically different, with 8 hexidecimal (from 0000 to FFF) numbers seperated by a colon (:), then following up with a subnet mask in CIDR notation. An example of an IPv6 address (in this case, ipv6.google.com) is 2001:4860:4002:0802:0000:0000:0000:1010.  Rather than spell all that out, you can use :: to represent one contiguous block of zeros, and leading zeros can be removed.  The formidable example address now becomes slightly less scary 2001:4860:4002:802::1010.  Another example of an IPv6 address in this &#8220;compressed&#8221; notation, would be the IP address for Facebook 2620:0:1cfe:face:b00c::3 (faceb00c, lol). Yet another funny IPv6 address is cisco.com, at 2001:420:80:1:c:15:c0:d06:f00d (c15co, f00d).</p>
<h2>Some differences in IPv4 and IPv6</h2>
<p>The biggest difference in IPv6 from a network standpoint is that it virtually eliminates the requirement for Network Address Translation.  Instead of proxying an IP address for multiple home networks/hosts, your IPv6 network is fully routable, meaning that you can access your home computer from the Internet without the need of using port forwarding or IP masquerading.  While you technically can NAT an IPv6 address, it&#8217;s no longer an absolute requirement for Internet access. Because the Internet can now access your network, it is especially important that your firewall is configured to deny incoming connections from the Internet and explicitly allow connections on an as-needed basis (like running a web server from home, etc..). We will establish a common ruleset later on, once we have completed the IPv6 configuration.</p>
<p>Another significant change in IPv6 is changes made to the DHCP protocol.  Instead of a DHCP server telling a host what the default gateway is for the attached network, the host will instead listen for a router advertisement and will use that in its internal routing table to know how to get to the public Internet.  This router advertisement is handled by radvd which announces the router&#8217;s IP address to the network.</p>
<h2>A few things to consider</h2>
<p>When <a href="http://www.worldipv6day.org/" target="_blank">World IPv6 Test Day</a> was enacted and executed last June, many major websites went online and started offering IPv4 and IPv6 dual stack websites for the purpose of testing the world&#8217;s readiness for IPv6.  Many important things were discovered that day including the fact that most CPE devices (like Linksys routers, DSL and Cable modems and other devices) were not IPv6 compatible.  This was later broadened to include many Internet-connected devices like DVRs, Media machines and other devices were also not ready for IPv6. While some sites maintain IPv6 connectivity, once World IPv6 Test Day closed, so did many sites on IPv6 connectivity.</p>
<p>Before you start out on bringing IPv6 into your network, it is important to understand that IPv6 is still regarded as being an experimental protocol. Most of the sites you are used to won&#8217;t work in a pure IPv6 environment so we are going to set up a dual-stack network.  This means that you will be able to bring in IPv6 connectivity for IPv6 only sites and still be able to access your IPv4 sites just like your network has done in the past.</p>
<p>It is also important to realize that most embedded class devices will not use IPv6.  Devices like embedded media players, game systems, WiFi access points, printers and the like  may not support IPv6 even with firmware updates from the manufacturer.  Some devices may get support later on through vendor updates however many devices will probably not work.</p>
<p>At the very least you will learn a lot about IPv6 deployment, and you will have plenty of time to test your equipment prior to IPv6 becoming mandatory.</p>
<h1>Enough of the theory already, Let&#8217;s get started.</h1>
<p>In order to bring IPv6 into your home, we will be using an IPb6 tunnel provided by Hurricane Electric&#8217;s <a href="http://tunnelbroker.net/" target="_blank">TunnelBroker.net</a> service.  The service is free, and they provide you with a full /64 IPv6 network to play with.  In addition, they provide a certification service to test your IPv6 knowledge and skills once your IPv6 connectivity is up and running.  They give you a series of goals to accomplish even after your tunnel is up and you&#8217;re routing away and plus, it makes for great bragging rights.</p>
<p>In order to pull this off, you&#8217;ll need the following:</p>
<ul>
<li>PfSense 2.0 installed and working at the edge router on your network.<strong></strong></li>
<li>A client computer for testing. ( Windows Xp, Windows Vista, Windows 7, Linux, etc..)</li>
<li>Network switch, etc to make sure your client computer is connected to your router.</li>
<li>A WAN Internet connection.  (DHCP, Static, PPPoE, etc does not matter as long as it&#8217;s broadband)</li>
</ul>
<p><strong>Please Note:</strong> Due to the fact that we are using git to sync experimental code, you <strong>cannot</strong> use pfSense Embedded.  I tried to find a way around this, but unfortunately even at the 4GB disk image size, I was never able to get it to fit and work.</p>
<p>The IPv6 configuration will be split up into six sections:</p>
<ol>
<li>Configuring your existing pfSense router to sync up the latest IPv6 code.</li>
<li>Registering for an IPv6 Tunnel from Hurricane Electric.</li>
<li>Configuring pfSense for the tunnel, and DHCPv6.</li>
<li>Configuring workstations for IPv6.</li>
<li>Performing website testing</li>
</ol>
<h2>1: Sync up the latest IPv6 code</h2>
<p>We&#8217;ll start off with our already established and running pfSense router. We will need to enable SSH on the router so we can get to the commandline.  This will be the only time you will need to access the commandline however I do recommend leaving it enabled so you can troubleshoot the IPv6 connection later on.</p>
<p>Start off by logging into the router.  Click on &#8220;System&#8221;, then &#8220;Advanced&#8221;.  Place a check box next to &#8220;Enable Secure Shell&#8221;.  If you don&#8217;t want to use the standard port of &#8220;22&#8243;, you can specify a different port below.  Scroll down to the bottom and hit &#8220;Save&#8221;.  Don&#8217;t worry about opening up your SSH port, this does not enable it on the WAN interface.</p>
<div id="attachment_1055" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/enablessh.png"><img class="size-medium wp-image-1055 " title="Enabling SSH" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/enablessh-300x196.png" alt="Enabling SSH" width="300" height="196" /></a><p class="wp-caption-text">Enabling SSH in pfSense</p></div>
<p>Open up PuTTY and type in the IP address of your router.  If you specified an SSH port, be sure to specify it here as well.  For reference, here is my PuTTY configuration.</p>
<div id="attachment_1056" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/enablessh2.png"><img class="size-medium wp-image-1056 " title="PuTTY settings" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/enablessh2-300x287.png" alt="PuTTY settings" width="300" height="287" /></a><p class="wp-caption-text">PuTTY settings</p></div>
<p>Upon successful connection, you will be prompted for a username.  Use the same username and password you use for the Web UI (admin/pfsense).  Once you have successfully logged in, you will get the same status screen like you see on the serial port showing the WAN and LAN statuses and a menu.</p>
<div id="attachment_1057" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession.png"><img class="size-medium wp-image-1057 " title="SSH menu" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession-300x240.png" alt="SSH menu" width="300" height="240" /></a><p class="wp-caption-text">SSH menu</p></div>
<p>Select option 8 (Shell) and then type in the following command:  <strong>pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-8.1-release/Latest/git.tbz</strong>  This will install GIT and perform the update.  This will take several minutes to download and install all of the packages required to perform the sync.</p>
<div id="attachment_1058" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession2.png"><img class="size-medium wp-image-1058 " title="Installing Git" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession2-300x240.png" alt="Installing Git" width="300" height="240" /></a><p class="wp-caption-text">Installing Git</p></div>
<p>Once it has completed, type in <strong>exit</strong> or hit Ctrl-D to return to the SSH menu. At the SSH menu, type option <strong>12</strong> for the &#8220;pfSense Developer Menu&#8221;.</p>
<div id="attachment_1059" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession3.png"><img class="size-medium wp-image-1059 " title="Accessing the Developer Shell" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession3-300x240.png" alt="Accessing the Developer Shell" width="300" height="240" /></a><p class="wp-caption-text">Accessing the Developer Shell</p></div>
<p>Now we will do the GIT sync. It is important to follow these instructions exactly as this is where the current running pfSense code is synched up with the pfSense developer code.    At the pfSense developer shell prompt, type in <strong>playback gitsync</strong> and hit enter.</p>
<div id="attachment_1060" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession4.png"><img class="size-medium wp-image-1060 " title="Performing the Git sync" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession4-300x240.png" alt="Performing the Git sync" width="300" height="240" /></a><p class="wp-caption-text">Performing the Git sync</p></div>
<p>You will be prompted for the git branch to sync against.  Type in <strong>master</strong> and hit enter.  The next prompt will be for a custom RCS branch, just hit enter as we want to use the master branch only.  After you hit enter, the GIT Sync will begin.</p>
<div id="attachment_1061" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession5.png"><img class="size-medium wp-image-1061 " title="Specifying the Git Branch" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession5-300x240.png" alt="Specifying the Git Branch" width="300" height="240" /></a><p class="wp-caption-text">Specifying the Git Branch</p></div>
<p>Ok, now here&#8217;s the kicker.  <strong><em><span style="text-decoration: underline;">You must reboot!</span></em></strong> In the screenshot below, it looks like the upgrade has terminated and the device has restarted services however there are settings that have been changed that will only take effect on the next reboot.  The SSH Session should drop you back to the main SSH menu (what you saw when you initially logged in).  From here, select option <strong>5</strong> and answer <strong>y</strong> to reboot the device.</p>
<div id="attachment_1062" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession6.png"><img class="size-medium wp-image-1062 " title="Reboot after your SSH session gets terminated" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/sshsession6-300x240.png" alt="Reboot after your SSH session gets terminated" width="300" height="240" /></a><p class="wp-caption-text">Reboot after your SSH session gets terminated</p></div>
<p>When the router has successfully rebooted, check that your Internet connection works and that all is working well.  The one thing that remains is to set up an ICMP rule to allow Hurricane Electric to ping your WAN interface.  This is required as part of the tunnel setup. Login to your router, click on &#8220;<strong>Firewall</strong>&#8220;, then &#8220;<strong>Rules</strong>&#8220;.  Click the &#8220;+&#8221; add button at the bottom and add a new rule.  Set the interface to <strong>WAN</strong>, protocol to <strong>ICMP</strong>, and ICMP Type to <strong>Any</strong>.  (This can be modified later).  For the source, set the type to &#8220;<strong>Single Host or Alias</strong>&#8221; and enter the IP address of <strong>66.24.2.74</strong>.  This is the IP address of the IPv6 test endpoint.  Set the destination to &#8220;<strong>WAN Address</strong>&#8221; and lastly, enter a description.   Refer to the screenshot below if you need help.</p>
<div id="attachment_1063" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/wanping.png"><img class="size-medium wp-image-1063  " title="WAN Ping rule" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/wanping-300x257.png" alt="WAN Ping rule" width="300" height="257" /></a><p class="wp-caption-text">WAN Ping rule</p></div>
<p>Now that everything is in place in your router, it&#8217;s time to get your tunnel.</p>
<h2>2:Registering with Hurricane Electric</h2>
<p>Now that our router is prepped for the IPv6 installation, it&#8217;s time to register the account with Hurricane Electric.  Head on over to <a title="Hurricane Electric Tunnel Broker" href="http://tunnelbroker.net/" target="_blank">tunnelbroker.net</a> and register an account.  Once you&#8217;ve registered the account, you will get an email with the account information and a validation link.  After you validate, click on the &#8220;Create Regular Tunnel&#8221; on the left hand sidebar and you will be provided a form similar to the one in the screenshot below.  Be sure to select an endpoint that is as geographically close to you as possible or let the tool recommend the closest endpoint.  (Note: Hurricane Electric allows you to create up to five tunnels. If this is your first tunnel, you will not see the &#8220;You currently have 1 of 5 tunnels&#8221; message.)  Type your WAN IP address into the &#8220;IPv4 Endpoint&#8221; field, select the endpoint, then scroll down and hit &#8220;Create Tunnel&#8221;.</p>
<div id="attachment_1067" class="wp-caption aligncenter" style="width: 263px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel1.png"><img class="size-medium wp-image-1067 " title="Hurricane Electric Tunnel Setup" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel1-253x300.png" alt="Hurricane Electric Tunnel Setup" width="253" height="300" /></a><p class="wp-caption-text">Hurricane Electric Tunnel Setup</p></div>
<p>After your tunnel has been successfully created, you will get a page that shows your tunnel information.  At the bottom of the page, you will notice that the rDNS delegation fields are blank. Click the &#8220;delegate to dns.he.net&#8221; link to autofill the reverse nameservers with Hurricane Electric&#8217;s default nameservers.  Click &#8220;Save&#8221; to commit the changes, then print this page. You will need it for the pfSense page.  Keep in mind that the tunnel IP address and the Routed /64 are off by <strong><span style="text-decoration: underline;">one digit</span></strong>. This will be important later on.</p>
<div id="attachment_1068" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel2.png"><img class="size-medium wp-image-1068 " title="Tunnel Information Page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel2-300x286.png" alt="Tunnel Information Page" width="300" height="286" /></a><p class="wp-caption-text">Tunnel Information Page</p></div>
<p>If you are on a dynamic IP connection (DSL, Cable Internet, FiOS, etc&#8230;), there&#8217;s one more thing you need to be aware of.  Should your WAN IP change, you will need to update your tunnel. When you login to Hurricane Electric, you will get a page similar to the below, showing all of the configured tunnels on your account.</p>
<div id="attachment_1069" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel3.png"><img class="size-medium wp-image-1069 " title="Tunnel List Page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel3-300x205.png" alt="Tunnel List Page" width="300" height="205" /></a><p class="wp-caption-text">Tunnel List Page</p></div>
<p>To edit the tunnel, click on the tunnel name and you&#8217;ll be taken to the Tunnel Information page.  Click on the Client IPv4 address and make your IP change then simply click elsewhere on the page (not on a link) and wait for the text field to turn back to a link.  If it does not, it will provide an error message indicating the error (usually that it can not ping the WAN).</p>
<div id="attachment_1070" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel4.png"><img class="size-medium wp-image-1070 " title="WAN IP Setup Error" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/11/hetunnel4-300x297.png" alt="WAN IP Setup Error" width="300" height="297" /></a><p class="wp-caption-text">WAN IP Setup Error</p></div>
<h2>3: Configuring pfSense</h2>
<h3>Building up our tunnel endpoint</h3>
<p><strong>Note</strong>:  From here on out, I will be using the example IPs of <strong>2001:470:1234:567<span style="text-decoration: underline;">8</span>::</strong> for the IPv6 tunnel and <strong>2001:470:1234:567<span style="text-decoration: underline;">9</span>::</strong> for the Routed /64.  In your tunnelbroker.net configuration, you should have a similar offset (your tunnel is one IP less than your routed netblock).  Please keep this in mind as we go through the next steps as you can not get the two confused.</p>
<p>We have a synched router and we have our tunnel configuration. Now it&#8217;s time to start configuring pfSense.  We will start out by building out the tunnel endpoint. Login to the router and click on <strong>Interfaces &gt; Assign</strong> and click on the <strong>GIF</strong> tab.  We will be adding a GIF tunnel in order to bring in the IPv6 connectivity to our router. GIF uses <a href="http://www.ietf.org/rfc/rfc2893.txt" target="_blank">RFC2893</a> to encapsulate IPv6 into an IPv4 packet.  When we receive an encapsulated packet, pfSense will &#8220;unpack&#8221; it and reassemble it into an IPv6 packet before acting on it according to the firewall policy.  On the GIF tab, click the &#8220;<strong>+</strong>&#8221; link and enter your IPv6 tunnel endpoint information.</p>
<ul>
<li>Parent Interface should be set to WAN</li>
<li>GIF Remote Address should be the &#8220;Server IPv4 address&#8221;</li>
<li>GIF Tunnel Local Address should be the &#8220;Client IPv6 address&#8221;</li>
<li>GIF Tunnel Remote Address should be the &#8220;Server IPv6 address&#8221;</li>
<li>Description should be something descriptive but can be freeform.</li>
</ul>
<div id="attachment_1076" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense1.png"><img class="size-medium wp-image-1076" title="GIF interface page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense1-300x167.png" alt="GIF interface page" width="300" height="167" /></a><p class="wp-caption-text">GIF interface page</p></div>
<p>Once complete, hit &#8220;Save&#8221;. This will add the tunnel endpoint to the router. Click on <strong>Interface Assignments</strong> so we can assign it to a virtual interface.  To do this, click on the &#8220;<strong>+</strong>&#8221; icon and the GIF tunnel should show up as an OPT interface as shown in the screenshot below.</p>
<div id="attachment_1077" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense2.png"><img class="size-medium wp-image-1077" title="Interfaces page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense2-300x124.png" alt="Interfaces page" width="300" height="124" /></a><p class="wp-caption-text">Interfaces page</p></div>
<p>Now we need to configure the OPT interface. Click on <strong>Interfaces &gt; OPT1</strong>.  This will be the equivalent to the &#8220;WAN&#8221; of our IPv6 network.  Since it has never been used before, it is disabled by default. Place a checkbox next to &#8220;<strong>Enable Interface</strong>&#8221; which will add the IPv6 configuration section shown here. Set the <strong></strong></p>
<p>Click on the text &#8220;<strong>Add a new one</strong>&#8221; in the Gateway section and enter the configuration as shown.</p>
<ul>
<li>Default v6 Gateway should be <strong>Checked</strong>.</li>
<li>Gateway Name IPV6 is a brief one-word name to help you identify the gateway.  I have chosen &#8220;IPV6GW&#8221;.</li>
<li>Gateway IPv6 should be the <strong>Server IPv6 Address</strong>.</li>
<li>Description is an arbitrary length text to describe this gateway definition.</li>
</ul>
<p>When you&#8217;re done, you should have something similar to what is in the below screenshot.  For some reason, the gateway text showed up very small, so I increased the zoom so it was readable.</p>
<div id="attachment_1078" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense3.png"><img class="size-medium wp-image-1078" title="IPV6WAN setup" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense3-300x288.png" alt="IPV6WAN setup" width="300" height="288" /></a><p class="wp-caption-text">IPV6WAN setup</p></div>
<p>Click on &#8220;<strong>Save Gateway</strong>&#8221; first to commit the gateway information. You should see te IPv6 gateway show up in a dropdown.  Next, scroll down and click &#8220;<strong>Save</strong>&#8221; to save the Interface information.  Finally, click &#8220;<strong>Apply Changes</strong>&#8221; to apply the interface configuration and start the tunnel.  You can validate the tunnel&#8217;s operation by checking the dashboard (click on the pfSense logo).  If you don&#8217;t have the Interfaces and the Gateways windows, they can be added by clicking on the &#8220;<strong>+</strong>&#8220;  and selecting the relevant options.</p>
<div id="attachment_1079" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense4.png"><img class="size-medium wp-image-1079" title="Dashboard status page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense4-300x228.png" alt="Dashboard status page" width="300" height="228" /></a><p class="wp-caption-text">Dashboard status page</p></div>
<p>Now that the endpoint is up and running, it&#8217;s time to configure the LAN interface.</p>
<h3>Setting up the LAN interface</h3>
<p>Since we&#8217;re running in a dual-stack configuration, we are going to just add the IPv6 information to the existing IPv4 interface.  As an option, you could theoretically set up a VLAN and a new LAN interface and create an IPv6 only network.  This is something I&#8217;m planning on my network and something I&#8217;m sure I&#8217;ll cover in another article. Let&#8217;s start off by pulling up the LAN configuration via <strong>Interfaces &gt; LAN</strong>.</p>
<p>First thing to do is set the <strong>IPv6 Configuration Type</strong> to <strong>Static IPv6</strong>. This will show the IPv6 configuration section.  Enter the first IP address in the Routed /64 section from the tunnel information.  When complete, you should have something like the screenshot below.  Scroll down and hit <strong>Save</strong> to write the settings, then <strong>Apply</strong> to make the new settings active.</p>
<div id="attachment_1080" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense5.png"><img class="size-medium wp-image-1080" title="LAN configuration page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense5-300x279.png" alt="LAN configuration page" width="300" height="279" /></a><p class="wp-caption-text">LAN configuration page</p></div>
<h3>Setting up DHCPv6</h3>
<p>In order to bring the IPv6 configuration to your workstations, we will set up DHCPv6.  This is entirely optional as right now you could go ahead and set up static IPv6 addresses just as well as using DHCP however rather than typing insanely larger addresses into all of your workstations, it&#8217;s easier and faster to set up DHCPv6 and let the client OSes pull the DHCPv6 as needed.  To get started, click on <strong>Services &gt; DHCPv6 Server</strong> and then on the <strong>LAN</strong> tab.</p>
<ul>
<li>Set the <strong>Router Advertisements</strong> to <strong>Assisted</strong>.  This controls the radvd daemon mentioned earlier.  By setting the mode to &#8220;Assisted&#8221;, you are telling radvd to perform router advertisements on the local network. The radvd broadcasts are used by the DHCP client applications to set the default router.</li>
<li>Place a check next to <strong>Enable the DHCPv6 server on the LAN interface</strong>.</li>
<li>Enter the desired start and end addresses for your network DHCP range. Please note that unlike the &#8220;short notation&#8221; using the double colon, you must explicitly declare the zeroes for all octets.  In my example, I&#8217;m using 2001:470:1234:5679:0:0:0:100 as my start point and 2001:470:1234:5679:0:0:0:200 as my end point, allocating 256 addresses to DHCP (remember, IPv6 addresses are hexidecimal.)</li>
<li>Enter the Anycasted IPv6 DNS server from the Hurricane Electric tunnel configuration into the DNS server field.</li>
</ul>
<div id="attachment_1081" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense6.png"><img class="size-medium wp-image-1081" title="DHCPv6 configuration" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense6-300x282.png" alt="DHCPv6 configuration" width="300" height="282" /></a><p class="wp-caption-text">DHCPv6 configuration</p></div>
<h3>Configure some Firewall rules</h3>
<p>At this point, we have the router configured however without some firewall rules in place, we will not be able to route out or get a DHCP address. We will need to add a rule so that our IPv6 traffic can get out.  Click on <strong>Firewall -&gt; Rules</strong> then click on the <strong>LAN</strong> tab.  We are going to duplicate the outbound rule created for the LAN outbound.   In the rule listing, click on the &#8220;<strong>+</strong>&#8221; icon to the right of the IPv4 outbound rule and change the protocol from IPv4 to IPv6.  Once done, hit <strong>Save</strong> then <strong>Apply</strong>.  When you&#8217;re done, your LAN rules should look like the below.</p>
<div id="attachment_1082" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense7.png"><img class="size-medium wp-image-1082" title="Duplicated Firewall rules" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/pfsense7-300x109.png" alt="Duplicated Firewall rules" width="300" height="109" /></a><p class="wp-caption-text">Duplicated Firewall rules</p></div>
<h2> 4: Configure your workstations</h2>
<p>After you get the router configured, it&#8217;s time to set up a workstation.  For this test, I used a Linux box and a Windows 7 workstation.  For Windows, all that is needed is to make sure that the NIC has IPv6 support bound to it.  To do this, go to the Network and Sharing Center and click on the &#8220;Adapter Settings&#8221; on the left hand sidebar.  Right click the adapter and go to Properties.  Make sure that IPv6 is listed and checked as shown below:</p>
<div id="attachment_1085" class="wp-caption aligncenter" style="width: 248px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/ipv6nic.png"><img class="size-medium wp-image-1085" title="Windows 7 Network protocols list" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/ipv6nic-238x300.png" alt="Windows 7 Network protocols list" width="238" height="300" /></a><p class="wp-caption-text">Windows 7 Network protocols list</p></div>
<p>To test that it&#8217;s working properly, open up a command prompt and check to see that ipconfig is showing the proper IP address.  Disregard any fe80:: addresses as these are link-local and not routable for our purposes. Your output should look something similar to my output below:</p>
<div id="attachment_1086" class="wp-caption aligncenter" style="width: 289px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/ipconfig.png"><img class="size-medium wp-image-1086" title="Windows 7 ipconfig" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/ipconfig-279x300.png" alt="Windows 7 ipconfig" width="279" height="300" /></a><p class="wp-caption-text">Windows 7 ipconfig</p></div>
<p>In Linux, the setup is even easier.   Most Linux operating systems already have IPv6 enabled, so it&#8217;s just a matter of pulling an IP address.  Run <strong>sudo dhclient -6 -v {interface}</strong> where {interface} is your network interface.  In my output below, I am using wlan0.  The <strong>-v</strong> parameter is optional, this is only to show what dhclient is doing and that it picked up the address from pfSense.</p>
<div id="attachment_1088" class="wp-caption aligncenter" style="width: 217px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/Screenshot-Terminal.png"><img class="size-medium wp-image-1088" title="Linux dhcpcd output" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/Screenshot-Terminal-207x300.png" alt="Linux dhcpcd output" width="207" height="300" /></a><p class="wp-caption-text">Linux dhcpcd output</p></div>
<p>This next screenshot shows <strong>ifconfig</strong> with three IP addresses: One IPv4 address, one link local IPv6 address and the routeable IPv6 address.</p>
<div id="attachment_1089" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/Screenshot-Terminal-1.png"><img class="size-medium wp-image-1089" title="Linux ifconfig output" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/Screenshot-Terminal-1-300x131.png" alt="Linux ifconfig output" width="300" height="131" /></a><p class="wp-caption-text">Linux ifconfig output</p></div>
<p>If you want to make the IPv6 settings permanent, you can set this information in Network Manager.  Edit your existing network connection, click on <strong>IPv6 Network</strong>, set the &#8220;Method&#8221; dropdown to <strong>Automatic</strong> and hit <strong>Save</strong>.  I didn&#8217;t provide screenshots on this because it depends on the network type and connection name and it ended up being way more complex than necessary.  IPv6 connectivity should work on both wired and wireless Ethernet adapters.</p>
<h2>5: Time to test!</h2>
<p>There are several sites that are available that allow IPv6 testing and IPv6/v4 dual-stack testing. My favorite is <a href="http://test-ipv6.net" target="_blank">http://test-ipv6.net</a>.  The site does IPv6 and IPv4 dual stack testing and ensures that you are able to connect to IPv6 and IPv4 sites.  There is also test surfing to <a href="http://ipv6.google.com" target="_blank">http://ipv6.google.com</a> which is an IPv6 only site.   If all goes well, you should receive output like the below:</p>
<div id="attachment_1090" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/testipv6com.png"><img class="size-medium wp-image-1090" title="Test-ipv6.com test results" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/12/testipv6com-300x159.png" alt="Test-ipv6.com test results" width="300" height="159" /></a><p class="wp-caption-text">Test-ipv6.com test results</p></div>
<h1>So, what now?</h1>
<p>With IPv6 properly working on your network, you are good to go however there&#8217;s probably not much to look at.  Most of the sites I tested were IPv4 only and the few IPv6 sites I could find were mostly broken.    From a consumer-side standpoint, you will notice no difference in the operation of websites.  From a server standpoint, each IP address is routeable meaning that each and every IP in your netblock can run web-accessible services.  The thing now is to pay close attention to your firewall.</p>
<p><strong>Remember that all IPs are routeable!</strong>  Prior to this setup, your router implicitly &#8220;protected&#8221; your LAN by using network address translation. By default, the router would allow LAN connections to exit the router but any unsolicited connection from the Internet could not access the LAN workstations due to how NAT works.  We used port forwarding to allow outside Internet computers inside to access local services.  IPv6 has no such requirement and all IPv6 addresses are public.  You need to make sure that your router&#8217;s firewall is set up properly and only allows incoming connections to IPs as needed by your network.  Our firewall configuration is set up with a default deny policy with an explicit LAN outbound rule.  This means that inside IPv6 addresses can surf the Internet uninhibited but any unsolicited connection from the Internet is automatically blocked.</p>
<p><strong>Test your network devices!</strong> Test all of your devices, from your computers to your smartphones, printers and anything else that plugs into the network.  You&#8217;ll get a quick idea of what works on IPv6 and what doesn&#8217;t. You&#8217;ll also have a good idea of which manufacturers and what devices to look for firmware updates in order to get ready for when IPv6 goes live.</p>
<p>For further things to do with your tunnel, take a look at Hurricane Electric&#8217;s IPv6 certification test.  The IPv6 certification test will test your knowledge of IPv6 and setting up various services on an IPv6 server including email and a Web server.  It&#8217;s a good idea to give it a shot so you can get experience working with the new IPv6 network.</p>
<p>Hopefully all went well in your IPv6 configuration and you&#8217;re up and running. If not, post a reply and I&#8217;ll try my best to help out.</p>
<p>Happy Hacking!<br />
FIRESTORM_v1</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/12/01/networking-bringing-ipv6-into-your-network-using-pfsense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Networking: Installing and configuring pfSense Embedded</title>
		<link>http://www.yourwarrantyisvoid.com/2011/11/11/networking-installing-and-configuring-pfsense-embedded/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/11/11/networking-installing-and-configuring-pfsense-embedded/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 02:54:03 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=969</guid>
		<description><![CDATA[After publishing the last post on networking and the security series, I felt it was necessary to go ahead and publish a piece on building a custom router.  I have been a fan of pfSense for the past four years and swear by it. It has the ease of use of a commercial GUI-driven router [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-970" title="pfSense Logo" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/pfsenselogo.png" alt="pfSense Logo" width="300" height="110" /></p>
<p>After publishing the last post on networking and the security series, I felt it was necessary to go ahead and publish a piece on building a custom router.  I have been a fan of pfSense for the past four years and swear by it. It has the ease of use of a commercial GUI-driven router and unrivaled flexibility limited only by the hardware it is installed on.  In this howto article, we will cover installing pfSense on an embedded platform and initial configuration for getting your router up and running.</p>
<p><span id="more-969"></span></p>
<h3>First, an introduction to pfSense</h3>
<p>PfSense is a lightweight FreeBSD based distribution geared towards router and firewall installations. It has been around since 2004 when it was forked from the m0n0wall project and has since turned into an excellent stand-alone distribution for routing and firewalling.  Although pfSense is generally intended towards full-PC installations, they offer an embedded image for use without skimping on the features.  pfSense is well known in the Linux/Unix/BSD community and is very highly regarded for both it&#8217;s feature set and it&#8217;s flexibility.</p>
<p>A question I get asked a lot is &#8220;Why pfSense? Why not just buy a Linksys?&#8221;  The answer is about hardware and software.  While I do own a couple of Linksys routers and do admire Linksys for bringing NAT devices to the common user, their hardware is restrictive and is only usable in the standard configuration (1 WAN and 4 LAN/WIFI) Even though it has been proven several times that the hardware they use for the LAN portion can support advanced features like VLAN support, bridging, multiple interfaces/IP&#8217;s, they will never release this functionality to those that want it and will instead force the advanced user to look elsewhere. In Linksys&#8217;s view, the router dictates the network.  With pfSense, I can build a custom configuration however I deem fit, with multiple NICs for WAN and LAN, with custom configurations and with VLAN support.  Not to mention that &#8220;stock&#8221; pfSense even supports DHCP, Captive Portal (like &#8220;free wifi&#8221;) , DNS, VPN support, Fail Over mode and many other options that Linksys wouldn&#8217;t ever make available.  Even if I never use VPN support or use the Failover mode, it&#8217;s nice to know those features are there should I ever need them.</p>
<h3>Hardware Requirements:</h3>
<p>In order to use pfSense Embedded, you will need a computer that adheres to the below spec.  Of course more is better, but these are the minimum specs as posted on the pfSense website.</p>
<ul>
<li>CPU: 100MHZ x86 Pentium or equivalent.</li>
<li>RAM: 128 MB RAM</li>
<li>Serial Port</li>
<li>512MB Flash storage or 1GB hard drive</li>
<li>Two Network Adapters (NICs)</li>
</ul>
<p>Please note that some of the advanced features like VPN support, Captive Portal and some high-bandwidth connections may require faster processors than what is outlined below.  If you want to make sure your embedded platform matches spec, take a look at <a href="http://www.pfsense.org/index.php?option=com_content&amp;task=view&amp;id=52&amp;Itemid=49">pfSense&#8217;s hardware sizing guid</a>e which covers some of the items more in depth.</p>
<h3>A note on storage:</h3>
<p>The pfSense distribution comes in two flavors.  You have the &#8220;desktop PC&#8221; version for full-size computers with a CD ROM and a hard drive, and you have an &#8220;embedded&#8221; version which is for devices without a CDROM or hard drive and use some method of flash storage.  While you may be able to install the desktop PC version on the embedded device, it is not recommended as the distribution will be tailored for running on a hard drive, not a solid state memory device.  If you intend to use a hard drive, install the PC version.</p>
<p>You can use any IDE device for storage as long as it is recognized by your computer&#8217;s BIOS and is supported by FreeBSD.  I have not had a problem with either of these two stipulations, so you should not have any problems with it. One thing to consider is the use of an IDE to CF adapter <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822998003">like this one on Newegg</a>.  This particular device fits right into the IDE header on the motherboard and allows you to use a Compact Flash cartridge as an IDE hard drive which is perfect for installing and running pfSense.  The router in my home is a slightly different model, but is running on a Sandisk 4GB CF cartridge and has been doing so for the last two years without fail.</p>
<h3>My hardware:</h3>
<p>In this howto, I will be using a Transcend 1GB IDE solid-state device that I got on Ebay. This device plugs into the 40 pin IDE header and mimics a standard hard drive.  It is fast and will definitely get the job done.  The hardware I will be using is a set top box device I scavenged from a computer show a long time ago.  It has a 233MHz Cyrix processor , 512MB RAM, an onboard serial port, an IDE port, an onboard NIC and a single PCI riser slot where I will be installing a dual 10/100 Intel NIC.</p>
<h3>Getting Started:</h3>
<p>If you are using the CF to IDE adapter mentioned earlier, you can use a USB-CF reader and an application to burn the image to the CF cartridge.</p>
<p>In order to proceed, you will need the following items</p>
<ul>
<li>A Linux based computer with one free IDE port</li>
<li>An IDE-CF adapter with an appropriately sized CF card minimum 512MB, recommended 1GB, referred hereafter as flash cartridge.</li>
<li>The &#8220;target system&#8221; that will ultimately run pfSense with at least two NICs.</li>
<li>A third NIC (optional, for guest network, discussed in the &#8220;Advanced&#8221; section below).</li>
<li>A serial cable (Female to Female) and a Null Modem Adapter.</li>
<li>A pocket switch with a small patch cord.</li>
</ul>
<h3>Identify your Flash device</h3>
<p>First, attach your flash cartridge to your Linux PC and boot it.  Make sure that it boots your Linux distribution first and does not attempt to boot from the flash cartridge.  Once booted, login as root and run <strong>dmesg</strong>. Look for the /dev entry for your flash module.  You may be able to look for the manufacturer name as is the case in my output below:</p>
<div id="attachment_971" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/IDEhd.gif"><img class="size-medium wp-image-971 " title="IDE HDA dmesg output" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/IDEhd-300x128.gif" alt="My Transcend module is listed as hda" width="300" height="128" /></a><p class="wp-caption-text">My dmesg output.</p></div>
<p>In the output above, my Transcend module was recognized as hda (primary master HD), so my /dev entry is /dev/hda.  We will need this later on to burn the image.</p>
<h3>Download, validate, burn:</h3>
<p>Now that we know what device we need to burn to, it&#8217;s time to get the image.  Head on over to <a href="http://www.pfsense.org/mirror.php?section=downloads">the pfSense Mirror selection page</a> and pick a server that&#8217;s closest to you.</p>
<p>You should then be presented with a list of images named <strong>pfSense-1.2.3-RELEASE-XXXX-nanobsd.img.gz</strong> where XXXX is a choice of 512mb, 1g, 2g and 4g images.  In my particular case, I will be using pfSense-1.2.3-RELEASE-1g-nanobsd.img.gz as it is pre-built to a 1gig flash cartridge.</p>
<p>Use <strong>wget</strong> to download the image along with the accompanying .md5 file as shown in the sample output below. Note: URLs in the below image may differ depending on the mirror you are using, but the filenames will be the same.</p>
<div id="attachment_973" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wget.gif"><img class="size-medium wp-image-973 " title="wget download of files" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wget-300x153.gif" alt="wget download of files" width="300" height="153" /></a><p class="wp-caption-text">wget download of files</p></div>
<p>Once both files have downloaded, use <strong>md5sum -c </strong>to check the file for consistency against the provided md5 checksum as shown in the sample output below.</p>
<div id="attachment_974" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/md5sum.gif"><img class="size-medium wp-image-974 " title="md5sum validation" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/md5sum-300x153.gif" alt="md5sum validation" width="300" height="153" /></a><p class="wp-caption-text">md5sum validation</p></div>
<p>If the MD5 check returns <strong>OK</strong> then you are clear to proceed. If not, go back and re-download the file again. Make sure you downloaded the same file and md5 checksum.  In order to burn it, we will use <strong>zcat</strong> to cat the zipped image out to the /dev entry mentioned earlier.  My syntax will be <strong>zcat pfSense-1.2.3-RELEASE-1g-nanobsd.img.gz | dd of=/dev/hda bs=16k</strong>however, if your flash cartridge shows up at another location other than /dev/hda, be sure that you change the command above to point to the proper device.  Once the command completes, it should look like this:</p>
<div id="attachment_975" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/burncomplete.gif"><img class="size-medium wp-image-975 " title="Image Burn Completed" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/burncomplete-300x153.gif" alt="Image Burn Completed" width="300" height="153" /></a><p class="wp-caption-text">Image Burn Completed</p></div>
<p>Now that the image burn is done, shutdown the Linux box and pull your flash cartridge out and install it in the device that is going to run pfSense.  Go ahead and connect it up but do not attach any network cables to the interfaces just yet.  You will also need to connect the serial cable with a null modem adapter to the device to continue initial setup.</p>
<h3>Initial Configuration and Setup</h3>
<p>Now that we&#8217;ve burned the image, we are ready to do the initial setup.  This entails doing some NIC probing to find the network adapters in the system and to assign them to their respective duties (WAN, LAN, Optional Interface 1, etc).  You should only ever need to do this once as once the NICs are set up and the router is running, you can do everything including re-assign the interfaces from the web-based GUI.</p>
<p>Open up PuTTY, Hypertrm or your favorite terminal application and set the serial port parameters to 9600 baud, no parity 8 data bits, 1 stop bit.  Turn on the embedded device and after a moment, you should see some BSD boot stuff flash past.  Wait until it prompts you to set up VLAN information as shown below:</p>
<div id="attachment_976" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/vlaninfo.gif"><img class="size-medium wp-image-976 " title="Vlan Setup prompt" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/vlaninfo-300x167.gif" alt="Vlan Setup Prompt" width="300" height="167" /></a><p class="wp-caption-text">Vlan Setup Prompt</p></div>
<p>If you are lucky, you should see two interfaces, one for each NIC.  If you have three network cards in your system, you will see three different interfaces.  In the above screenshot, I have em0, em1 and fxp0.  Since we will not use VLANs for our basic or our advanced configurations, we will answer &#8220;N&#8221; here.</p>
<p>Now, we will do some network probing to figure out exactly which NIC  goes to which interface using the pocket switch and the patch cord.  Don&#8217;t plug anything in yet.</p>
<div id="attachment_977" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/probelan.gif"><img class="size-medium wp-image-977 " title="Probe for LAN interface" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/probelan-300x167.gif" alt="Probe for LAN interface" width="300" height="167" /></a><p class="wp-caption-text">Probe for LAN interface</p></div>
<p>With nothing plugged into the network interfaces, hit a and hit enter.  This will start the autodetection process. When prompted, attach the pocket switch to the interface you will use as the LAN interface and make sure that the LINK light on the switch and the NIC come on.  Hit Enter and you should see a message where it detected the LAN interface link come up.  It will then prompt you for the WAN interface.  Hit a then enter again and move the patch cord to the WAN interface and hit enter.  Repeat this process for the Optional interface (OPT1) or if your router only has two NICs, just hit enter.  Refer to the below output.</p>
<div id="attachment_978" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/assignednics.gif"><img class="size-medium wp-image-978 " title="Assigned NICs" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/assignednics-300x167.gif" alt="Assigned NICs" width="300" height="167" /></a><p class="wp-caption-text">Assigned NICs</p></div>
<p>Be sure that you only change the patch cord when it tells you to.  If you disconnect the cable at the &#8220;hit A for autodetect&#8221; prompt, it may not detect link when it should.  If you run into this issue, disconnect the patch cord and restart your router.  Allow it to boot up and start over.  Once you get done assigning interfaces, simply hit Enter to exit assignment.  It will print the current assignments of the interfaces and ask you to validate.  Answer Y if the displayed assignments are correct and hit Enter, otherwise hit N and start over or restart the device.</p>
<p>Assuming all went well, you will see it do a bunch of additional configuration.  Once you get to the menu as shown below, you can then disconnect the serial cable and proceed with the configuration of the pfSense router.</p>
<div id="attachment_979" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/configdone.gif"><img class="size-medium wp-image-979" title="Configuration completed" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/configdone-300x167.gif" alt="Configuration Completed." width="300" height="167" /></a><p class="wp-caption-text">Configuration Completed</p></div>
<p>&nbsp;</p>
<h3>Continuing the Configuration</h3>
<p>Connect the pocket switch up to the LAN port of the router and connect your router&#8217;s WAN port to your Internet connection.  Connect a computer to an unused port on the pocket switch and start it up. Once booted, you should have an IP address in the 192.168.1.x subnet and depending on whether or not your Internet connection is DHCP, you may already be able to surf.</p>
<p>Open a browser and go to http://192.168.1.1 and when prompted login with the username of <strong>admin</strong> and the password of <strong>pfsense</strong>.  If all goes well, you should see a screen that looks like the one below.</p>
<p>&nbsp;</p>
<div id="attachment_982" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard.gif"><img class="size-medium wp-image-982" title="pfSense Wizard" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard-300x181.gif" alt="pfSense Wizard" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard</p></div>
<p>&nbsp;</p>
<p>Click &#8220;Next&#8221;</p>
<p>On this screen, you will set some basic network configuration parameters like the pfSense&#8217;s hostname, local domain and the two DNS servers.  Use the ISP provided DNS servers here and click Next.</p>
<p>&nbsp;</p>
<div id="attachment_983" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard2.gif"><img class="size-medium wp-image-983" title="pfSense Wizard, page 2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard2-300x181.gif" alt="pfSense Wizard, page 2" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page 2</p></div>
<p>&nbsp;</p>
<p>On this screen, we will set up the timeserver and the timezone of the firewall.  Set the timezone where appropriate and then either use the provided time server or set your own.  I left it default and have not noticed any issues with time reporting.</p>
<p>&nbsp;</p>
<div id="attachment_984" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard3.gif"><img class="size-medium wp-image-984" title="pfSense Wizard, page 3" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard3-300x181.gif" alt="pfSense Wizard, page 3" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page 3</p></div>
<p>&nbsp;</p>
<p>The next screen is where we will set up the WAN parameters.  Start off with selecting which type of WAN link you have.  Choices are DHCP (default),  Static IP, PPPoE and PPTP.  For each selection, there is a relevant section that must be completed.  Since I use DHCP, I left it as default.</p>
<p>&nbsp;</p>
<div id="attachment_985" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard4.gif"><img class="size-medium wp-image-985" title="pfSense Wizard, page 4" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard4-300x181.gif" alt="pfSense Wizard, page 4" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page 4</p></div>
<p>&nbsp;</p>
<p>Pay special attention to the bottom two options.  The first option &#8220;Block RFC1918 networks&#8221; prevents LAN IP addresses from the &#8220;private&#8221; networks from entering from the WAN interface. Private networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.  Unless you are using this router inside another NAT environment, this option is best left turned on.</p>
<p>The other option &#8220;Block Bogon Networks&#8221; should be left enabled. This prevents non-routed and not-assigned networks from being routed against from your WAN interface. Since these addresses are not routed and not assigned, they should never contact your router anyways.</p>
<p>&nbsp;</p>
<div id="attachment_986" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard5.gif"><img class="size-medium wp-image-986" title="pfSense Wizard, page 5" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard5-300x181.gif" alt="pfSense Wizard, page 5" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page4, Bogon networks and RFC1918 options</p></div>
<p>&nbsp;</p>
<p>Now we are at the LAN configuration.  This is where we can change the router&#8217;s internal IP address and subnet mask.  Please note that most of pfSense uses CIDR notation, so you may want to get familiar with it or have a <a href="http://www.subnet-calculator.com/cidr.php" target="_blank">CIDR calculator</a> at the ready.<strong><em></em></strong> Tip: a /24 is the same as 255.255.255.0</p>
<p>&nbsp;</p>
<div id="attachment_987" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard6.gif"><img class="size-medium wp-image-987" title="pfSense Wizard, page 5" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard6-300x181.gif" alt="pfSense Wizard, page 5" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page 5</p></div>
<p>&nbsp;</p>
<p>This screen allows us to change the default password of <strong>pfsense</strong>.  I highly recommend changing it to something memorable.  If you forget it, you can always reset it via a serial connection without resetting the router back to factory settings.</p>
<p>&nbsp;</p>
<div id="attachment_988" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard7.gif"><img class="size-medium wp-image-988" title="pfSense Wizard, page 6" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/wizard7-300x181.gif" alt="pfSense Wizard, page 6" width="300" height="181" /></a><p class="wp-caption-text">pfSense Wizard, page 6</p></div>
<p>&nbsp;</p>
<p>Finally we have reached the end of the wizard.  Click &#8220;Reload&#8221; and wait a few minutes.  During this time, the router will reboot itself to get adjusted into the new environment.  Let the web page reload the router&#8217;s admin page and it should take you to a configuration page like the one below.</p>
<p>&nbsp;</p>
<div id="attachment_989" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/status.gif"><img class="size-medium wp-image-989" title="pfSense main status page" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/08/status-300x181.gif" alt="pfSense main status page" width="300" height="181" /></a><p class="wp-caption-text">pfSense main status page</p></div>
<p>&nbsp;</p>
<p>Once you are at this screen, you should be able to browse the Internet.</p>
<h3>Some basic tips:</h3>
<ul>
<li>Portforwarding can be set up under Firewall -&gt; NAT and works pretty much like you would expect a Linksys box to work.  Be sure to leave the &#8220;Auto Add a firewall rule to permit traffic through this NAT rule&#8221; at the bottom checked.  This will create a matching rule on the WAN side to allow traffic along with the rule to bring the traffic from the WAN to your destination computer.</li>
<li>You can see each interface&#8217;s status by going to Status -&gt; Interfaces.  If you are on a PPPoE or PPTP connection, you can disconnect and reconnect from this page.  If you are using DHCP, you can also release and renew your IP here.</li>
<li>If you run into trouble performing port forwarding, you can access the system firewall logs via Status -&gt; System Logs.  Be sure to turn on Logging on your rules so you can see new connections as they are being performed.</li>
<li>If you&#8217;re having problems with a specific host, you can access a packet capture utility via Diagnostics -&gt; Packet Capture</li>
<li>If you want to diagnose upstream Internet connectivity issues, you can access Traceroute via Diagnostics -&gt; Traceroute. and a ping utility via Diagnostics -&gt; Ping</li>
<li>Like numbers and graphs? Check out the system traffic graph (Status-&gt; Traffic Graph) and the system RRD graph (Status -&gt; RRD Graphs).  You may need to install the Adobe SVG viewer to view these graphs.</li>
<li>Unlike a Linksys box, it is recommended to halt the router before powering down and use the reboot function if a restart is needed.  Both options appear under Diagnostics with the labels &#8220;Halt system&#8221; and &#8220;Reboot system&#8221; respectively.</li>
</ul>
<h3>What&#8217;s next?</h3>
<p>Even in its basic configuration you already have a very powerful router on your hands.  The sky&#8217;s the limit. The pfSense installation can support a great many different configurations and options so don&#8217;t think that you&#8217;re locked into a single configuration.  Out of the box, pfSense has the software support for DHCP, DNS server, and other basic functionality as well as more things like CARP Failover, Open NTPD (Time server), OpenVPN, Remote Syslog, Traffic aggregation, and many other features that warrant exploration.</p>
<p>In a follow up article, I will explore setting up an advanced configuration, establishing a VLAN to isolate a wireless network from the wired network while still providing Internet access.  This is a useful configuration for you that like to share your Internet access but don&#8217;t want to make your home network vulnerable.</p>
<p>Happy Hacking!</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/11/11/networking-installing-and-configuring-pfsense-embedded/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Networking: Duplicating Drops in structured wiring</title>
		<link>http://www.yourwarrantyisvoid.com/2011/07/29/networking-duplicating-drops-in-structured-wiring/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/07/29/networking-duplicating-drops-in-structured-wiring/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 18:13:04 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[patch cord]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=952</guid>
		<description><![CDATA[Structured wiring in businesses and the enterprise are as expected as the sun shining and a regular paycheck, however in the home a structured wiring solution can be an unexpected gift from the Gods of Ethernet.  While structured wiring in an apartment complex is usually done central to a utility closet or shelf, sometimes the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-953" title="Networking" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2103-300x225.jpg" alt="Networking" width="300" height="225" /></p>
<p>Structured wiring in businesses and the enterprise are as expected as the sun shining and a regular paycheck, however in the home a structured wiring solution can be an unexpected gift from the Gods of Ethernet.  While structured wiring in an apartment complex is usually done central to a utility closet or shelf, sometimes the central point isn&#8217;t always convenient for your router or you find yourself needing to run multiple networks.  In this tutorial, I will show you how to turn one structured wiring drop into two drops for carrying two different network segments, something that can be of benefit should you ever need it.<span id="more-952"></span></p>
<h3>What these splitters do and what they don&#8217;t do.</h3>
<p>Before we begin slicing up cables, it&#8217;s important to understand what is going on here so you can decide if this will work for you.  Generally speaking, these splitters can be used if you want to carry two <strong>different</strong> networks over the same drop. If you are simply looking for more connections to your home network, and you are not doing anything special, you will more than likely want to save some time and get a mini-switch instead.  Here&#8217;s a good rundown of some scenarios of why you should and should not consider these splitters:<strong></strong></p>
<p>These splitters would be a good idea for the following scenarios:</p>
<ul>
<li>Moving your router from the default ingress point.  In my case, the central &#8220;panel&#8221; is in the utility closet, but I want my router on my desk.  I use the &#8220;1&#8243; portion of the splitter to transport the WAN segment to the WAN port of my router, then use the &#8220;2&#8243; portion of the splitter to transport the LAN segment to a mini-hub in the closet to activate the rest of the jacks in the house.</li>
<li>Moving a &#8220;hostile&#8221; segment or Guest network to another location.  An example would be having a router installed at the ingress point and using a splitter to transport a &#8220;Guest Network&#8221; and a &#8220;LAN&#8221; connection via the same drop.  In this case, the Guest Network feeds an open access point, while the LAN feeds a desktop computer. In this application, the Guest Network is kept physically separate from the LAN via the splitters but allows you to position the access point somewhere more convenient while maintaining the availability of the LAN.</li>
<li>Transporting two Ethernet drops to a managed switch located in a central closet.  An example for this would be to allow per-port monitoring and administration of both drops individually as opposed to using a mini-switch which would force you to  perform the change across all devices attached to the mini-switch.</li>
</ul>
<p>These splitters would not be a good idea for the following scenarios:</p>
<ul>
<li>Creating more Ethernet ports for the same network and you are not using a managed switch.   If you are plugging two devices into your LAN at the same location, just use a mini-switch and save yourself the trouble. There&#8217;s no benefit to using splitters in a non-managed switch environment. Additionally, you may incur additional costs with having to buy an additional mini-switch to split the connections off at the central panel anyways.</li>
<li>You are using Gigabit Ethernet and do not want to drop the line speed in the location you are looking at.</li>
<li>You are using Power over Ethernet at this location and do not want to move the power supply.</li>
</ul>
<h3>A little bit on structured wiring and Ethernet standards</h3>
<p>In a structured wiring environment, a &#8220;drop&#8221; is the term for a 4 pair (8 wire) cable run through ceilings, walls, etc from a faceplate with proper termination to a central wiring panel with proper termination (usually a patch panel of sorts).  It&#8217;s called structured wiring as the wiring is usually planned out first with attention to detail and locations of equipment like access points, computers, etc.  Generally speaking, if you are in a structured wiring location and you see an RJ-45 jack marked &#8220;Cat-5&#8243; this generally means that it&#8217;s an Ethernet jack and that the cabling and connectors comply with the Cat-5 standard.</p>
<p>Speaking of wiring standards, you may want to <a title="Network Wiring Standards" href="http://www.zytrax.com/tech/layer_1/cables/tech_lan.htm" target="_blank">take a look at this link</a> which provides more detail into the wiring convention commonly used in structured wiring for Ethernet networks.</p>
<p>In standard 10/100 Ethernet cabling that uses an RJ-45 jack, you have two wires(a pair) for transmit and two wires(a pair) for receive.  In most locations, the extra two pairs (four wires) are simply left idle and untouched. In rare situations (at least in residential equipment) these extra pairs are used for Power over Ethernet which use these spare pairs to deliver power to a network device where it is not convenient to use a standard &#8220;wall-wart&#8221; power supply. This requires special adapters (not unlike our splitters) to send power and network connectivity over the same drop, then split it again at the device end.   As mentioned before, if you are using PoE to feed a device using a drop that you need two connections for, you will either need to move the PoE power supply to another location or use our splitter elsewhere.</p>
<p>Unfortunately, Gigabit Ethernet requires all four pairs be used for sending and receiving at Gig-E speeds. If you are not willing to move the Gig-E device and are not willing to drop the speed to 10/100 , you will need to use the splitter elsewhere.</p>
<h3>Do the Splits!</h3>
<p>In order to pull this off, you will need the following:</p>
<ul>
<li>Two Cat-5 patch cords</li>
<li>A RJ45 crimper</li>
<li>Four RJ45 Crimp Ends suitable for the wire in your patch cords. (more if you are new at this, just in case)</li>
<li>Heatshrink that is big enough to accommodate twice the diameter of your patch cords.</li>
<li>Lighter</li>
<li>Diagonal cutters</li>
<li>Sharpie (not pictured)</li>
<li>Cat-5 tester (Optional, not pictured)</li>
<li>Cat-5 Female to Female junction adapter (optional, not pictured)</li>
</ul>
<div id="attachment_954" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2094.jpg"><img class="size-medium wp-image-954" title="Tools" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2094-300x225.jpg" alt="Tools" width="300" height="225" /></a><p class="wp-caption-text">Tools</p></div>
<p>To start off, cut one CAT-5 end off of your patch cord and determine how far back you want to strip the jacket off.  In my example, I wanted this splitter to go next to a managed switch where the ports are close together so I used about 8 inches which leaves about 4 inches for each &#8220;branch&#8221;.   If you are using a pocket switch and a computer, you may want to use one foot (12 inches) which leaves you with two 6 inch branches.</p>
<p>Start snipping the jacket of the patch cord, paying close attention to not damage any of the wires underneath. If you do snip a wire, cut the rest of them at the same length and repeat the process.   Once you have managed to snip the jacket clean, begin pulling the jacket off of the cable in one piece.  When completed, you should have eight wires similar to the below picture.</p>
<div id="attachment_955" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2098.jpg"><img class="size-medium wp-image-955" title="Stripped Wiring" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2098-300x225.jpg" alt="Stripped Wiring" width="300" height="225" /></a><p class="wp-caption-text">Stripped Wiring</p></div>
<p>Split the wires into two groups.  Separate the White/Blue and the White/Brown pairs from the White/Green and White/Orange pairs.  Slip the heatshrink tube over all four pairs down past the cut jacket.</p>
<p>Fold the stripped away jacket in half and cut at the half line.  Slip one piece of the jacket over the White/Blue and White/Brown pairs, and thread the White/Green and White/Orange pairs through the remaining piece of the jacket.  Use the image below as a guide.</p>
<div id="attachment_956" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2099.jpg"><img class="size-medium wp-image-956" title="Wires threaded through Jacket" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2099-300x225.jpg" alt="Wires threaded through Jacket" width="300" height="225" /></a><p class="wp-caption-text">Wires threaded through Jacket</p></div>
<p>Slide the two jacket pieces down as far as they will go, then push the heatshrink tube at least one inch past the split.  This will toughen the split to ensure it doesn&#8217;t fall apart with use.  Use the lighter to shrink the tubing around the three pieces of jacket.</p>
<p>Now for the fun part.  At the ends of the two pieces of jacket, you now have one piece with a White/Blue pair and a White/Brown pair and another piece with White/Orange and White/Green. We need to put ends on these wires so we can start using them.  Start off by spreading the wires out and untwisting them like in the image below.</p>
<div id="attachment_957" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2100.jpg"><img class="size-medium wp-image-957" title="Separated Wires" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2100-300x225.jpg" alt="Separated Wires" width="300" height="225" /></a><p class="wp-caption-text">Separated Wires</p></div>
<p>Trim the wires so that there is approximately one inch sticking out of the jacket and make sure that the wires are laid out like so:</p>
<ul>
<li>Solid Green (or green with white dots)</li>
<li>White/Green &#8211; white wire with green stripe</li>
<li>Solid Orange (or orange with white dots)</li>
<li>White/Orange &#8211; white wire with orange stripe</li>
</ul>
<p>The important part is when you insert them into the crimp end, the solid green wire must go into position 3, and the rest will go into positions 6, 7 and 8 as shown below.  Please take note that the orientation of the RJ-45 crimp end is that the spring clip is pointing towards you, and the wiring enters from the left.</p>
<ul>
<li>Position 1 &#8211; Blank</li>
<li>Position 2 &#8211; Blank</li>
<li>Position 3 &#8211; Solid Green</li>
<li>Position 4 &#8211; Blank</li>
<li>Position 5 &#8211; Blank</li>
<li>Position 6 &#8211; White/Green</li>
<li>Position 7 &#8211; Solid Orange</li>
<li>Position 8 &#8211; White/Orange</li>
</ul>
<p>Before you crimp the RJ45 onto the wires, hold the whole thing up to a bright light and ensure that the wires are long enough to hit the end of the connector.  Sometimes, a bad crimp can result if the wires are too short.  Use the below image as a reference and take some time to make sure your wiring is correct.  If all looks good, go ahead and crimp!</p>
<div id="attachment_958" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2101.jpg"><img class="size-medium wp-image-958" title="Visual Inspection" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2101-300x225.jpg" alt="Visual Inspection" width="300" height="225" /></a><p class="wp-caption-text">Visual Inspection</p></div>
<p>Now for the White/Blue and White/Brown pairs, you must perform the same process, except this time we will use White/Brown in place of the White/Orange pair and the White/Blue will substitute the White/Green.  Our wiring diagram will change to below:</p>
<ul>
<li>Position 1 &#8211; Blank</li>
<li>Position 2 &#8211; Blank</li>
<li>Position 3 &#8211; Solid Blue (or Blue wire with White dots)</li>
<li>Position 4 &#8211; Blank</li>
<li>Position 5 &#8211; Blank</li>
<li>Position 6 &#8211; White/Blue</li>
<li>Position 7 &#8211; Solid Brown (or Brown wire with White dots)</li>
<li>Position 8 &#8211; White/Brown</li>
</ul>
<p>Do the same inspection as you did for the first crimp and check, recheck and crimp your second connector.    Mark the crimp with the White/Orange and White/Green wires as &#8220;1&#8243; and the other crimp with the White/Blue and White/Brown wires as &#8220;2&#8243;.  This will be important later on when you implement your splitters.</p>
<h3>Do it again, Sam!</h3>
<p>Now that you have one splitter, go ahead and do it again with the other Cat-5 patch cord.  When you are complete, your patch cord should look like the following image.</p>
<div id="attachment_959" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2097.jpg"><img class="size-medium wp-image-959" title="Finished Splitter" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2097-300x225.jpg" alt="Finished Splitter" width="300" height="225" /></a><p class="wp-caption-text">Finished Splitter</p></div>
<h3>Final Thoughts</h3>
<p>Now that you have a pair of these splitters, you should be able to enjoy a bit more freedom when setting up your network in a structured wiring environment where additional cable runs are simply not feasible.  In my particular installation, I am using my splitters to feed the router&#8217;s output that carries VLAN tagged traffic into a managed switch.  The other leg of the splitter, goes back to the wiring closet to feed a mini-switch with network connectivity.  VLAN tagged traffic will not traverse a non-managed switch so for me this was the only way to be able to use my VLAN tagged network and my &#8220;primary&#8221; network without having to give up either.  Below is an image of my splitter feeding my 24 port switch. Yes the switch is on however it appears that the flash washed the lights out.</p>
<div id="attachment_960" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2102.jpg"><img class="size-medium wp-image-960" title="Installed Splitter" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/07/DSCF2102-300x225.jpg" alt="Installed Splitter" width="300" height="225" /></a><p class="wp-caption-text">Installed Splitter</p></div>
<p>I hope you enjoyed this quick post as I did making the splitters.  Reply to this post and tell others how you intend to use your splitters.</p>
<p>&nbsp;</p>
<p>Happy Hacking!</p>
<p>&nbsp;</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/07/29/networking-duplicating-drops-in-structured-wiring/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>CVS Netbook Revisited</title>
		<link>http://www.yourwarrantyisvoid.com/2011/07/25/cvs-netbook-revisited/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/07/25/cvs-netbook-revisited/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 16:42:40 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[netbook]]></category>
		<category><![CDATA[Sylvania]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=906</guid>
		<description><![CDATA[A few months ago, I posted a hardware teardown of the CVS Sylvania Netbook pictured above. After working with it and performing a lot of research on it, I promised a follow up article, and here it is.  To sum it all up, with a bit of modification to the software, a spare SD card [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-751 aligncenter" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/01/2011-01-06-17.11.07-300x225.jpg" alt="" width="300" height="225" /></p>
<p>A few months ago, I posted a hardware teardown of the CVS Sylvania Netbook pictured above. After working with it and performing a lot of research on it, I promised a follow up article, and here it is.  To sum it all up, with a bit of modification to the software, a spare SD card and a lot of patience, you can actually turn this thing into a somewhat useful Linux device.  There&#8217;s also some improvements and suggestions to be had for improving the Windows CE side of things should you decide to continue using it in its default state.</p>
<p><span id="more-906"></span></p>
<p>When I posted the original teardown, I was somewhat distressed at how little information there was for this device. There was a ton of &#8220;marketing&#8221; material online however very few real-world posts.  This appears to have changed and although most of the reviews lamblasted the device as a horrible design and underpowered, I have found that for the price I paid for it, it&#8217;s not bad at all.  In this article, we will be focusing on software because as much as I&#8217;d like to say I&#8217;ve done a lot of hardware mods to this thing, the truth of the matter is that I haven&#8217;t.  Time has continued to get away from me and I&#8217;ve had to put a lot of projects on hold.  But let&#8217;s not start this article off on a downbeat.</p>
<p>In the three months that I&#8217;ve been doing research on the Sylvania Netbook, I have uncovered a lot of information that can help turn this machine into a pretty useful piece of equipment.  The fact that it has a pretty decent battery in of itself should be of merit to justify the time invested in fine-tuning it.</p>
<h2>1: Windows CE</h2>
<p>In my research, there have been two key complaints against the Sylvania netbook in regards to a &#8220;stock&#8221; configuration.  The first complaint has been that it is running Windows CE (affectionately called &#8220;WinCE&#8221;) and the second being that the WinCE installation is really badly implemented.</p>
<ul>
<li>The key thing to remember with working with Windows CE is that <strong>Windows CE is NOT Windows like on your desktop or &#8220;normal&#8221; laptop!</strong> Windows CE was designed for small form factor devices and although it shares the same name as it&#8217;s bigger brother desktop OS, <strong>Windows CE can not run Native Windows applications.</strong> This appears to be the biggest hurdle in locating user software for the device as people will attempt to download software then when they get the software into the netbook, they are thrown off by an error message stating it&#8217;s not a &#8220;valid&#8221; application.  Consider it like taking a MacOS program designed for MacOS and attempting to get it running in Windows XP.  It ain&#8217;t gonna happen.  That being said, there <strong>is</strong> Windows CE applications out there, however the pickings are slim.</li>
</ul>
<ul>
<li>The other issue with working with the stock Windows CE installation is that the OS software is so badly implemented on the netbook that most things that should work, don&#8217;t.  Thankfully for us there is a patch available that will make things easier.  From research, the patch addresses several performance issues with the core OS, several updates to the builtin applications as well as an update to Internet Explorer.  Unfortunately, IE will still render mobile sites by default, but the rendering won&#8217;t take as long.  The patch also fixes the issue with the wireless card not being able to properly associate with WPA/WPA2 secured networks and DHCP release/DHCP renew works as expected.  I have uploaded the patch to here.  In order to install the patch, follow the below instructions. You will need a spare SD card at least 128MB in size.</li>
</ul>
<p>Here&#8217;s how to download and perform the OS update:</p>
<ol>
<li>Download the patch from here:  <a href="http://www.yourwarrantyisvoid.com/downloads/files/sylvania_smartbook_OS_update.zip" target="_blank">sylvania_laptop_OS_update.zip</a></li>
<li>Extract the executable to an SD card.</li>
<li>Insert the SD card into the Sylvania netbook.</li>
<li>Browse to the SD card slot (Computer -&gt; SD Card)</li>
<li>Launch the patch and follow the on screen prompts.</li>
</ol>
<h2>2:On the Linux side of things&#8230;</h2>
<p>When I did my original research, I was fortunate to have come by a site dedicated to a Linux distribution made solely for the WM8505 series devices like the Sylvania Netbook. The site and the distribution were called Bento Linux and much like the Japanese namesake, the distribution was very small and was designed to be able to run within the computer&#8217;s limited spec.  Unfortunately, the site www.bento-linux.org no longer exists but thankfully I still have the documentation and files needed to pull it off.  If you are the owner of bento-linux.org and are willing to give me the site files, I would be more than happy to host it here. Please contact me in the comments.</p>
<p>One of the added benefits of Bento-Linux is that unlike some replacement OS installations, this is a sidecar installation meaning that all work is done on the SD card.  If you want to boot to Windows CE, halt the Linux OS, pop out the SD card and power the Netbook back on and you&#8217;re up and running like nothing happened.  Although the Bento Linux site did have instructions for performing an installation to the device&#8217;s flash ram, it is not recommended as if you accidentally mess up the Linux distribution, there may be no recovery. In a sidecar installation, you can pop the SD card into another device, make your changes, and then put the SD card into the netbook and you&#8217;re up and running again.</p>
<p>Although the site claimed that the distro could run on a 512MB SD card, I will up the recommendation to at least a 2GB card.  Prices are low and SD cards are very commonplace so it&#8217;s worth it to get a larger chip.  I started out on a 2GB SD card, but later upgraded to a 4GB Microdrive and noticed a significant performance increase going from solid-state memory to a USB Microdrive. Your mileage will vary, but it is recommended to stick with an SD card first, then perform upgrades and additional installations as needed later on.  As far as USB devices are concerned, you can use any USB storage device/keydrive that is recognized by the usb mass-storage driver in Linux.</p>
<p>Please note that the version of Bento I was running is usable however it did not appear that the sound card was operational. Since I am intending to use this as an external serial console, this was not a deal breaker for me.</p>
<h3>Installation (SD Card Only)</h3>
<p>Bento-linux comes in two parts. One part is for a FAT16 partition placed at the beginning of the SD card and it contains the boot commands needed to tell u-boot (the Netbook&#8217;s bootloader) how to boot the linux kernel and the root filesystem.  The other part contains the linux kernel and the filesystem in an EXT3 filesystem and will contain all the files needed to run Linux.</p>
<ol>
<li>You will need to start with an SD card at least 1GB in size.  I used a 2GB which gave me some room to play around on and of course the bigger, the better.</li>
<li>Partition the SD card with a 20MB FAT16 partition at the beginning of the card and the rest of the disk space can be allocated for an EXT3 partition.  Do not create a swap partition.</li>
<li>Download the file <a title="FAT partition for Bento Linux" href="http://www.yourwarrantyisvoid.com/downloads/files/fatpart.tgz" target="_blank">fatpart.tgz</a> and extract it into the root of the FAT partition on the SD card.</li>
<li>Download the file <a title="EXT3 partition file for Bento Linux" href="http://www.yourwarrantyisvoid.com/downloads/files/extpart.tgz" target="_blank">extpart.tgz</a> and extract it into the root of the EXT3 partition of the SD card.</li>
<li>Unmount the card and insert into the Sylvania&#8217;s SD cardslot and power on the machine. It should boot the Bento Linux distribution</li>
</ol>
<h3>Installation (SD Card + USB stick)</h3>
<p>This setup does not require special partitioning, however it does require that the SD card be formatted FAT16.   You will also need a USB storage device formatted EXT3.</p>
<ol>
<li>Download the file <a href="http://www.yourwarrantyisvoid.com/downloads/files/fatpartusb.tgz" target="_blank">fatpartusb.tgz</a> and extract it to the root of the FAT formatted SD card.</li>
<li>Download the file extpart.tgz and extract it to the root of the EXT3 formatted USB stick (or hard drive).</li>
<li>Insert the SD card into the Sylvania&#8217;s SD slot and insert the USB stick into a free USB port on the Sylvania.</li>
</ol>
<p>In either instance, when you first boot the distro, it will simply bring you to a console prompt and you are good to go.  There are a couple of things you may want to do:</p>
<ul>
<li>(Pretty much required)  Set a root password.</li>
<li>Install fluxbox (light weight graphical interface) and wicd for wireless control.</li>
<li>Install aurora (lightweight firefox lookalike)</li>
<li>Install other applications though apt-get as desired.</li>
</ul>
<p>Although the bento-linux site is no longer in existence, it appears that all the repositories that come with the distribution point to the arm ports of the official Debian repositories.  Prior to them going offline, I saw a note about Bento-Linux had the sources for the WM8505 however it appears that VIA has recently released the sources for the WM8585/VT8505 chips that drive the netbook so if you have any custom drivers, it appears that now there is an easier method for getting the drivers compiled in.  I am not a kernel compiler expert so I can&#8217;t advise on this process, however some brief research does seem to indicate that there is some element of truth to this.</p>
<h3>Linux Impressions and final words</h3>
<p>After getting the Bento Linux distribution working comfortably in the netbook, I played around with it and made some tweaks here and there that did give some notable boost in performance.   If you are using a spinning platter form of storage, creation of a  swap file or swap partition is recommended as it will give you a performance boost.  Attempting to make a swap file on the SD card or on a solid-state USB drive are not recommended because of the performance hit when writing to these devices and also due to the issue of &#8220;burn-in&#8221; when a storage cell is written to frequently.  I found that the device works decently enough for quick tasks and light webpages however it will not handle flash at all, nor will it be able to render sites with large amounts of images.  In my testing, I was able to use this device to configure Cisco switches and other devices through a USB-Serial adapter and Linux&#8217;s &#8220;minicom&#8221; terminal emulator.</p>
<p>While I believe it was a valiant effort by Sylvania to enter into the netbook market, I do believe that they should have done more research.  The Sylvania netbook, even running Linux and with all the performance tweaks mentioned, still is easily beat by Asus&#8217; first offerings into the Netbook market. The two biggest things that seem to harm this device are the lack of RAM in the system (mine only has 128MB RAM) and the sub-par processor less than 1GHz.  If you have one, then you may be able to make it work for you, however if you are considering one, I&#8217;d stay clear.  It&#8217;s not worth the price they are asking for it at CVS.</p>
<p>A couple of comments left by Syed and Dave to the original CVS netbook post indicates that there are people out there that are able to get Android running on this device.  If you have information or an article written on how you did it, let me know in the comments.  I&#8217;m interested in trying it out and finding out what works on this machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/07/25/cvs-netbook-revisited/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Building Snort and Nessus &#8211; Ubuntu IDS Part 3</title>
		<link>http://www.yourwarrantyisvoid.com/2011/05/20/building-snort-and-nessus-ubuntu-ids-part-3/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/05/20/building-snort-and-nessus-ubuntu-ids-part-3/#comments</comments>
		<pubDate>Fri, 20 May 2011 16:01:31 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=851</guid>
		<description><![CDATA[&#160; In this final article in the three part Ubuntu IDS series, we will go over installing, compiling and configuring Snort and Nessus on our new IDS device.  We will use Snort to analyze traffic as seen by the IDS and we will use Nessus to perform vulnerability testing on the network. The process for [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><a rel="attachment wp-att-852" href="http://www.yourwarrantyisvoid.com/2011/05/20/building-snort-and-nessus-ubuntu-ids-part-3/watchtower/"><img class="aligncenter size-medium wp-image-852" title="Watchtower" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/Watchtower-300x199.jpg" alt="" width="300" height="199" /></a>In this final article in the three part Ubuntu IDS series, we will go over installing, compiling and configuring Snort and Nessus on our new IDS device.  We will use Snort to analyze traffic as seen by the IDS and we will use Nessus to perform vulnerability testing on the network. The process for installing Snort will also cover installing SnortReport provided by Symmetrix Technologies so we can translate Snort&#8217;s cryptic messages into a more readable format that we can take action on.  Read on as we wrap up the installation and finish our IDS device.</p>
<p><span id="more-851"></span>This article is divided into three sections. The first section will cover installing Snort, then we will move on to customizing Snort beyond the steps covered in the first section for our specific installation.  Finally we will end with installing Nessus.</p>
<h2>1:  Installing Snort</h2>
<p>Admittedly, this was the longest part in the series. I had tried manually to compile and install Snort from sources over and over again and wasn&#8217;t getting anywhere fast.  I had performed research over and over again on what options to use and was no further along than when I had unzipped the sources.  Luckily my research finally turned up a complete HOWTO article written by Symmetrix Technologies which provided instructions on how to compile and set up Snort.  You can download their HOWTO from this site:  <a href="http://www.symmetrixtech.com/download.html">http://www.symmetrixtech.com/articles/004-snortinstallguide286.pdf</a></p>
<p><strong>There are some discrepancies that you must take note of:</strong> If you are using the bonded interface as described in the prior articles, you will need to use the interface &#8220;bond0&#8243; instead of the document&#8217;s provided eth1 interface for monitoring.  If you monitor an ethX interface, you will only get half of the conversation, and since most of Snort&#8217;s ability to detect traffic relies on analyzing stimulus and the responses to that stimulus, you will be severely cutting down on Snort&#8217;s effectiveness.</p>
<h2>2: Snort Tuning</h2>
<p>If you&#8217;re this far in, then it&#8217;s safe to assume that you have already downloaded Snort, the associated ruleset and have SnortReport installed and running.  There are some things that the Snort installation howto did not entirely touch on and these are things that we will cover here.</p>
<p><strong>Adding BPF to /etc/init.d/rc.local</strong></p>
<p>One of the things missing from the Installation HOWTO was to add a BPF expression to the snort command line. BPF stands for &#8220;Berkeley Packet Filter&#8221; and is used by Snort and tcpdump to control what traffic is being analyzed by the respective tool.  In our configuration, we need to add an exception for the IDS&#8217;s management traffic otherwise when we install and run Nessus, we will end up triggering a ton of alerts.</p>
<p>Edit the /etc/rc.local file and locate the snort line.  Add &#8221; not host 192.168.0.253&#8243; to the end of the snort line. Replace 192.168.0.253 with that of the IP of the management interface of your IDS.  This is the BPF syntax that tells it to monitor your network but not the IP of your IDS device. By adding it to the end of the snort command, we are effectively telling Snort to not listen to the traffic generated by Nessus when we decide to fire it off.</p>
<p><strong>Password Protect SnortReport:</strong></p>
<p>Regardless of whether or not your IDS device can be reached from the Internet, there exists several vulnerabilities in SnortReport including one that allows potential code execution.  This could allow someone that knows you run SnortReport to execute code on your IDS and would be counterproductive to our efforts.  Until SnortReport has been fixed by SymmetrixTech, we will have to use a more basic method of securing it.  In order to provide minimal protection for SnortReport, we will add .htaccess protection to the directory that SnortReport was installed in so that way only authorized people will have access to SnortReport.</p>
<p>As root, we will use htpasswd to create the password file.  If you forget it later on, you can recreate the file easily using the below steps. Use the below command to make the password file and replace &#8220;joe&#8221; with that of your desired username.</p>
<p><strong># htpasswd -c /var/snortreportpasswd joe</strong></p>
<p>Now, we need to create a .htaccess file in /var/www/snortreport-1.3.1 to reference it.  Copy the below code and enter it into /var/www/snortreport-1.3.1/.htaccess and don&#8217;t forget the . in the filename.</p>
<pre>AuthName "SnortReport"
AuthType Basic
AuthUserFile /var/snortreportpasswd
Require valid-user
</pre>
<p>Finally, there is one more change we need to make to Apache2 to get the .htaccess protection working.  Edit /etc/apache2/sites-available/default and look for the clause that looks like the one below:</p>
<pre>&lt;Directory /var/www/&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
&lt;/Directory&gt;</pre>
<p>Change the &#8220;<strong>AllowOverride None</strong>&#8221; to &#8220;<strong>AllowOverride All&#8221;</strong> and then restart apache2 via <strong>/etc/init.d/apache2 restart</strong> . Now try it out by going to http://(your IDS IP address)/snortreport-1.3.1/alerts.php. You should  get a password prompt. Type in the password that you created using the htpasswd command earlier and you should see a green page that says SnortReport.</p>
<p>When you first load the page, you will see two dropdowns for Timeframe and Day.  If your IDS has received any incidents, you will see it show the incidents here.   Clicking on the incident summary will show more details including the source and destination IP addresses. Clicking on the IP will return correlated events that include the source or destination IP you clicked on and will show packet payloads and IP addressing information.</p>
<p>Now that you have a way to read the incidents that the IDS receives, it&#8217;s up to you to decide whether or not the incidents generated are something to take action against. However, installing an IDS is only one half of the solution.  In order to be aware of the effect an attack may have on your network, you first must know what vulnerabilities exist on your network.  For that, we turn to the free vulnerability scanner, Nessus.</p>
<h2>3: Installing Nessus</h2>
<p>Nessus is widely used as a professional commercial-grade vulnerability scanner. It can generate reports that indicate per host what vulnerabilities exist and can provide information on where to go to learn more about patching or mitigating the threat.  Keep in mind that while Nessus is often used on Linux, it is a commercial product.  It does have a home version which we will be using in our installation however the home version can not be used in a commercial environment.</p>
<p>The Nessus HomeFeed provides your Nessus installation with the most up-to-date vulnerability detection methods and signatures.  Access to the HomeFeed does come at a cost, however the benefits of having a vulnerability scanner outweigh the loss of a couple of features. Most notably, a feature that is only available to their commercial feed is that you can not set up recurring scans of you home network, e.g. you can&#8217;t tell the IDS to automatically scan your network and generate reports on a regular schedule.  The only other limitation that I have been able to find is that the scans are limited to 16 active hosts per report so if you have 32 hosts, you will need to run two scans. Despite the two limitations mentioned above, Nessus is still a great scanner, and will work quite well for identifying vulnerabilities on your network.</p>
<p>All that being said, let&#8217;s get started.</p>
<p>First off, head to Tenable Security&#8217;s website at <a title="Nessus Security" href="http://www.tenable.com/products/nessus/nessus-homefeed" target="_blank">http://www.tenable.com/products/nessus/nessus-homefeed</a> and register to receive your activation code. Keep your email handy, you will need it later.</p>
<p>Next, head to <a href="http://www.tenable.com/products/nessus/nessus-download-agreement" target="_blank">http://www.tenable.com/products/nessus/nessus-download-agreement</a> and agree to the license, then download the Ubuntu debian package that is appropriate for your distribution.  Since this tutorial is based on using Ubuntu 10.04, I downloaded the Ubuntu 10.04 32 bit version. Although the filename says &#8220;ubuntu910&#8243;, this version was recommended by Tenable as the version to use for 10.04.</p>
<p>Now, SCP the installation package to the IDS and then use <strong>dpkg -i Nessus-4.4.1-ubuntu910_i386.deb</strong> to install it into the server. <strong>Please note:</strong> If your Ubuntu Server is running a 64 bit kernel, please download the 64bit version of Nessus.</p>
<p>Once installed, you will need to add a Nessus user to the service so you can login.  Nessus users are seperate from OS users, so you can have multiple users without having to add multiple users to the system.  To start this process, run <strong>/sbin/nessus-adduser</strong> and follow the prompts.  For the first user that you add, you will want to add an administrative user. This user will be able to adjust Nessus&#8217;s scan policies, behaviors and other settings within Nessus.</p>
<p>Now that you&#8217;ve added a user, you will need to register your Nessus installation using the HomeFeed code in your email.  Run the command <strong>/opt/nessus/bin/nessus-fetch &#8211;register &lt;Activation Code&gt;</strong> and allow it to complete the installation. Substitute <strong>&lt;Activation Code&gt;</strong> with the HomeFeed code in the email.  <strong>Please note:</strong> This step may take a considerable amount of time due to the fact that Nessus will download and update itself according to the HomeFeed subscription.  This only took about an hour on my system, your mileage may vary depending on Internet connectivity speeds.</p>
<p>Now that the Nessus service is installed, registered and updated, it&#8217;s time to test the installation.  Open a web browser and go to <strong>https://your-ids-ip-address:8834</strong> .  If you are running Firefox and are using Noscript, AdblockPlus or Flashblock, you will need to add exceptions for Javascript and Flash for the IDS IP.  This is required as the Nessus UI relies entirely on Javascript and Flash.</p>
<p>Now that you have Nessus installed, it is <strong>highly</strong> recommended to take a read through the Nessus User&#8217;s Guide: <a href="http://cgi.tenable.com/nessus_4.4_user_guide.pdf" target="_blank">http://cgi.tenable.com/nessus_4.4_user_guide.pdf</a> While Nessus is a vulnerability scanner, some of the tests it performs can cause unpredictable results. It is recommended to set up a &#8220;safe&#8221; scan that performs basic testing and then set up a &#8220;full&#8221; scan for aggressive testing.</p>
<h3>How to read the scan results:</h3>
<p>Once you have made it through the User&#8217;s Guide and have performed your first scan, you can download or view the report.  The report is listed according to IP address, then service name, then vulnerability. Each vulnerability will include the service name, port, protocol, related CVE information (links to the CVE database for more information), as well as common fixes for the vulnerability.</p>
<p>I recommend taking a look at the vulnerability list in this order:</p>
<ol>
<li>Externally accessible services: A vulnerability in Apache that listens to the outside world threatens your internal network.  Address this first!</li>
<li>Internally accessible services on the same server as external services:  Should the external service be compromised, internal services could be used to further compromise the network.</li>
<li>Internally accessible services: A service listening internally may not pose much of a threat, but may be a possible point of compromise should another host get infected.  ( A common example is a weakness in older versions of Samba that would allow for remote code execution.)</li>
</ol>
<p>Generally speaking, it is a good idea to keep up to date with all service packs, updates and patches as this will prevent any known exploits from turning into full-blown worms.  Remember, it only takes one vulnerability to get compromised.</p>
<h2>Final thoughts:</h2>
<p>This has definitely been quite a project. I have learned a whole lot about network security in the course of my GCIA training and in building this project. I honestly think that building an IDS device from scratch is a great way to get acquainted with network security and how to perform vulnerability assessments.  Using Snort Report to analyze suspicious traffic and incoming threats and using Nessus to identify vulnerabilities in your system will help your home network stay secure against the ever evolving threats going around the Internet.</p>
<p>Always remember that security is no use  if the warnings go unheeded.  While you don&#8217;t have to turn into a complete security nut, make it a good habit to take a look at Snort Report once a week at least.  Personally, I record the number of events logged and if it changes, I then investigate further however I haven&#8217;t picked up any incidents in the last month so for me it&#8217;s a pretty easy check.  If you find yourself with tons of IRC events and you don&#8217;t use IRC, it&#8217;s very possible that you have an active trojan on your hands and may warrant further investigation.</p>
<p>I hope you had fun and learned a lot from this project. I had a lot of fun building it and working out the kinks to make it all work together.  If you have any comments or questions, please leave me a comment and I&#8217;ll do my best to answer.</p>
<p>FIRESTORM_v1</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/05/20/building-snort-and-nessus-ubuntu-ids-part-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up bonding networking -Ubuntu IDS Part 2</title>
		<link>http://www.yourwarrantyisvoid.com/2011/05/04/building-an-ubuntu-ids-part-2/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/05/04/building-an-ubuntu-ids-part-2/#comments</comments>
		<pubDate>Wed, 04 May 2011 16:01:59 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=847</guid>
		<description><![CDATA[In an earlier article, I demonstrated how you can build a passive monitoring device for an Ethernet network as the first part to a three part project to build a home IDS device.  In this article, the second in the series, I will describe how to set up the networking for an IDS using the [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-848" href="http://www.yourwarrantyisvoid.com/2011/05/04/building-an-ubuntu-ids-part-2/cctvwall/"><img class="aligncenter size-medium wp-image-848" title="CCTV Wall" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/CCTVwall-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p>In an earlier article, I demonstrated how you can build a passive monitoring device for an Ethernet network as the first part to a three part project to build a home IDS device.  In this article, the second in the series, I will describe how to set up the networking for an IDS using the passive tap that I built earlier.This setup will involve using a technique called bonding to take two physical interfaces and bond them together, creating a logical interface that we can use for Snort.  This article will also explain where is the best location to place the tap and what you can expect to see once the networking is set up using common Linux utilities like tcpdump.</p>
<p><span id="more-847"></span></p>
<h2>Requirements</h2>
<ul>
<li>A Passive Tap as mentioned in &#8220;<a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/" target="_blank">Build a Passive Ethernet Tap</a>&#8221; or similar device.</li>
<li>Three network cards or a single network card with  three interfaces.</li>
<li>A new installation of Ubuntu Server. (I am using Ubuntu Server 10.04LTS).</li>
<li>Beer. (Always)</li>
</ul>
<p>The requirements for this project aren&#8217;t that extensive and chances are you have most if not all the equipment you need in your parts bin. The most significant item in this list is the three network cards.  If you followed the steps in my first article in this series, you already have a machine with two or three network cards in it so you&#8217;re pretty much there. If not, then go ahead and get three network cards in your Ubuntu server and ensure that all three cards re properly recognized by the system even if there&#8217;s no IP address. for them.</p>
<p>The first two network cards will be combined together to form the monitoring interface while the third card will be for our management interface.  The management interface will be assigned an IP address and will be how we acccess the server&#8217;s commandline (via SSH), and the scanning and reporting tools we will install in Part 3.</p>
<h2>Getting things set up</h2>
<p>With the proper hardware in hand, we can now set about performing the configuration necessary to getting our interfaces configured properly. In the code below, you can see the interfaces (eth0, eth1 and eth2) and that eth0 has been configured with an IP address.  If you haven&#8217;t configured yours with an IP address, this will be covered while we perform the configuration.</p>
<pre>matt@ids-01:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:18:f3:18:1c:25 
 inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0
 inet6 addr: fe80::218:f3ff:fe18:1c25/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:45458 errors:0 dropped:0 overruns:0 frame:0
 TX packets:23861 errors:0 dropped:0 overruns:0 carrier:2
 collisions:0 txqueuelen:1000
 RX bytes:55984695 (55.9 MB)  TX bytes:2326303 (2.3 MB)

eth1      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:11505094 errors:2 dropped:0 overruns:0 frame:2
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:3057886364 (3.0 GB)  TX bytes:218 (218.0 B)

eth2      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:8061127 errors:1 dropped:0 overruns:0 frame:1
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:1434430796 (1.4 GB)  TX bytes:250 (250.0 B)

lo        Link encap:Local Loopback 
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:16436  Metric:1
 RX packets:48 errors:0 dropped:0 overruns:0 frame:0
 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:3948 (3.9 KB)  TX bytes:3948 (3.9 KB)
</pre>
<p>In this output, you can see eth0 is my management interface as it has been assigned an IP, eth1 and eth2 are both going to become a new interface called bond0.  When we set up Snort, we will use bond0 as our monitoring interface so that way we can take advantage of Snort&#8217;s stateful analysis and because it will be critical for any network analysis to hear both sides of the conversation on the passive tap.</p>
<p>In order to set up bonding, we will need to install the <strong>ifenslave</strong> package.  As root, run the below command:</p>
<p># <strong>apt-get install ifenslave</strong></p>
<p>Once apt-get completes, let&#8217;s check a few things.  First, let&#8217;s take a look at <strong>/etc/modprobe.d/aliases.conf</strong>.  Make sure that the two lines below appear in the file:</p>
<p><strong>alias bond0 bonding</strong><br />
<strong>options mode=0 miimon=100 downdelay=200 updelay=200</strong></p>
<p>If you will be making more than one bonding interface, you will need to add another alias line to coincide with the bond interfaces you wish to add (bond1, bond2, etc..) and you will need to add <strong>max_bonds=X</strong> to the end of the options line. Set X to the maximum number of bonding interfaces you will be using.</p>
<p>Now this is where things get interesting.  In order to test this out, we will bond the interfaces using the command below:</p>
<p><strong># ifenslave bond0 eth1 eth2</strong></p>
<p>It does not matter which order the two eth interfaces appear, however bond0 must come first.  This command tells the Linux kernel to take eth1 and eth2 and pair them together into a single interface (bond0).  Now that we have done that, <strong>ifconfig -a</strong> will present a new interface:</p>
<pre>root@ids-01:~# ifconfig -a
bond0     Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 inet6 addr: fe80::2e0:b6ff:fe00:a206/64 Scope:Link
 UP BROADCAST RUNNING PROMISC MASTER MULTICAST  MTU:1500  Metric:1
 RX packets:19568527 errors:3 dropped:0 overruns:0 frame:3
 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:198240524 (198.2 MB)  TX bytes:468 (468.0 B)

eth0      Link encap:Ethernet  HWaddr 00:18:f3:18:1c:25 
 inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0
 inet6 addr: fe80::218:f3ff:fe18:1c25/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:45907 errors:0 dropped:0 overruns:0 frame:0
 TX packets:24117 errors:0 dropped:0 overruns:0 carrier:2
 collisions:0 txqueuelen:1000
 RX bytes:56024505 (56.0 MB)  TX bytes:2411029 (2.4 MB)

eth1      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
 RX packets:11506043 errors:2 dropped:0 overruns:0 frame:2
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:3058301702 (3.0 GB)  TX bytes:218 (218.0 B)

eth2      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
 RX packets:8062484 errors:1 dropped:0 overruns:0 frame:1
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:1434906118 (1.4 GB)  TX bytes:250 (250.0 B)

lo        Link encap:Local Loopback 
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:16436  Metric:1
 RX packets:48 errors:0 dropped:0 overruns:0 frame:0
 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:3948 (3.9 KB)  TX bytes:3948 (3.9 KB)
</pre>
<p>Now that we have the bonding interface up, we need to write the configuration in <strong>/etc/networking/interfaces</strong> so that they will be brought up at boot time.  After struggling with this for a few moments, I finally found out the proper rules needed in order to do this:</p>
<ol>
<li>You have to define your bonding interface first.</li>
<li>You must use an &#8220;<strong>up</strong>&#8221; statement to specify how to bring up the interfaces. We will be using the parameter <strong>promisc</strong> to ensure that the interfaces are ready for when we install Snort.</li>
<li>We must use bonding-specific statements to specify how the bonding interface will be created and for each interface&#8217;s role in the bonding configuration.</li>
</ol>
<p>Edit <strong>/etc/networking/interfaces</strong> and remove the existing information.  Add the below lines, but be sure to add the proper IP addressing information for your management interface.</p>
<pre># The primary network interface
auto eth0
iface eth0 inet static
 address 172.20.1.253
 netmask 255.255.255.0
 broadcast 172.20.1.255
 gateway 172.20.1.250

auto bond0
iface bond0 inet manual
 bond-slaves none
 bond-mode 0
 bond-miimon 100
 up ifconfig bond0 promisc up

auto eth1
iface eth1 inet manual
 up ifconfig eth1 promisc up
 bond-master bond0
 bond-primary eth1 eth2

auto eth2
iface eth2 inet manual
 up ifconfig eth2 promisc up
 bond-master bond0
 bond-primary eth1 eth2</pre>
<p>In the above configuration, the <strong>up</strong> parameter tells the network scripts to bring up the selected interface up with the promiscuous mode enabled so we can prepare the interfaces at boot time for  listening to network traffic. The <strong>bond-master</strong> and <strong>bond-primary</strong> parameters indicate which bonding interface the physical interface should be added to.  Granted for one bond interface it would appear faster to just single keywords however if you decide to set up multiple bonded interfaces, the keywords would lose meaning quickly.</p>
<p>When all is said and configured, reboot the computer.  When the computer comes back up, check <strong>ifconfig -a</strong> and see if you see something like the below.</p>
<pre>root@ids-01:~# ifconfig -a
bond0     Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 inet6 addr: fe80::2e0:b6ff:fe00:a206/64 Scope:Link
 UP BROADCAST RUNNING PROMISC MASTER MULTICAST  MTU:1500  Metric:1
 RX packets:19570074 errors:3 dropped:0 overruns:0 frame:3
 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:198918392 (198.9 MB)  TX bytes:468 (468.0 B)

eth0      Link encap:Ethernet  HWaddr 00:18:f3:18:1c:25 
 inet addr:172.20.1.253  Bcast:192.168.0.255  Mask:255.255.255.0
 inet6 addr: fe80::218:f3ff:fe18:1c25/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:46106 errors:0 dropped:0 overruns:0 frame:0
 TX packets:24224 errors:0 dropped:0 overruns:0 carrier:2
 collisions:0 txqueuelen:1000
 RX bytes:56042559 (56.0 MB)  TX bytes:2427777 (2.4 MB)

eth1      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1
 RX packets:11506719 errors:2 dropped:0 overruns:0 frame:2
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:3058600599 (3.0 GB)  TX bytes:218 (218.0 B)

eth2      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06 
 UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1
 RX packets:8063355 errors:1 dropped:0 overruns:0 frame:1
 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:1435285089 (1.4 GB)  TX bytes:250 (250.0 B)

lo        Link encap:Local Loopback 
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:16436  Metric:1
 RX packets:48 errors:0 dropped:0 overruns:0 frame:0
 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:3948 (3.9 KB)  TX bytes:3948 (3.9 KB)
</pre>
<h2>Now to install it&#8230;</h2>
<p>In order to install this machine where it will be most effective in your network, there are some things to consider:</p>
<ul>
<li>What kind of Internet access do you have? (Cable, DSL, FiOS, etc&#8230;..)</li>
<li>Does your ISP require running a program on your router to connect? (like PPPoE clients, RASPPPoE, others..)</li>
<li>What is considered the &#8220;edge&#8221; of your network?</li>
<li>Where is the location where the IDS would have most visibility to the network traffic generated by your computers either wired or wireless?</li>
</ul>
<p>In most corporate networks, there is a single switch that handles all the traffic for a network. This makes things a loss less complex as the network traffic is in one place however in most homes, this is simply not the case.  At least in my network, there&#8217;s at least four switches between the router (my edge) and the innermost device (my Wireless Access Point). Since I wanted all the traffic monitored, I elected to connect the passive tap between my router and the first switch.  Any internet activity generated by any device on the network will be monitored by the IDS and if malicious will generate an alert.  If you have only a couple of PCs that are wireless but have several embedded devices like gaming consoles or media streaming boxes (not media center PCs, more like Boxee boxes and the like) you may want to move the passive tap between your wireless access point and the switch connecting the embedded devices as they are a lot less likely to generate malicious traffic.  Your configuration may be different, but when in doubt, installing the passive tap and your soon-to-be IDS between your edge router and the rest of your network is a safe bet.</p>
<h2>What&#8217;s Next?</h2>
<p>We&#8217;ve covered how to build a passive tap. We just covered how to configure bonding for the passive tap.  In the final article in the series, we will discuss how to install Snort and make this machine into a full blown IDS device.</p>
<p>Happy Hacking!</p>
<p>&nbsp;</p>
<p>FIRESTORM_v1</p>
<p>&nbsp;</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 3862px; width: 1px; height: 1px; overflow: hidden;">root@ids-01:~# ifconfig -a<br />
bond0     Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06<br />
inet6 addr: fe80::2e0:b6ff:fe00:a206/64 Scope:Link<br />
UP BROADCAST RUNNING PROMISC MASTER MULTICAST  MTU:1500  Metric:1<br />
RX packets:19570074 errors:3 dropped:0 overruns:0 frame:3<br />
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0<br />
RX bytes:198918392 (198.9 MB)  TX bytes:468 (468.0 B)&nbsp;</p>
<p>bond1     Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:04<br />
inet6 addr: fe80::2e0:b6ff:fe00:a204/64 Scope:Link<br />
UP BROADCAST RUNNING PROMISC MASTER MULTICAST  MTU:1500  Metric:1<br />
RX packets:24303821 errors:2 dropped:0 overruns:0 frame:2<br />
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0<br />
RX bytes:777005710 (777.0 MB)  TX bytes:468 (468.0 B)</p>
<p>eth0      Link encap:Ethernet  HWaddr 00:18:f3:18:1c:25<br />
inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0<br />
inet6 addr: fe80::218:f3ff:fe18:1c25/64 Scope:Link<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:46106 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:24224 errors:0 dropped:0 overruns:0 carrier:2<br />
collisions:0 txqueuelen:1000<br />
RX bytes:56042559 (56.0 MB)  TX bytes:2427777 (2.4 MB)</p>
<p>eth1      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06<br />
UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1<br />
RX packets:11506719 errors:2 dropped:0 overruns:0 frame:2<br />
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:3058600599 (3.0 GB)  TX bytes:218 (218.0 B)</p>
<p>eth2      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:06<br />
UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1<br />
RX packets:8063355 errors:1 dropped:0 overruns:0 frame:1<br />
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:1435285089 (1.4 GB)  TX bytes:250 (250.0 B)</p>
<p>eth3      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:04<br />
UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1<br />
RX packets:16316361 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:3675415003 (3.6 GB)  TX bytes:238 (238.0 B)</p>
<p>eth4      Link encap:Ethernet  HWaddr 00:e0:b6:00:a2:04<br />
UP BROADCAST RUNNING PROMISC SLAVE MULTICAST  MTU:1500  Metric:1<br />
RX packets:7987460 errors:2 dropped:0 overruns:0 frame:2<br />
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:1396558003 (1.3 GB)  TX bytes:230 (230.0 B)</p>
<p>lo        Link encap:Local Loopback<br />
inet addr:127.0.0.1  Mask:255.0.0.0<br />
inet6 addr: ::1/128 Scope:Host<br />
UP LOOPBACK RUNNING  MTU:16436  Metric:1<br />
RX packets:48 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0<br />
RX bytes:3948 (3.9 KB)  TX bytes:3948 (3.9 KB)</p>
<p>root@ids-01:~#</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/05/04/building-an-ubuntu-ids-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a Passive Ethernet Tap &#8211; Ubuntu IDS Part 1</title>
		<link>http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 16:34:40 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=802</guid>
		<description><![CDATA[One of the things that the GCIA study has taught me is that being able to monitor the network your computer is on is a critical necessity to maintaining a secure network. Corporate environments can set up IDS devices to monitor traffic however monitoring doesn&#8217;t work unless you have proper connectivity to what you want [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/acousticcoupler/" rel="attachment wp-att-803"><img class="aligncenter size-medium wp-image-803" title="acoustic coupler" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/acousticcoupler-300x199.jpg" alt="Image courtesy of forums.overclockers.co.uk" width="300" height="199" /></a></p>
<p>One of the things that the GCIA study has taught me is that being able to monitor the network your computer is on is a critical necessity to maintaining a secure network. Corporate environments can set up IDS devices to monitor traffic however monitoring doesn&#8217;t work unless you have proper connectivity to what you want to monitor. Unfortunately, most of us don&#8217;t have central wiring in our house and expensive managed switches that can set up span sessions with which to monitor traffic in transit.  In this HOWTO, I will cover how to build your own monitoring connection that you can use on your own network to monitor traffic without breaking the bank. This article is first in a three part series on how to build your own home IDS for monitoring your network traffic. Look for the other two sections soon!<br />
<span id="more-802"></span></p>
<h2>A little bit more info first&#8230;</h2>
<p>In the early days of affordable Ethernet networking, devices called hubs (or repeaters) were used to bring the signals together from each workstation in order to allow the workstations to communicate with each other. When a packet was sent to the hub, the hub repeated the packet across all ports on the device and all other workstations would receive it, even if it was not destined for that particular workstation.  The hubs gave way to switches as networking technology became cheaper and faster. Unfortunately, the switches also changed the old way of signal transmission. When a workstation sends a packet to a switch, it is sent from the sender&#8217;s switch port  and arrives at  the switch port of the workstation that the packet is destined to. It does not get sent to other workstations&#8217; switch ports unlike the hub&#8217;s transmission method.  Because of the need for network monitoring, more advanced switches started offering monitor ports (Cisco calls them span sessions) that are used to forward all traffic that goes through a switch out of this specifically configured port.  This port would then be connected to the monitoring device and would allow the monitoring device to &#8220;listen&#8221; to all packets that traversed the switch.</p>
<p>The good thing is that most if not all managed switches support a monitor port however the bad thing is that a managed switch is way outside the pocketbook of most home network users.</p>
<h2>But why not use a hub?</h2>
<p>A hub would allow us to listen in on network traffic however a hub would degrade your network&#8217;s performance thanks to it&#8217;s lack of proper high speed flow control and its susceptability to collisions.  In my testing, I used a 100baseT hub between my firewall and my network and found that my previously rock solid network connection had dropped well below speed and would barely support YouTube streaming, much less Netflix.  Instead of using a hub and risking continued degradation, I decided to research another solution.</p>
<h2>So, what&#8217;s the solution and how do I use it?</h2>
<p>The solution is the Passive Tap.  This device sits between a unmanaged switch and a computer or router and allows a monitor device to listen in on the network connection between a computer and switch.  The word passive in this instance means that there is no way to detect the device&#8217;s presence. It does not have a MAC address, it does not repeat. For all intensive purposes, the tap does not exist.</p>
<p><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/passivetapmonitorsetup/" rel="attachment wp-att-804"><img class="aligncenter size-full wp-image-804" title="Passive Tap Monitor Setup" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/PassiveTapMonitorSetup.jpg" alt="" width="438" height="174" /></a></p>
<p>In the image above, we have connected the Passive Tap between a network switch and a monitored host in order to monitor traffic between the host and other machines on the network (in this case the Server).  This would be an ideal setup for monitoring traffic generated by the monitored host and the rest of the network with the focus being on the monitored host. In this configuration, the monitor device would pick up all traffic destined to or originating from the host and any broadcast traffic generated by the network.</p>
<p style="text-align: center;"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/passivetapmonitorsetup2/" rel="attachment wp-att-873"><img class="size-full wp-image-873 aligncenter" title="Passive Tap Monitor Setup #2" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/PassiveTapMonitorSetup2.jpg" alt="Passive Tap Monitor Setup #2" width="438" height="174" /></a></p>
<p>This configuration is a bit different than the first image however the scope of the monitor device&#8217;s visibility has changed. Instead of just monitoring the Monitored Host, this configuration allows the monitor device to monitor any Internet traffic that passes between any host on the switch and the firewall. If there were additional devices connected to the switch (other desktops, an Xbox, a Wifi Access point, etc..) their communication with the Internet would also be monitored.  The only communication that would not get monitored would be communication between the devices plugged into the switch (for example the Monitored Host and a Wifi Accesspoint, etc.)</p>
<h2>Parts List</h2>
<p>In order to build a passive tap, you will need the following items.  The parts themselves cost me about $20 at a computer store which is a lot better than the $200 that some eBay sellers want.</p>
<ul>
<li>A cat-5 patch cord</li>
<li>A surface mount biscuit jack / modular mounting box. (See picture below)</li>
<li>Two CAT5 keystones (they don&#8217;t have to be green/red like mine)</li>
<li>Screwdriver</li>
<li>Wire cutters/blade</li>
<li><a href="http://en.wikipedia.org/wiki/Punch_down_tool" target="_blank">A M110 punch down tool</a> (If you have one, it makes the installation easier)</li>
<li>A monitoring computer with two network interfaces and Wireshark installed (windows) or tcpdump(linux)</li>
<li>A test computer (or device) with one network interface</li>
<li>A network switch.</li>
<li>Beer (optional)</li>
</ul>
<div id="attachment_805" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/parts/" rel="attachment wp-att-805"><img class="size-medium wp-image-805" title="Parts" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/Parts-300x225.jpg" alt="Parts" width="300" height="225" /></a><p class="wp-caption-text">Parts</p></div>
<p>Here&#8217;s an image of the parts. The biscuit jack on the left, the two keystones are in the center and the patch cord is on the right.</p>
<p>We&#8217;ll start off by first taking a look at the keystones up close.</p>
<div id="attachment_806" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/keystones/" rel="attachment wp-att-806"><img class="size-medium wp-image-806" title="Keystones" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/Keystones-300x225.jpg" alt="Keystones" width="300" height="225" /></a><p class="wp-caption-text">Keystones</p></div>
<p>These keystone jacks are wired up and marked in such a way that all you need to do to wire it up properly is to follow the color code. A closer inspection will reveal that there are small numbers in between the symbols for the wire positions. In <a href="http://www.infocellar.com/networks/cables/twisted-pair-cables.htm" target="_blank">this page on twisted pair wiring</a>, you can see that of the four pairs in a Cat-5 10/100 cable, only pairs 2 (white/orange) and 3(white/green) are used.  In order to properly receive both sides of the conversation on the wire, we will need to &#8220;tap&#8221; into both pairs and route them to the proper pins on the two keystones to each jack&#8217;s Pair 2 (receive pair) so that the data being sent can arrive at the NIC of our monitoring device.</p>
<p>If you scroll down to the section labeled &#8220;568A and 568 B Color Schemes&#8221;, you will see that the receive pair is on pins 3 and 6 of the diagram jacks.  Our keystones are similarly labelled and when we are done, we will have one pair of the Cat-5 patch cable going to pins 3 and 6 of one jack, and the other pair of the Cat-5 patch cable going to the other jack.</p>
<h2>Let&#8217;s get started.</h2>
<p>First off, it is important to understand that you must be able to do this WITHOUT NICKING OR CUTTING THE WIRES.  A cut or nick could result in either your tap not working properly or the tap getting all the data but your connected host doesn&#8217;t or any one of a whole handful of issues.  Thankfully, Cat-5 patch cords are not very expensive, but it still sucks to put a project on hold because a slip of the knife.</p>
<p>To start, lay out the patch cord and decide on where you want the tap.  Since the hosts are closer to my monitor machine, I&#8217;ve decided to create a short end and a long end with the tap being more towards one end.  You may want to have the tap in the middle or very close to one end of your patch.  It electrically does not matter.</p>
<p>Strip back about two to three inches of jacket so that you have something like below.</p>
<div id="attachment_807" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/strippedwires/" rel="attachment wp-att-807"><img class="size-medium wp-image-807" title="Stripped Wires" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/strippedwires-300x225.jpg" alt="Stripped Wires" width="300" height="225" /></a><p class="wp-caption-text">Stripped Wires</p></div>
<p>Mount the keystones in the surface mount box as shown below.</p>
<p>&nbsp;</p>
<div id="attachment_811" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/mounted-keystones/" rel="attachment wp-att-811"><img class="size-medium wp-image-811" title="mounted keystones" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/mounted-keystones-300x225.jpg" alt="mounted keystones" width="300" height="225" /></a><p class="wp-caption-text">mounted keystones</p></div>
<p>Now that they are mounted, we will then need to take a look at which pair of pins we need to match the wires up to. Below is a better side-view pic of the green jack in detail.  Please note, your jacks may appear different, but all CAT5 keystone jacks that I have seen have both a color designation and a numeric designation. Be sure to pay attention to which is which and where you are placing your wires otherwise it may not work.</p>
<div id="attachment_812" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/wiremarks/" rel="attachment wp-att-812"><img class="size-medium wp-image-812" title="Wire/Pin designations" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/wiremarks-300x225.jpg" alt="Wire/Pin designations" width="300" height="225" /></a><p class="wp-caption-text">Wire/Pin designations</p></div>
<p>You can click on the picture for a larger more detailed image.  In the above image (using the top set of colors as a guide) we see that the orange/white hash is pin 3 and the solid orange is pin 6. The same goes for the red jack (not shown).  That being said, untwist the orange and green wires, and place them into their respective slots. Make sure that the solid wire goes with the solid pin and the hashed wire goes with the hashed pin. A reversal here will cause the monitor port not to receive data and could affect your host/switch.</p>
<div id="attachment_815" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/readytocrimp/" rel="attachment wp-att-815"><img class="size-medium wp-image-815" title="Wires ready to crimp" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/readytocrimp-300x225.jpg" alt="Wires ready to crimp" width="300" height="225" /></a><p class="wp-caption-text">Wires ready to crimp</p></div>
<p>In the above photo, you can see that the white/orange pair are lightly inserted into the wire channels.  If you don&#8217;t have the M100 punch tool, you can get away with using the wire caps that came with your keystones.  These caps will push down the wire and crimp it into place over a metal pin that connects the wire to the pin in the jack.  When you are done, you will have something akin to the below:</p>
<div id="attachment_816" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/readytoclose/" rel="attachment wp-att-816"><img class="size-medium wp-image-816" title="Tap ready to close" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/readytoclose-300x225.jpg" alt="Tap ready to close" width="300" height="225" /></a><p class="wp-caption-text">Tap ready to close</p></div>
<p>Also of note: To act as a strain relief, I have added tiewraps on the cable. This will serve to protect the cable from getting yanked out and damaged.  In this picture, you can also see the two white caps that have punched the wires down in place. Reassemble the jack and make sure to install the screw in the lid if your jack has one.</p>
<div id="attachment_817" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/completedtap/" rel="attachment wp-att-817"><img class="size-medium wp-image-817" title="Completed Passive Ethernet Tap" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/completedtap-300x225.jpg" alt="Completed Passive Ethernet Tap" width="300" height="225" /></a><p class="wp-caption-text">Completed Passive Ethernet Tap</p></div>
<p>Here&#8217;s the completed tap in all it&#8217;s glory!</p>
<h2>Testing the Tap</h2>
<p>In order to test the tap, we need at least two computers, one of which must have two network adapters.  The computer with one network adapter will be our &#8220;test host&#8221; and the other computer will be our monitoring host.  On the test host, I have assigned the IP address 10.0.0.2 and on the monitoring computer, I have assigned one interface (eth0) with the IP of 10.0.0.1.  The monitoring interface (eth1) will have no IP address assigned to it and will be for testing the tap.  Remember that as far as the test host is concerned, the tap is just a CAT-5 patch cable.</p>
<p>Before proceeding, mark the passive tap where the Ethernet cables come out as A and B.  This will be important as this test will also help us label which side of the conversation we are listening to.  One side will be considered &#8220;Network to Host&#8221; and the other will be considered &#8220;Host to Network&#8221;.  It is imperative that we get both sides of the conversation, each side represented by one of the two keystone jacks. While it might not be important now, later on when you use this tap for something else (like an IDS project), you will need to know which side of the conversation you are listening to.</p>
<p>To get your test rig set up, connect the long side (side A in my case) of the tap cable to the switch.  Connect the short side (side B in my case) to the test host.  Connect the ethernet interface on the monitoring machine to the switch, but leave the  unmonitored interface disconnected.  Keep in mind that on my monitoring machine, eth0 was the interface with the IP address, and eth3 was the interface that will be used for monitoring. I&#8217;m using Linux on my system, you may need to make adjustments where needed.</p>
<ul>
<li>On the monitoring host, ensure that you can ping the test host before hooking up the monitoring interface to the tap.</li>
<li>On the monitoring host, open two terminal windows</li>
<li>In the first window, start tcpdump using this command:  <strong>sudo tcpdump -i eth3 -nvs0 -c 10 ip[9]=1</strong>This translates to start tcpdump on eth3, no host resolution (-n), verbose mode (v), no snapshot length (s0), for a count of 10 packets (-c 10) and only on ICMP protocol (ip[9]=1).</li>
<li>Attach the monitoring interface to one of the two keystones.  I picked the red jack.</li>
<li>In the second window, ping the test host using the -c 5 parameter:  <strong>ping testmachine -c 5</strong> The -c 5 tells ping to try 5 times.</li>
<li>You should see the below text in your ping window:</li>
</ul>
<p>&nbsp;</p>
<pre>$ ping  testmachine -c 5
PING testmachine (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=7.25 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.685 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.719 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=0.746 ms
64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=0.704 ms</pre>
<p>&nbsp;</p>
<ul>
<li>Your TCPDUMP window should show something like this:</li>
</ul>
<p>&nbsp;</p>
<pre>21:48:59.093624 IP (tos 0x0, ttl 64, id 27270, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.2 &gt; 10.0.0.1: ICMP echo reply, id 24899, seq 1, length 64
21:49:00.088502 IP (tos 0x0, ttl 64, id 49871, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.2 &gt; 10.0.0.1: ICMP echo reply, id 24899, seq 2, length 64
21:49:01.087486 IP (tos 0x0, ttl 64, id 36772, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.2 &gt; 10.0.0.1: ICMP echo reply, id 24899, seq 3, length 64
21:49:02.086630 IP (tos 0x0, ttl 64, id 27025, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.2 &gt; 10.0.0.1: ICMP echo reply, id 24899, seq 4, length 64
21:49:03.085505 IP (tos 0x0, ttl 64, id 28037, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.2 &gt; 10.0.0.1: ICMP echo reply, id 24899, seq 5, length 64</pre>
<p>&nbsp;</p>
<ul>
<li>Keep in mind that there are two packets associated with ping. One is an <strong>ICMP Echo Request</strong> and the other is an <strong>ICMP Echo Reply</strong> In this case I received the echo reply which means that the red jack is for &#8220;Host to Network&#8221; monitoring or B-&gt;A. If you got ICMP echo request, then your jack is A-&gt;B.</li>
<li>Mark the jack as B-&gt;A and continue testing. At this point, we know that our tap at least hears half the conversation.</li>
<li>Switch the monitor interface to the other jack (Mine is green) and rerun the ping.  Your ping should show the below just like before:</li>
</ul>
<p>&nbsp;</p>
<pre>$ ping 10.0.0.2 -c 5
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=9.69 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.705 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.663 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=0.722 ms
64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=0.714 ms</pre>
<p>&nbsp;</p>
<ul>
<li>This time, however, the TCPDUMP output should have changed:</li>
</ul>
<p>&nbsp;</p>
<pre>22:00:28.084339 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.1 &gt; 10.0.0.2: ICMP echo request, id 40269, seq 1, length 64
22:00:29.077220 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.1 &gt; 10.0.0.2: ICMP echo request, id 40269, seq 2, length 64
22:00:30.076215 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.1 &gt; 10.0.0.2: ICMP echo request, id 40269, seq 3, length 64
22:00:31.075218 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.1 &gt; 10.0.0.2: ICMP echo request, id 40269, seq 4, length 64
22:00:32.074214 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
 10.0.0.1 &gt; 10.0.0.2: ICMP echo request, id 40269, seq 5, length 64</pre>
<p>&nbsp;</p>
<ul>
<li>Just like before, I received 5 packets however last time I got the ICMP echo reply, this time I got the ICMP echo request.  This means that the green jack is the A-&gt;B connector, that is Network to Host. Mark it as appropriate.</li>
</ul>
<p>If you&#8217;re at this point, then you have demonstrated that the tap works.  It allows the test host to communicate with the network unimpeded, it also allows the monitoring of host to network and network to host data.  My passive tap looks like the one below:</p>
<div id="attachment_818" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/labelled/" rel="attachment wp-att-818"><img class="size-medium wp-image-818" title="Finished Passive Tap" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/03/labelled-300x225.jpg" alt="Finished Passive Tap" width="300" height="225" /></a><p class="wp-caption-text">Finished Passive Tap</p></div>
<h2>Now what to do?</h2>
<p>At this point, with a good passive tap in hand, you have a whole bunch of things you can do. You could:</p>
<ol>
<li>Establish an IDS for your network (my original plan)</li>
<li>Monitor a host&#8217;s traffic exchange with the network/Internet.</li>
<li>Perform traffic reconstruction for analysis.</li>
<li>Monitor network communication between your Wireless access point and the rest of your network</li>
</ol>
<h2>Troubleshooting</h2>
<p>Unfortunately, I can&#8217;t account for every situation however there may be some situations where the tcpdump test doesn&#8217;t exactly work as planned.  Here&#8217;s some common solutions if your tests don&#8217;t work quite right<strong>:</strong></p>
<p><strong>I can see the A-&gt;B traffic, but can&#8217;t see the B-&gt;A traffic. The ping window shows the host responds. (or)</strong></p>
<p><strong>I can see the B-&gt;A traffic but can&#8217;t see the A-&gt;B traffic. The ping window shows the host responds. (or)</strong></p>
<p><strong>I can not see any traffic, but the ping window shows the host responds.</strong></p>
<p><strong> </strong>Check your wires on the keystone and make sure the wire went down onto the metal pin. Sometimes when using the caps to crimp down the wires, one of the wires will shift at the last second<strong>.<br />
</strong></p>
<p><strong>I can see the ICMP Echo Request  on one port but I see nothing on the other. The ping window shows that the host does not respond.</strong></p>
<p>Check to see that the wires didn&#8217;t rip apart or that they were not nicked in the construction process.</p>
<h2>Last Thoughts</h2>
<p>Even if you don&#8217;t plan on building a home IDS, having a passive tap in your toolbox is a good idea.  You never know when you will need to intercept and analyze traffic between two devices on a network. This device will allow you to do so with minimal effort and cost all while allowing the host to chatter away unimpeded by the monitoring.</p>
<p>Happy Hacking!</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/04/06/homeland-security-build-a-passive-ethernet-tap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Minecraft Server in Ubuntu Server</title>
		<link>http://www.yourwarrantyisvoid.com/2011/01/09/installing-minecraft-server-in-ubuntu-server/</link>
		<comments>http://www.yourwarrantyisvoid.com/2011/01/09/installing-minecraft-server-in-ubuntu-server/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 22:29:05 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Minecraft]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=773</guid>
		<description><![CDATA[Ok, I&#8217;ll admit it.  I&#8217;ve been caught by the Minecraft bug.  It bit me hard and of course I learned rather quickly that there is a problem with using two laptops to play Minecraft on and that is that it&#8217;s a pain in the posterior to move your save games around.  In this article, I [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-775" href="http://www.yourwarrantyisvoid.com/2011/01/09/installing-minecraft-server-in-ubuntu-server/minecraftubuntu/"><img class="aligncenter size-full wp-image-775" title="Minecraft and Ubuntu logos" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2011/01/minecraftubuntu.jpg" alt="Minecraft and Ubuntu logos" width="263" height="88" /></a>Ok, I&#8217;ll admit it.  I&#8217;ve been caught by the Minecraft bug.  It bit me hard and of course I learned rather quickly that there is a problem with using two laptops to play Minecraft on and that is that it&#8217;s a pain in the posterior to move your save games around.  In this article, I will be covering how to install Minecraft Server on a new installation of Ubuntu 9.04LTS.  These instructions will work for all current versions of Ubuntu, so if you&#8217;re using something newer or something older, these instructions should get you up and running in no time. <span id="more-773"></span></p>
<h2>Foreword</h2>
<p>Please note that per Notch (the Minecraft developer), running the Multiplayer server is still in beta phase so expect it to crash, be buggy and generally not work.  That being said, I can personally tell you that Minecraft Server DOES work and except for a few minor gameplay glitches, the server works quite well. Please keep in mind that this is by no means an exhaustive article on all things Minecraft Server, nor is it written in stone (ba-dum-thish!) as the Minecraft Server application may change.  If it does, I will make changes to this article to keep it current.</p>
<p>I can tell you that having your own Minecraft server is awesome and that you will never go back to playing singleplayer as you won&#8217;t have to worry about files to migrate and that your world will continue to evolve even as you are not playing.  This being said, before you disconnect your Minecraft session, it is recommended to make sure that your minecraft player is somewhere safe, be it in your bunker or somewhere where baddies can&#8217;t get to you while you are away. Remember, just because you&#8217;re not logged in, doesn&#8217;t mean that the world stops.</p>
<h2>System Requirements</h2>
<p>The System Requirements for Minecraft Server have yet to be officially established however there are some guidelines that have turned up during my research into this topic.  The below is a guideline only and not an exhaustive set of requirements.  It&#8217;s perfectly fine if you don&#8217;t meet all of them however expect performance hits depending on how you use the server.</p>
<ul>
<li>Processor: At least a 1.5GHz single core chip, whichever architecture you desire.</li>
<li>RAM:  At least 1.5GB FREE RAM. If you use the server for anything more than Minecraft, make sure you have at least 1.5GB free RAM at full utilization.</li>
<li>Disk: At least a 20Gb disk, with swap space allocated. (Using the &#8220;Use Full Disk&#8221; and &#8220;Automatically Setup Partitions&#8221; options in the Ubuntu Setup will ensure you have enough swap.  Although the game isn&#8217;t that big, the save files and caching elements will be quite large so of course the more the merrier.</li>
<li>Networking: 10/100 Ethernet is recommended.</li>
<li>Video:  Doesn&#8217;t matter. We will be running Minecraft Server in a Screen session, so there&#8217;s no need for a fancyOMGWTFBBQ video card. Save that for the rig you will play Minecraft on.</li>
</ul>
<p><strong>Please note: In order to take advantage of Minecraft Server, you must purchase the game from Notch at <a title="Minecraft Official Site" href="http://www.minecraft.net" target="_blank">www.minecraft.net</a> and have a username and password. You will still need to use either the Minecraft Beta standalone application or the Minecraft Beta web-based application to access your server.</strong></p>
<p>This is the basic setup of a good single person Minecraft server. While the possibility exists that you may be able to run multiple connected players on the specs above, if you are planning on hosting a lot of players, you may want to consider a beefer rig. My Minecraft server uses the below stats:</p>
<ul>
<li>Processor: Dual Core Intel Core 2 Duo 1.86GHz</li>
<li>RAM:  3.5GB DDR-2</li>
<li>Disk: 80GB SATA</li>
<li>Networking: 10/100/1000 Ethernet (onboard)</li>
<li>Video: whatever&#8217;s on the motherboard.</li>
</ul>
<h2>Getting Started</h2>
<p>This HOWTO will already assume you&#8217;ve installed your core Ubuntu Server installation and have performed no additonal steps. Login with your user account that you created during setup and perform the following steps. While you can technically prepend &#8220;sudo&#8221; to each command, I find it faster and less frustrating to just &#8220;sudo bash&#8221; and type your password once.</p>
<ul>
<li>
<b>apt-get update</b>
</li>
<li>
<b>apt-get install openssh-server</b>
</li>
<li>
<b>apt-get install screen</b>
</li>
</ul>
<p>This will install the OpenSSH server so you can remotely manage the server.  You will need a client like PuTTY (<a title="Putty Homepage" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">download from here</a>) in order to access it.  This will also install Screen which will contain the Minecraft server process.  If you don&#8217;t install screen, you will not be able to exit the SSH session without the Minecraft server being killed off.</p>
<p>Now for the fun part.  You will need to install Java in order to start the Minecraft server but Minecraft server will require the use of only the Sun JVM. I tried with the other JVM and it did not work at all.</p>
<ul>
<li>
<b>apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre</b>
</li>
</ul>
<p>In order to ensure that the java environment is correct, run the command &#8220;java -version&#8221; and make sure it matches the below text.<br />
<b># java -version<br />
java version &#8220;1.6.0_22&#8243;<br />
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)<br />
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)<br />
</b></p>
<p>If it shows something else, you will need to do the following:</p>
<ul>
<li><b>update-java-alternatives -l</b></li>
</ul>
<p>This will list off all the various Java VMs that are installed.<br />
<b># update-java-alternatives -l<br />
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk<br />
java-6-sun 63 /usr/lib/jvm/java-6-sun</b><br />
You will need to set the proper Java VM to use via the below syntax:</p>
<ul>
<li>
<b>update-java-alternatives -s java-6-sun</b>
</li>
</ul>
<p>Now, run &#8220;java -version&#8221; again and it should show the same version information as above. If it does, you&#8217;re good to go otherwise check your error messages.</p>
<p>Please note that the rest of these commands are run without root privileges. <span style="color: #ff0000;"><strong>NEVER EVER RUN MINECRAFT SERVER AS ROOT!</strong></span></p>
<h2>Installing Minecraft Server</h2>
<p>If you&#8217;re this far, then you&#8217;ve got the Java VM set properly and your server is all set for Minecraft Server.  You will need to download the minecraft_server.jar to your computer then use scp to put it on the server. You can download a Windows SCP client called WinSCP from <a title="WinSCP homepage" href="http://winscp.net/eng/index.php" target="_blank">this site</a>. Copy it into your non-root user&#8217;s home directory, in my case I&#8217;m using &#8220;mcserver&#8221;.</p>
<p>To start the server, you will need to use the following command:</p>
<ul>
<li>
<pre>java -Xmx1024m -Xms1024m -jar minecraft_server.jar nogui</pre>
</li>
</ul>
<p>You will see a lot of text scroll past the screen and you will see it generate a new world via the console messages. Once it settles down, you can then type &#8220;help&#8221; for a list of commands.</p>
<p>Since we just fired it up, let&#8217;s go ahead and stop it. Type in the command &#8220;save-all&#8221; which forces the server to save the generated map, then &#8220;stop&#8221; to shut the server down.</p>
<h2>Stopping and Starting the server</h2>
<p>To start the server, first off make sure you are in a screen session by typing &#8220;screen -list&#8221; like below:</p>
<pre>mcserver@mcserver:~$ screen -list
There is a screen on:
 2434.tty1.mcserver        (01/09/2011 12:58:57 PM)        (Attached)
1 Socket in /var/run/screen/S-mcserver.</pre>
<p>This indicates that you are in a screen session.  If you see &#8220;(no screens running)&#8221; then just type &#8220;screen&#8221; to start one.</p>
<p>Once in the screen session, type in the command shown below.  This is the exact same command as when we installed it, but this time we&#8217;re not going to shut it down.</p>
<ul>
<li>
<pre>java -Xmx1024m -Xms1024m -jar minecraft_server.jar nogui</pre>
</li>
</ul>
<p>To disconnect from the screen session, hit Ctrl-A and then the D key, this will drop you back to the shell prompt where you can then type &#8220;exit&#8221; to logout. The Minecraft Server will continue to run.</p>
<p>To stop the server that is already in a screen session, login to the server using SSH and the non-root user.  To reconnect with the screen session, type in &#8220;screen -r&#8221;.  You will be reconnected to the server and can then perform the following commands:</p>
<ul>
<li>say Server is going down</li>
</ul>
<p>This lets any players know that the server&#8217;s going down.</p>
<ul>
<li>save-all</li>
</ul>
<p>This tells the server to save the entire world.</p>
<ul>
<li>stop</li>
</ul>
<p>This tells the Minecraft Server to shutdown and exit. You will be dropped to a console prompt from there you can shutdown the server or do whatever you need to do.</p>
<h2>Other useful commands in MC Server</h2>
<pre>Console commands:
 help  or  ?               shows this message
 kick &lt;player&gt;             removes a player from the server
 ban &lt;player&gt;              bans a player from the server
 pardon &lt;player&gt;           pardons a banned player so that they can connect again
 ban-ip &lt;ip&gt;               bans an IP address from the server
 pardon-ip &lt;ip&gt;            pardons a banned IP address so that they can connect again
 op &lt;player&gt;               turns a player into an op
 deop &lt;player&gt;             removes op status from a player
 tp &lt;player1&gt; &lt;player2&gt;    moves one player to the same location as another player
 give &lt;player&gt; &lt;id&gt; [num]  gives a player a resource
 tell &lt;player&gt; &lt;message&gt;   sends a private message to a player
 stop                      gracefully stops the server
 save-all                  forces a server-wide level save
 save-off                  disables terrain saving (useful for backup scripts)
 save-on                   re-enables terrain saving
 list                      lists all currently connected players
 say &lt;message&gt;             broadcasts a message to all players</pre>
<h2>Quick and Easy Start script</h2>
<p>Below is a very simple script I wrote because I kept forgetting all the java commands.  In order to use it, save both lines below as a file (like &#8220;startmcserver.sh&#8221;) and then &#8220;chmod +x startmcserver.sh&#8221; so that way you can start the server simply by running &#8220;./startmcserver.sh&#8221;</p>
<pre>#!/bin/bash
java -Xmx1024m -Xms1024m -jar minecraft_server.jar nogui</pre>
<p>Remember to keep both lines intact.  It&#8217;s essentially the same Java command, but it&#8217;s easier to type.</p>
<p>Have fun and Happy minecrafting!</p>
<p>FIRESTORM_v1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2011/01/09/installing-minecraft-server-in-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>GUIDemo &#8211; A full VGA Library for the Propeller</title>
		<link>http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/</link>
		<comments>http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 06:12:04 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Parallax]]></category>
		<category><![CDATA[propeller]]></category>
		<category><![CDATA[PS/2]]></category>
		<category><![CDATA[VGA]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=686</guid>
		<description><![CDATA[The Parallax VGA GUI Demo is great for adding a pre-built GUI for your projects. The bonus is that the drivers for using a PS/2 keyboard and mouse and a VGA display are pre-built and ready to run.  With a little bit of configuration, you can add a well built UI to your application and [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-79" href="http://www.yourwarrantyisvoid.com/2009/08/31/parts-parallax-vgadual-ps2-breadboard-adapter/parallax_logo/"><img class="aligncenter size-medium wp-image-79" title="parallax_logo" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2009/08/parallax_logo-300x97.jpg" alt="" width="300" height="97" /></a></p>
<p>The Parallax VGA GUI Demo is great for adding a pre-built GUI for your projects. The bonus is that the drivers for using a PS/2 keyboard and mouse and a VGA display are pre-built and ready to run.  With a little bit of configuration, you can add a well built UI to your application and make it easier to display output and receive input from the user.</p>
<p>In this article, I will demonstrate some of the basic options that are needed in order to get the GUI up and running.  While our application is going to be turning on a few LEDs, once you have these basics down you should be able to use this article and build whatever user elements are required for your application.<span id="more-686"></span></p>
<h1>Prerequisites:</h1>
<p>If you haven&#8217;t already, I would recommend the Parallax PS/2 and VGA Adapter board. This board provides two PS/2 ports (mouse and keyboard) and a 15 pin VGA port in an easy to use modular design that is breadboard compatible.  Here is a <a href="http://www.parallax.com/Store/Accessories/CablesConverters/tabid/166/CategoryID/40/List/0/SortField/0/catpageindex/2/Level/a/ProductID/583/Default.aspx" target="_blank">link to the VGA board on Parallax&#8217;s site</a> and here is the link to <a href="http://www.yourwarrantyisvoid.com/2009/08/31/parts-parallax-vgadual-ps2-breadboard-adapter/" target="_blank">my earlier article</a>.</p>
<p>In addition to the Adapter Board, you will need<br />
- A PS/2 mouse (Not a USB mouse with a PS/2 adapter)<br />
- A PS/2 keyboard (Not a USB keyboard with a PS/2 adapter)<br />
- A 15 pin VGA monitor<br />
- six LEDs, any color<br />
- six 100 ohm resistors (Brown-Black-Brown)<br />
- Jumper Wires for the Adapter board<br />
- A PC with USB port for the PropPlug USB programmer.<br />
- 9V Battery or other 9VDC power source</p>
<h1>Understanding the concept of a UI</h1>
<p>Before we get started, let&#8217;s discuss the basic differences between a Prompt and a UI.</p>
<p>A Prompt:</p>
<ul>
<li> &#8211; asks for something direct like &#8220;Your Name&#8221;</li>
<li> &#8211; Reads the response, Input halts until requirement satisfied, e.g. (Press any key to continue)</li>
<li> &#8211; Treats the response as programmed, e.g. $YourName</li>
<li> &#8211; is programmed in a linear fashion. e.g. You prompt for your name, then you prompt for your address, then you prompt for your date of birth, etc&#8230;</li>
</ul>
<p>A GUI:</p>
<ul>
<li>Shows multiple items to interact with</li>
<li> Reads a response when triggered with an event and does not wait.</li>
<li>Performs actions based on event triggers.</li>
<li>Can perform actions in a non-linear fashion. e.g. Clicking Button 1, Button 3, Button 2, Button 6, Button 1 again.</li>
</ul>
<p>Remember, although a GUI can contain prompts (&#8220;Click OK to Continue&#8221;), it&#8217;s not often that a prompt becomes a GUI. Also remember that a GUI is Event driven, not prompted.</p>
<h2>Events</h2>
<p>It&#8217;s important to understand that performing any action with the mouse and keyboard triggers an event. It&#8217;s when the event (in most cases, a mouse click) occurs on a GUI element (a checkbox for example), we get something to happen.  By programming the Parallax GUI Demo, you will build GUI Elements (things to click on or type into) using Mouse and Keyboard Events in order to generate some kind of output (Lighting LEDs).</p>
<p>Keep this in mind, as generating events and how to deal with them are the cornerstone of any GUI programming (not just Parallax!).</p>
<h2>Elements</h2>
<p>Mouse events are nothing without something to interact with, so that brings us to the point where we have to talk about the GUI. Each object in a GUI, checkboxes, menu items, windows, submit buttons, etc. are all considered elements of the GUI. We build the GUI using elements to satisfy our program&#8217;s needs.  For the &#8220;What is your name?&#8221; prompt, we would need a window element (with a Window Title element), a text element saying &#8220;What is your name?&#8221;, a text field element (so we can get the name back to the program) and a submit button element.  That&#8217;s Five elements! Thankfully, only two of them are interactive.  The text field needs to be clicked on (to tell the GUI that keyboard input goes here), and the Submit button needs to be clicked on to tell the program to continue.</p>
<p>Even though we started out with five elements, thankfully we only have to code for two events.</p>
<p>Below is a screenshot of various elements that the Parallax UI is able to generate.</p>
<div id="attachment_688" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-688" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2001/"><img class="size-medium wp-image-688" title="Parallax VGA Demo Screenshot" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2001-300x225.jpg" alt="Parallax VGA Demo Screenshot" width="300" height="225" /></a><p class="wp-caption-text">Parallax VGA Demo Screenshot</p></div>
<p>In this screenshot, we can see the following interactive elements:<br />
- Spin Boxes &#8211; A single element with up and down arrows that allow you to select from a list of predefined options. (like a Page Count field on a Print window)<br />
- Checkboxes &#8211; A listed series of predefined options that allow for multiple options to be selected.<br />
- Radio Buttons &#8211; A listed series of predefined options that allow only a single option be selected.<br />
- Pushbuttons &#8211; A single element that is clickable (like a submit button).<br />
- Menu Bar &#8211; A horizontal element containing multiple pushbuttons.<br />
- A Text Input field &#8211; Another horizontal element that takes input from the keyboard.</p>
<p>We also see the following non-interactive but still needed elements:<br />
- Windows &#8211; We need windows to keep these elements organized, otherwise it doesn&#8217;t work too well.<br />
- Status Lamps &#8211; Think of these as the GUI equivalent to an LED and resistor. They can be toggled on or off.</p>
<p>Now that we know what all the elements are, let&#8217;s do something.</p>
<h2>Getting the hardware ready</h2>
<p>Connect the 15 pin VGA/PS2 breakout kit to the lower right hand corner of the breadboard as shown in the image below. The breadboard should be oriented as shown with the PropPlug mounted on the top, usb cable pointing right. You can then connect the 12 pins straight across (watch out for the crystal) to the 12 pins on the right hand side of the Propeller (P16-P27).  Attach the Vss lead to any of the Vss busses (black lines) on your breadboard.</p>
<div id="attachment_689" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-689" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2003/"><img class="size-medium wp-image-689" title="VGA adapter hooked up" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2003-300x225.jpg" alt="VGA adapter hooked up" width="300" height="225" /></a><p class="wp-caption-text">VGA adapter hooked up</p></div>
<p>In order to get the required +5V for the PS/2 mouse and keyboard, look closely at the two voltage regulators at the top of the board. There is an LM2940 (back regulator on the picture below) that provides the 5V and a LM2937 (front regulator) which provides a 3.3V source for the Propeller. Be sure to attach to the OUTPUT of the LM2940 as shown in the picture below.  As a hint, my wire is in the third horizontal row from the top of the LM2940 which is its output lead.</p>
<div id="attachment_690" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-690" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2004/"><img class="size-medium wp-image-690" title="+5V location" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2004-300x225.jpg" alt="+5V location" width="300" height="225" /></a><p class="wp-caption-text">+5V location</p></div>
<p>DO NOT CONNECT YOUR +5V LEAD TO THE +9V BATTERY OTHERWISE DAMAGE TO THE PROPELLER, MOUSE AND KEYBOARD MAY RESULT.</p>
<p>After you have the VGA adapter connected, hook up the LEDs so that the cathodes go to ground and the anodes run through the 100ohm resistors to P0-6 as shown below.</p>
<div id="attachment_691" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-691" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2005/"><img class="size-medium wp-image-691" title="LED connection" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2005-300x225.jpg" alt="LED connection" width="300" height="225" /></a><p class="wp-caption-text">LED connection</p></div>
<h2>Get the software</h2>
<p>If you haven&#8217;t already done so, download the VGA Text GUI Demo from here:  <a href="http://obex.parallax.com/objects/413/" target="_blank">http://obex.parallax.com/objects/413/</a></p>
<p>Unzip the archive, load it up in your Propeller Tool application and load it into RAM to save write cycles on your EEPROM.  If everything works properly, you should be able to move the mouse, click on things and be able to type text in to the &#8220;COMMAND&#8221; field at the bottom. Play around with it for a bit and get used to how the elements interact with each other.  If you want to ensure that your wiring is correct, read the GUIDEMO and GUIBASE section below.</p>
<p>Before proceeding, it&#8217;s recommended to make a backup of the unzipped Propeller VGA demo so that you will have something to refer to in case you accidentally delete part of the demo application. Load the copy of the code for the next step and leave the original copy untouched.</p>
<h1>Hacking up the Code</h1>
<p>Now that you&#8217;re up and running with the test code, let&#8217;s take a look at the existing code and start modifying it.  We&#8217;ll cover important aspects of the existing code along the way. In our application, we will be using the UI to draw a simple window containing six checkboxes that correspond to the six LEDs we have installed.  Once finished, when we check a box, it will light the corresponding LED. If we clear that checkbox, it will extinguish the LED.</p>
<p>So let&#8217;s get started.</p>
<h2>GUIDEMO.spin</h2>
<p>The GUIDemo.spin file is considered the &#8220;Top Level&#8221; or &#8220;root&#8221; (if you&#8217;re a Linux admin like I am) of the entire  application. This file references sub-codebases through  an OBJ (Object) declaration. Although Parallax called it Top Level, I have always referred to it as the &#8220;root&#8221; as in the root of the project much like the root of a filesystem.</p>
<p>Without getting into the syntax of Spin (the Propeller coding language, a topic that Parallax is much better suited for than I am) just know that this is the trunk of the tree as far as all other pieces of code in the VGA Demo are concerned.</p>
<div id="attachment_692" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-692" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/codeheirachy/"><img class="size-medium wp-image-692" title="Code Heirachy" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/CodeHeirachy-300x286.jpg" alt="Code Heirachy" width="300" height="286" /></a><p class="wp-caption-text">Code Heirachy</p></div>
<p>Starting at the top of the GUIDemo.spin file, you see a secion labeled CON. This is for the constants that GUIBase uses to initialize the PS/2 mouse and keyboard and the 15pin VGA port.</p>
<p>The vga_base should point to the I/O pin that is connected to the &#8220;V&#8221; pin of the PS/2 VGA adapter. The GUIBase will assume that the rest are mapped accordingly.  If you are using something other than the Parallax adapter, you will want to ensure that your adapter is wired up as shown below:</p>
<p>I/O Pin        Function<br />
P16        V &#8211; Vertical Scan<br />
P17        H &#8211; Horizontal Scan<br />
P18        B0 &#8211; Blue Positive?<br />
P19        B1 &#8211; Blue Neutral?<br />
P20        G0 &#8211; Green Positive?<br />
P21        G1 &#8211; Green Neutral?<br />
P22        R0 &#8211; Red Positive?<br />
P23        R1 &#8211; Red Neutral?</p>
<p>* Please note, the ?&#8217;s mean I&#8217;m not certain on polarity, but I am sure on the grouping. The reason is that I only have the Parallax VGA adapter so I haven&#8217;t tried to fabricate my own adapter.</p>
<p>The mouse and keyboard each require two pins, &#8220;dat&#8221; and &#8220;clk&#8221;.  The Parallax Adapter has each pin&#8217;s function silkscreened onto the adapter&#8217;s PCB for easy connection and are mapped as shown below:</p>
<p>I/O Pin        Function<br />
P24        Mouse Data<br />
P25        Mouse Clock<br />
P26        Keyboard Data<br />
P27        Keyboard Clock</p>
<p>If you&#8217;re using Parallax&#8217;s VGA adapter, then make sure that your values match what is shown above.  If you are using another adapter, make sure that the values match your respective device&#8217;s pins.</p>
<p>The OBJ section is where we declare any additional code that needs to be included. In the original code, you can see there are three objects declared (GUI, TMRS and NUMS) however for our program, we only need the first one (GUI).  Delete the two lines starting with TMRS and NUMS highlighted in the green square in the image below.</p>
<div id="attachment_693" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-693" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/externalobjects/"><img class="size-medium wp-image-693" title="External Objects" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/ExternalObjects-300x198.jpg" alt="External Objects" width="300" height="198" /></a><p class="wp-caption-text">External Objects</p></div>
<p>When it comes time for you to add your own routines, you can include them here by defining them as objects. For now, just scroll down to the next section.</p>
<p>The VAR section is important because the code shows that all of the interactive elements in the GUI require a byte be assigned to them. This is important as this is how the GUI keeps track of what element is called when an event is triggered. It is critical to remember when you are designing your own GUI, that each interactive element has it&#8217;s own unique ID. This will be important later when we tie the elements into events. For now, remove all the declared bytes and add the below in it&#8217;s place:</p>
<div id="attachment_694" class="wp-caption aligncenter" style="width: 265px"><a rel="attachment wp-att-694" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/varbytes/"><img class="size-medium wp-image-694" title="Variable Bytes" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/VARbytes-255x300.jpg" alt="Variable Bytes" width="255" height="300" /></a><p class="wp-caption-text">Variable Bytes</p></div>
<p>In the above image, we are declaring six CHKB elements numbers 1 through 6.  The naming convention is important as there is code later on where these get defined.</p>
<p>Scroll down to the PUB statement below. This section is the actual code of the program and where we will be doing most of the editing.  First off, make sure that you can see between the CreateUI statement and the PUB statement (top of the blue section of code as pictured below. We will be removing the code there as it was used with the timers code object (that we removed) was initialized at start.  Just like before, delete all the code within the green box. It&#8217;s not needed and will generate errors if you attempt to compile it.</p>
<div id="attachment_695" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-695" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/pubdelete/"><img class="size-medium wp-image-695" title="PUBlic function to delete" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PUBdelete-300x194.jpg" alt="PUBlic function to delete" width="300" height="194" /></a><p class="wp-caption-text">PUBlic function to delete</p></div>
<p>We will replace the deleted code with our own code. This  is the initialization code for our application and occurs prior to the GUI being set up. All our code does is ensure that the first six I/O pins (P0-P5) are set as outputs and are set low so that the LEDs are off.</p>
<p>When you are developing your own program, be sure that the initialization code occurs before the CreateUI statement for best results.</p>
<div id="attachment_697" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-697" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/pubadd/"><img class="size-medium wp-image-697" title="PUBlic INIT code to add" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PUBadd-300x159.jpg" alt="PUBlic INIT code to add" width="300" height="159" /></a><p class="wp-caption-text">PUBlic INIT code to add</p></div>
<p>At this point, we have removed excess objects from our code and declared six variables for our checkbox elements and we have initialized the LEDs. Now we will tell the application what to do when an event has been triggered in order to get the LEDs to light up.</p>
<p>If you look at the code, you will notice that it is a very large repeat loop that contains a case loop inside it. The way it works is that the Propeller will constantly evaluate GUI.ProcessUI. When evaluated, it will check gx against the list of elements and if gx matches a defined element ID, it will then perform the appropriate action.</p>
<p>For now, start at the line that reads &#8220;case gx&#8221; and highlight the text down until you get to the &#8220;START OF UI HELPER FUNCTIONS&#8221;. Since we are not using the demo code in our application, we can safely remove it.</p>
<p>Once removed, add the code in the below image to tie in the events with our custom function. (We&#8217;ll write it next).</p>
<div id="attachment_696" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-696" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/pubevents/"><img class="size-medium wp-image-696" title="Public Events to add" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PubEvents-300x162.jpg" alt="Public Events to add" width="300" height="162" /></a><p class="wp-caption-text">Public Events to add</p></div>
<p>In the above code, we are calling LEDFunction with a different parameter corresponding to each of the six LEDs. Now we need to write the function LEDFunction so it actually does something.</p>
<p>In your application, you may end up writing all of your code in another .spin file and then using an OBJ to declare it.  If you do that, then you can reference your OBJ functions instead of using a basic function here.</p>
<p>Start off by copying that CON statement and inserting it into the empty space. This will create a line we can use when reading the code to make it easier.  Change it from &#8220;UI HELPER FUNCTIONS&#8221; to &#8220;UI APPLICATION FUNCTIONS&#8221; and add the below code as shown.</p>
<div id="attachment_698" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-698" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/prifunction/"><img class="size-medium wp-image-698" title="PRIvate Function to add" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PRIFunction-300x115.jpg" alt="PRIvate Function to add" width="300" height="115" /></a><p class="wp-caption-text">PRIvate Function to add</p></div>
<p>In this section of code, we will write our function for the events.  All we are doing is taking the function&#8217;s parameter and inverting it&#8217;s existing value. If it&#8217;s 1 (on) it is then set 0 (off) and vice versa.  Although we return the value of the I/O pin, it is not used elsewhere and will get overwritten elsewhere.</p>
<p>Scroll further down and we finally get to the CreateUI function.  This is where the UI gets built and the bytes for the elements earlier get defined.</p>
<p>We can see that there are a lot of commands listed here. Don&#8217;t let that intimidate you as we are going to remove most of them. Find the line that starts off with &#8220;vga_cols&#8221; and highlight all the way down to the MIT License.  Remove the code and add the code in the picture.</p>
<div id="attachment_699" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-699" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/guicode/"><img class="size-medium wp-image-699" title="GUI Code to add" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/GUICode-300x141.jpg" alt="GUI Code to add" width="300" height="141" /></a><p class="wp-caption-text">GUI Code to add</p></div>
<p>This code draws out the Text box for our project and gives it a text label. Don&#8217;t worry about the syntax, we&#8217;ll cover that in the GUI CODE section later.</p>
<p>Basically what happens here is that a Simple Box (SBOX) gets drawn with the title of &#8220;LEDs&#8221;.  Inside that box, six checkboxes are drawn, each with their own text description. Pretty straightforward on the UI, right?</p>
<p>We&#8217;re almost done and ready to test our new GUI.</p>
<h2>GUIBASE</h2>
<p>Now, there&#8217;s one more thing we need to do before we go loading this project into RAM and seeing if it works. We need to make an edit to GUIBase.<br />
At the very top of GUIBase, in the CON section, you can see that there is a note describing the GUI Element Inventory that must be present.  We need to edit the code and tell GUIBase that we&#8217;re only using six checkboxes.  However, as the note describes, we can&#8217;t just go set GZ_CHKB to 6 and all others to 0, as this would throw a compiler error.</p>
<p>Go ahead and set all of the GZ_ variables to 1 except for GZ_CHKB which will get a value of 6 since we have six LEDs as shown below.</p>
<div id="attachment_700" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-700" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/guibase/"><img class="size-medium wp-image-700" title="GUIBase changes" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/GUIBase-300x145.jpg" alt="GUIBase changes" width="300" height="145" /></a><p class="wp-caption-text">GUIBase changes</p></div>
<p>Once modified, be sure to save your work and then go to &#8220;Run&#8221;, Compile Top, Load RAM.  You should get something like the below image on your display.</p>
<div id="attachment_701" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-701" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2006/"><img class="size-medium wp-image-701" title="Our GUI LED demo" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2006-300x225.jpg" alt="Our GUI LED demo" width="300" height="225" /></a><p class="wp-caption-text">Our GUI LED demo</p></div>
<p>If all went well and you didn&#8217;t get a compiler error, you should get this GUI.  The little green square is the mouse cursor.  Go ahead and try it out. Make sure that checking each checkbox lights up an LED and that clearing the checkbox turns it off.</p>
<p>Now that we&#8217;ve got a working GUI up and running, let&#8217;s review what all we did aside from removing a lot of extra stuff.</p>
<ul>
<li>We declared a byte for each GUI element.</li>
<li>We added initialization code.</li>
<li>We added a declaration in the main loop to handle events from the UI to point to our function</li>
<li>We wrote a function that did something based on the events we had given it.</li>
<li>We updated GUIBase with the element count so that the GUI code knew how much it had to work with.</li>
</ul>
<p>These are the fundamental steps for creating a UI with the propeller using the GUIBase code. Now that you understand the basics as far as what is required, let&#8217;s take a look at some other stuff you can do too.</p>
<h1>Looking further into the GUI Code</h1>
<p>In the GUIBase.spin file, you can find the code required to draw the various elements of your GUI.  Reading through the code,  most of the options required are in terms of position.  For example, the code for the simple box (window) shown earlier, required an X and Y coordinates (in rows/cols) to place the upper left hand corner of the UI, then the width and length of the box and a title.  The Checkboxes each required an X and Y coordinate, then a text length and finally a label.</p>
<p>If we were to use a Radio Button group, we would need to provide an X and Y coordinates, a text length, a text label and a Group ID.  The Group ID is used to associate the radio buttons together.  Below is a screenshot of my implementation along with an Apply button:</p>
<div id="attachment_702" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-702" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/pushbuttoncode/"><img class="size-medium wp-image-702" title="Radio Buttons and Pushbutton code" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PushbuttonCode-300x81.jpg" alt="Radio Buttons and Pushbutton code" width="300" height="81" /></a><p class="wp-caption-text">Radio Buttons and Pushbutton code</p></div>
<p>In the above code, you can see that I have established five radio buttons (RADIO1 to RADIO5) in addition to PUSHBTN1 pushbutton. These are set up in the main loop below:</p>
<div id="attachment_703" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-703" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/pushbuttoncodeandfunctions/"><img class="size-medium wp-image-703" title="Push Button UI Code and Functions" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/PushButtonCodeandFunctions-300x252.jpg" alt="Push Button UI Code and Functions" width="300" height="252" /></a><p class="wp-caption-text">Push Button UI Code and Functions</p></div>
<p>In the above code, you can see that the SetLEDStorage passes a number which gets stored in LEDState. When the Apply button is pressed, CommitLEDs takes LEDState and sets the six LEDs to the binary value of whatever was in it.  Below is what the UI looks like:</p>
<div id="attachment_704" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-704" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2011/"><img class="size-medium wp-image-704" title="Radio Button GUI" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2011-300x225.jpg" alt="Radio Button GUI" width="300" height="225" /></a><p class="wp-caption-text">Radio Button GUI</p></div>
<p>Just like adding the checkboxes, I followed those same steps here:</p>
<ul>
<li> &#8211; I declared my additional UI elements&#8217; GUID bytes (RADIO1 to RADIO5), my Radio Button group (RBGID1), my  pushbutton (PUSHBTN1) and my LEDState variable.</li>
<li> &#8211; I added my init code (setting LEDState to 0, not pictured)</li>
<li> &#8211; I added routines for my elements to call user functions. (SetLEDStorage and CommitLEDs)</li>
<li> &#8211; I declared the routines so that they did something (stored the LED value, applied the value to the first six I/O pins)</li>
<li> &#8211; I updated GUIBase.spin with the new list of items ( added five radiobuttons and one pushbutton.)</li>
</ul>
<p>Give the code a try and you will see that while the checkboxes set the LED state instantly, the radio buttons do nothing until they are applied with clicking on the Apply button. This is important because as you design your GUI, you will need to decide if something must happen when the mouse is clicked right then (immediate action) or if the action will get applied later on via an &#8220;Apply&#8221; button. This is entirely up to you and there is no need to do things only one way.  Either method works but whether or not it works properly for your application will be your choosing.</p>
<h1>Tips and Tricks, and things to watch out for</h1>
<p>While developing this article, there were a couple of things I came across that you may want to watch out for. Don&#8217;t worry, you won&#8217;t blow up your Prop if you make a mistake in coding, however there are a few things you may want to keep an eye on:</p>
<ul>
<li>- Load to RAM, load to RAM, load to RAM and check your battery.<br />
In my writing this article, I found out real quick that driving a display, mouse and full size keyboard will drain a 9V transistor battery very quick.  A symptom of this drain is the Green LED that is present on the Propeller Education Kit. If it starts to pulse and your monitor loses sync, it&#8217;s time for a new 9V or consider a 5V USB power cord. Also, to save write cycles on the EEPROM, load to RAM whenever possible. Your computer&#8217;s hard  drive is more suited to incremental saves, EEPROMs are not.  Only save to EEPROM when you are ready to test your application in real life.</li>
<li>- There is no boundary checking.  If you overlap your windows, then there is no going back. When in doubt, you can use the Mouse code to print the mouse coordinates on your project to help you identify and troubleshoot positioning.  Remember that all GUI elements start by defining the upper left hand corner of the element. You will need to include the NUMS object (SimpleNumbers.spin) and the code from the original GUIDEMO.spin (lines 314 to 316) in order to have it show up.  You can see an example of the boundary overlap in the below image.</li>
</ul>
<div id="attachment_705" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-705" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2012/"><img class="size-medium wp-image-705" title="Button overlaps window" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2012-300x225.jpg" alt="Button overlaps window" width="300" height="225" /></a><p class="wp-caption-text">Button overlaps window</p></div>
<ul>
<li>- There is no off-edge boundary checking either.  If you are setting a text field too far right of the video display or too far down, it will get cut off and your entire GUI will not work right.  In this case, I set the Predefines window to X40,Y75 and 25 columns wide which was out of the limits of the current VGA resolution.  The below image was the result and my UI only partially worked.  Resetting and reloading RAM fixed it.</li>
</ul>
<div id="attachment_706" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-706" href="http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/dscf2013/"><img class="size-medium wp-image-706" title="Window moved out of range" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/11/DSCF2013-300x225.jpg" alt="Window moved out of range" width="300" height="225" /></a><p class="wp-caption-text">Window moved out of range  </p></div>
<ul>
<li>- Also as demonstrated in the image above, UI elements are not bound to the window you create them under. Assuming that both windows were same size and I mis-typed the coordinates, the Apply button could very easily show up under the checkboxes instead of the radio buttons leading to a confusing display.  You will want to make sure that your UI elements do not overlap at all as this could affect how the UI interprets your mouse actions.</li>
</ul>
<h1>Last Thoughts</h1>
<p>There is so much you can do with the Propeller UI to make your applications more interactive.  With little work, you could build something like a serial terminal and embed your project in an LCD monitor or you could make a basic home automation system with a touchscreen LCD and a wireless transceiver. The possibilities are endless and with the Propeller, you can now use full GUI capability with keyboard and mouse support.</p>
<p>As always, Happy Hacking!</p>
<p>FIRESTORM_v1</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 3785px; width: 1px; height: 1px;">http://www.yourwarrantyisvoid.com/2009/08/31/parts-parallax-vgadual-ps2-breadboard-adapter/</div>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2010/11/19/guidemo-a-full-vga-library-for-the-propeller/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dead Dockstar Resurrected with JTAG!</title>
		<link>http://www.yourwarrantyisvoid.com/2010/09/08/dead-dockstar-resurrected-with-jtag/</link>
		<comments>http://www.yourwarrantyisvoid.com/2010/09/08/dead-dockstar-resurrected-with-jtag/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 17:08:38 +0000</pubDate>
		<dc:creator>firestorm_v1</dc:creator>
				<category><![CDATA[Embedded devices]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Dockstar]]></category>
		<category><![CDATA[JTAG]]></category>
		<category><![CDATA[seagate]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.yourwarrantyisvoid.com/?p=595</guid>
		<description><![CDATA[The reason I haven&#8217;t written any more about my fun with the Dockstar was that due to an unfortunate set of circumstances I was left with a bricked dockstar. (read: I did something stupid.)  After performing a lot of research and thanks to a bunch of people over at the PlugApps.com Forum site who helped [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/Dead-Dockstar-plus-JTAG-equals-WIN.jpg"><img class="aligncenter size-full wp-image-594" title="Dead Dockstar plus JTAG equals WIN" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/Dead-Dockstar-plus-JTAG-equals-WIN.jpg" alt="Hey, I never said I was a graphics designer.  This was created in MS Paint after 15 minutes searching for a zombie icon and a JTAG icon or an angel I could slap JTAG over. " width="473" height="76" /></a></p>
<p>The reason I haven&#8217;t written any more about my fun with the Dockstar was that due to an unfortunate set of circumstances I was left with a bricked dockstar. (read: I did something stupid.)  After performing a lot of research and thanks to a bunch of people over at the <a href="http://plugapps.com/forum" target="_blank">PlugApps.com Forum site</a> who helped me, I was able to get it running.  Read more for a complete list of what you will need including how to build an adapter and where to get the needed JTAG kit.<span id="more-595"></span></p>
<h2>Before we begin</h2>
<p>This document demonstrates how to recover your Dockstar and upload a custom bootloader to it using a JTAG cable.  JTAG is used for low-level in-circuit debugging of embedded applications and is very hardware specific. If you are familiar with working with Linksys routers and uploading custom firmware to them, you have heard of the term bricking and you have more than likely heard of something called JTAG that is used to recover it.</p>
<p>Because of the nature of JTAG and the fact that manufacturers don&#8217;t typically like us having access to the JTAG port, these ports are often hidden in many different locations, usually unmarked or unpopulated headers, or other odd locations and is the way that the manufacturer loads the firmware for the very first time on to a new device.</p>
<p>By using JTAG, we can place the hardware into a &#8220;debug&#8221; mode where we can manipulate the microprocessor&#8217;s core functionality.  We can also send instructions to it, monitor responses from it, or even pause the chip, leaving it in a state of suspended animation until we issue the command to start it up again or reset the device.</p>
<p>In this particular howto, we will cover how to use the debug mode of the Marvell chip in the Dockstar to upload a new boot loader in order to rewrite the bootloader to the onboard Flash which will result in a working, new Dockstar.  Please note that if you have NOT bricked your dockstar, there is no need to perform the steps in this howto.  This is only for bricked dockstars that have been verified with a serial adapter to be dead. (A dead dockstar will produce NO serial output and the front panel LED will not light up when power is applied.)</p>
<h2>Legal Disclaimer</h2>
<p>By performing the steps outlined in this document, you agree not to hold firestorm_v1, YourWarrantyIsVoid.com or any other linked sites, forums, companies, liable if you really screw something up.  You can also not hold any of these entities responsible for data loss, physical damage, emotional trauma, spousal abuse or any other act of whatever god(s) that you may have happen to you.  In short, Read twice, type once, hit enter and don&#8217;t screw up.  If you&#8217;re at this point, then you&#8217;ve already come to terms that your dockstar may be unrecoverable already so deal with it.</p>
<h2>Parts List</h2>
<p>In order to perform this recovery, you will need the following items:</p>
<ol>
<li>The dead seagate dockstar and power supply.</li>
<li>A handful of 2.0mm female connectors or one 2.0mm female connector with at least 10 pins (5 pins in 2 rows)</li>
<li>A 10 pin header that matches your PCB 2.5mm spacing  (again, 5 pin, 2 row)</li>
<li>A bit of holed PCB board 2.5mm pin spacing. (Radio Shack is good for this kind of stuff)</li>
<li>A CA-42 cable with the appropriate pins as <a href="http://www.yourwarrantyisvoid.com/2010/07/21/seagate-dockstar-add-an-accessible-serial-port/" target="_blank">outlined in my previous Dockstar post</a>.</li>
<li>A handful of extra breadboard jumpers.</li>
<li>Superglue</li>
<li>A Windows PC (2k or XP, untested on vista/7 although plugapps forums says it should work.) with a Parallel Port</li>
<li>Whatever provisions needed for the CA-42 cable to work properly.  (I have to use a linux box to SSH to, you can do the same or if your Windows computer works with the CA42 cable, you can use that as well.  You don&#8217;t need two PCs for this operation.)</li>
<li>A TAIO Buffered/Unbuffered &#8220;Universal&#8221; Parallel Port JTAG module kit (<a href="http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&amp;item=270528612875" target="_blank">Here&#8217;s the eBay seller where I got mine, ~$21.00 out the door</a>) and a Parallel cable extension (Male to Female) so that you can reach it without having to get behind your PC. For my setup, I used an old iomega Parallel/SCSI Zip drive cable. I also recommend the ebay link as this is the seller that I purchased mine from and it comes with a lot of extra jumpers that are very useful for this project.</li>
<li>A USB A to USB mini B cable (for powering up the JTAG adapter).</li>
<li>Glue gun with extra gluesticks</li>
<li>Heatshrink tubing and lighter/heat source</li>
<li>In lieu of building/reinforcing your JTAG cable, you can use a laptop hard drive adapter (3.5 IDE to 2.5IDE) if you&#8217;re in a pinch and just need to get it running.</li>
</ol>
<p>In addition to the above items, you will need the following software applications:</p>
<ol>
<li><a href="http://www.plugapps.com/forum/download/file.php?id=20" target="_blank">Kragorn&#8217;s copy of dockstar.cfg</a> &#8211; <a href="http://www.yourwarrantyisvoid.com/downloads/files/dockstar.zip" target="_blank">Mirrored Here</a></li>
<li><a href="http://www.freddiechopin.info/index.php/en/download/category/4-openocd" target="_blank">A copy of OpenOCD</a> &#8211; <a href="http://www.yourwarrantyisvoid.com/downloads/files/openocd-0.4.0.zip" target="_blank">Mirrored Here</a></li>
<li>A copy of the <a href="http://jeff.doozan.com/debian/uboot/uboot-original-mtd0.kwb" target="_blank">Jeff Doozan&#8217;s custom USB-boot capable u-boot</a> (Recommended!) (<a href="http://www.yourwarrantyisvoid.com/downloads/files/uboot-original-mtd0.kwb" target="_blank">Mirrored Here</a>) or a copy of another factory or custom uBoot.  If you want to compile your own, there&#8217;s a great write-up here: <a href="http://jeff.doozan.com/debian/uboot/" target="_blank">http://jeff.doozan.com/debian/uboot/</a></li>
<li>A copy of PuTTY for Serial/Telnet communication.  You can <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">download it here</a>.</li>
</ol>
<h2>Getting Started</h2>
<p>This howto will be divided up into several sections:</p>
<p><strong>Section I:</strong>Building an adapter cable &#8211; This section will cover how to build the required cable from spare 2MM connectors or if you already have the proper cable, this will describe how to reinforce it for repeated use using heatshrink tubing. I call it a smokestack cable because it resembles a small smokestack sticking out of the Dockstar&#8217;s mainboard.</p>
<p><strong>Section II:</strong> Wiring it all up &#8211; This will cover the Dockstar&#8217;s pinout, the TAIO parallel port pinout, the serial port pinout and how to wire it up together.</p>
<p><strong>Section III:</strong> Performing the JTAG recovery &#8211; This is where the actual recovery process takes place now that we have everything wired up.</p>
<p><strong>Section IV:</strong> Notes and credits &#8211; As much as I&#8217;d like to say this was all my doing, truth is it&#8217;s not.  I couldn&#8217;t have done it without some great people from the PlugApps forums.</p>
<p>Each section will have lots of pictures that you can use as a guide to make sure you&#8217;re making the right connections.</p>
<h2><span style="color: #ff0000;"><em><span style="text-decoration: underline;"><strong>BIG FAT OBNOXIOUS WARNING!!!</strong></span></em></span></h2>
<p>Although there are as many JTAG adapters on the market as there fish in the sea, I can not cover each and every device&#8217;s unique configuration options. Generally the JTAG port is a universal standard but many vendors implement their own standard, have other standards that they choose to leave out and their pin configurations may not match what is given here.  This article is based on my experience performing the JTAG restoration of a dockstar I broke using the equipment and the software outlined above.  If you are new to JTAG, I recommend using the versions and adapter board listed as other devices/software may not work in the same way.  When in doubt, go with what you know!</p>
<h2>Section I: Building out the JTAG adapter cable.</h2>
<p>The dockstar&#8217;s JTAG port uses a 2.0 mm spacing and while it&#8217;s good for tight spaces, isn&#8217;t exactly ideal when dealing with breadboard jumpers as most breadboards have a 2.5mm spacing and the jumpers have connectors to match.  In this instance I felt that since I was going to be working on actually developing code for the Dockstar, the inevitable would happen and I would end up bricking it through a random error (namely user failure) and would need a quick and reliable connector that I could use to quickly connect and disconnect the JTAG port as needed during restore and development.</p>
<p>I checked out EPO and managed to find several 2.0mm spaced connectors however these were in groups of three and while they would work, would require significant effort to harden the connectors to something that could stand the test of repeated connections and disconnections. So let&#8217;s get started.</p>
<div id="attachment_611" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/conntest.jpg"><img class="size-medium wp-image-611" title="Connector Test" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/conntest-300x225.jpg" alt="Connector Test" width="300" height="225" /></a><p class="wp-caption-text">Checking the connectors to make sure they would work</p></div>
<p>This is a shot of the connectors standing out of the Dockstar.  Since I had four connectors with 3 pins each, this means that I had two pins that hung over the connector block on the Dockstar.  Since these two wires were not needed, I cut them and removed the metal connector from inside the plastic, leaving 10 wires for 10 pins of the dockstar&#8217;s JTAG port.  We&#8217;ll deal with the two vacant holes later.</p>
<p><strong>Little known fact:</strong> The pin spacing on the Dockstar&#8217;s JTAG port is identical to that of a laptop hard drive (which is why this part of the process is optional.)  In a pinch, you can use a laptop IDE adapter similar to <a href="http://www.geeks.com/details.asp?invtid=HD-108&amp;cat=CBL" target="_blank">this one</a> (in fact I own several exactly like this).  If you decide to use a laptop IDE adapter, use the part of the adapter <strong>opposite the power connector</strong>.</p>
<p>Since the goal is to harden the four little connectors to one single connector, I used a dead laptop hard drive and superglued the four connectors together. <strong>USE THE SUPERGLUE SPARINGLY!!</strong> You do not want to superglue your connectors to a hard drive so only put a tiny amount. It also helps to put a dab of glue on one connector, then put the connectors together as you&#8217;re pushing them onto the laptop HD pins.  Make sure they are completely seated so they will be even as possible.  If you see the pins of the laptop HD, you&#8217;re not down far enough.</p>
<div id="attachment_612" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/connglue.jpg"><img class="size-medium wp-image-612" title="Glued 2.0MM connectors" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/connglue-300x225.jpg" alt="Glued 2.0MM connectors curing on a laptop HD." width="300" height="225" /></a><p class="wp-caption-text">Glued 2.0MM connectors curing on a laptop HD.</p></div>
<p>Once you get all four connectors onto the laptop HD and properly aligned, let it cure for at least an hour.  This will ensure that the superglue bonds correctly and the connector doesn&#8217;t fall apart later.</p>
<div id="attachment_613" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/glueset.jpg"><img class="size-medium wp-image-613" title="Glued connectors after setting." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/glueset-300x225.jpg" alt="Glued connectors after the superglue set." width="300" height="225" /></a><p class="wp-caption-text">Glued connectors after the superglue set.</p></div>
<p>Now that the superglue has set, check that it still fits in the Dockstar. On the connectors used here, my wires were quite long. To alleviate yet another mass of cable snakes on my desk, I cut them down to about three inches, which should be big enough to handle, but small enough to not get in the way. You can cut your wires to any length desired.</p>
<p>In order to solder to the 10 pin header and ensure that the wires would not seperate from use, I chose to use a small piece of PCB as shown below.</p>
<div id="attachment_614" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrbb.jpg"><img class="size-medium wp-image-614" title="Header and Breadboard" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrbb-300x225.jpg" alt="Header and Breadboard" width="300" height="225" /></a><p class="wp-caption-text">Header and Breadboard</p></div>
<p>Keep in mind that if you cut your own, you&#8217;re soldering 10 wires into a 10 pin header, so you will need a 20 hole piece of PCB (5 holes by 4 holes).  The idea here is that the wires will come in on the component side of the PCB and wrap around it then go further down to the 2.0mm connector we just glued together.   Go ahead and solder the header into the center two rows of the PCB as shown below(Leave one row of 5 on each side of the header).</p>
<div id="attachment_615" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrinst.jpg"><img class="size-medium wp-image-615" title="Header and PCB soldered together" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrinst-300x225.jpg" alt="Header and PCB soldered together" width="300" height="225" /></a><p class="wp-caption-text">Header and PCB soldered together</p></div>
<p>Strip off a 1/8 inch off of each wire on one side of the glued connector and solder to the PCB. Keep your pinout the same and do not cross the wires.   Below, you can see that the first half of the PCB and the wires has been soldered.</p>
<div id="attachment_616" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrsolder.jpg"><img class="size-medium wp-image-616" title="Header with one side soldered" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrsolder-300x225.jpg" alt="Header with one side soldered" width="300" height="225" /></a><p class="wp-caption-text">Header with one side soldered.</p></div>
<p>Now comes the fun part.  Trying to solder the other side of the PCB without burning yourself or the other wires and without creating unnecessary solder bridges to other pins.  Below is a shot of my connector, partially soldered.</p>
<div id="attachment_617" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrsolder2.jpg"><img class="size-medium wp-image-617" title="Second set of wires to solder" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrsolder2-300x225.jpg" alt="Second set of wires to solder" width="300" height="225" /></a><p class="wp-caption-text">Second set of wires to solder</p></div>
<p><strong>Protip:</strong> If you don&#8217;t already have a pair, I highly recommend you get a pair of Helping Hands for soldering like this. <a href="http://www.radioshack.com/product/index.jsp?productId=3928375&amp;CAWELAID=437363031" target="_blank">Available at Radio Shack</a> and many other electronics outlets.  Below is a picture of the completely soldered PCB.</p>
<div id="attachment_618" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrdone.jpg"><img class="size-medium wp-image-618" title="Completed PCB soldering" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrdone-300x225.jpg" alt="Completed PCB soldering" width="300" height="225" /></a><p class="wp-caption-text">Completed PCB soldering</p></div>
<p>Now that the PCB is soldered, go ahead and check your wiring!  Don&#8217;t do any pin swaps, make sure that pin 1 on the 2.0mm connector is pin 1 on the header, pin2 on the 2.0mm connector is pin 2 on the header and so on. Also make sure that you didn&#8217;t bridge between pins on the PCB. Before you slip on the shrinkwrap, we&#8217;re going to reinforce the body of the adapter.  Get your hot glue gun ready and shoot a large bead of glue down the length of the wire. Once that is done, shoot some more hotglue around the connector to reinforce the wires coming out of the connector. Below is a picture of the hotglue process.</p>
<div id="attachment_620" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrhg.jpg"><img class="size-medium wp-image-620" title="Header hotglued" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrhg-300x225.jpg" alt="Wires hotglued together and header is wrapped in hotglue." width="300" height="225" /></a><p class="wp-caption-text">Wires hotglued together and header is wrapped in hotglue.</p></div>
<p>The hotglue on the wire-side of the plug will make sure that the wires don&#8217;t wiggle around inside the heatshrink tube and fail later on.  After you&#8217;ve properly applied the hot glue, put the tip of the hotglue gun over the two holes that we vacated earlier.  Keep consistent pressure on the hotglue gun and press the trigger.  This will inject hot glue into the holes left behind when the excess pins were extracted and ensure that the connector is &#8220;keyed&#8221; and will prevent a one-off connection (and prevent further headache).  This is what the hotglue injected connector looks like.</p>
<div id="attachment_621" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrkey.jpg"><img class="size-medium wp-image-621" title="Key-glued header" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrkey-300x225.jpg" alt="Key glued header." width="300" height="225" /></a><p class="wp-caption-text">Key-glued header.</p></div>
<p>Take one moment and check your cable one last time.  Make sure that the pins are wired one to one.  Once you&#8217;re ready, get the heatshrink tube and cut it to a little bit less than the length of your adapter.  Below, you can see the heatshrink and adapter lengths I used. (This image was taken before the hot glue was applied.)</p>
<div id="attachment_622" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrswrap.jpg"><img class="size-medium wp-image-622" title="Header adapter and shrinkwrap." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrswrap-300x225.jpg" alt="Header adapter and shrinkwrap." width="300" height="225" /></a><p class="wp-caption-text">Header adapter and shrinkwrap.</p></div>
<p>Slip over the heatshrink wrap over the connector (it may not fit over the PCB) and leave just a little bit so that it overlaps the 2MM connector end.  Apply even heat to the 2MM connector end first so that it will shrink and hold the heatshrink wrap in place as you apply even heat to the rest of the connector. When completed, you should have a connector resembling the below image.</p>
<div id="attachment_623" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrtop.jpg"><img class="size-medium wp-image-623" title="Heatshrink wrapped adapter." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrtop-300x225.jpg" alt="Heatshrink wrapped adapter." width="300" height="225" /></a><p class="wp-caption-text">Heatshrink wrapped adapter.</p></div>
<p>Now take the hotglue gun and fill in the gap between the heatshrink wrap and the bottom of the PCB. If your gluegun has a fine tip, also shoot some hot glue into the open end of the shrinkwrap.  This will further harden the connector and ensure that it doesn&#8217;t flex and damage the connections.  You may have something looking like the below image.</p>
<div id="attachment_624" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrtopgl.jpg"><img class="size-medium wp-image-624" title="Header Top glue bead" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/hdrtopgl-300x225.jpg" alt="Header Top with glue bead." width="300" height="225" /></a><p class="wp-caption-text">Header Top with glue bead.</p></div>
<p>For a final touch, wrap and distribute hot glue around the wiring from a little bit over the heatshrink wrap all the way to the black part of the header wiring.  It&#8217;s ok to use a large amount of glue as this will make sure that the connector is properly protected.  As a last step, connect it to the Dockstar and make sure it fits.  Once finished, you should have something resembling the below image.</p>
<div id="attachment_625" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/smokestack.jpg"><img class="size-medium wp-image-625" title="Completed Smokestack adapter on Dockstar." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/smokestack-300x225.jpg" alt="Completed Smokestack adapter on Dockstar." width="300" height="225" /></a><p class="wp-caption-text">Completed Smokestack adapter on Dockstar.</p></div>
<p>Now, you have a completed Smokestack adapter.  You can use this for any device that has 2.0MM connector pitch and for any purpose.  Since the header on top is a 1 to 1 representation of the connector on bottom, you can use this anywhere where you need to use breadboard connectors for a temporary connection to these headers.</p>
<h2>Section 2: Wiring it all up.</h2>
<p>With a completed smokestack adapter, now you can wire it all up together  but before we begin, it is highly recommended to solder in a ground pin.  This ground pin will be used to ensure that the ground used by the JTAG adapter&#8217;s reference ground will be the same as the ground used by the Dockstar.  While it may not be required, it is recommended as a difference in ground may end up corrupting data being sent and received as part of the update.  To do that, we can use any of the ground planes, shields or open spots on the PCB.  I preferred to use one of the three USB shields as the shield&#8217;s purpose is the same as the GND connection that we are trying to establish.  For this, we&#8217;ll use a jumper pin with no plastic on it.  Start off by applying a small bead of solder to the USB shield as shown below.</p>
<div id="attachment_627" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dsgnd.jpg"><img class="size-medium wp-image-627" title="Dockstar USB shield prep for pin" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dsgnd-300x225.jpg" alt="Dockstar USB shield pin prepped for header pin." width="300" height="225" /></a><p class="wp-caption-text">Dockstar USB shield pin prepped for header pin.</p></div>
<p>Apply the heat from the soldering iron to the bead again and drop in the jumper pin.  Remove heat and do not touch the jumper pin until the connector has cooled.  Do not apply heat for a long period of time otherwise you may damage the USB port itself.  Below is the completed ground pin installation:</p>
<div id="attachment_628" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dsgndpin.jpg"><img class="size-medium wp-image-628" title="Dockstar Ground pin installed." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dsgndpin-300x225.jpg" alt="Dockstar Ground pin installed." width="300" height="225" /></a><p class="wp-caption-text">Dockstar Ground pin installed.</p></div>
<p>Now, we have a properly installed Ground pin that is easy to connect and remove and we also have our smokestack JTAG adapter.  At this point, we can start wiring up the JTAG connector up and prepare for recovery of our dead dockstar.  If you went with my suggestion and ordered the TIAO Parallel JTAG adapter, you should have received the following items.  JTAG board (blue with DB25 connector), Short jumpers (left of  JTAG board) and Long Jumpers (above board) as shown in the picture below.</p>
<div id="attachment_626" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/JTAGkit.jpg"><img class="size-medium wp-image-626" title="JTAG kit" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/JTAGkit-300x225.jpg" alt="TIAO Parallel JTAG kit." width="300" height="225" /></a><p class="wp-caption-text">TIAO Parallel JTAG kit.</p></div>
<p>The below image is the entire wiring diagram for the Dockstar JTAG adapter.  As long as you keep pin 1 on the dockstar as pin 1 on the smokestack adapter, you should have no problems with the connection.  As mrbill and Klingon and several others pointed out in the PlugApps forums, the nSRST line (orange) and the DINT(purple) leads are both not connected.  Pin 1 on the Dockstar/Smokestack are also left unconnected as we will use the Dockstar&#8217;s power supply to power the board while it is connected to the JTAG adapter.  Additionally, it is crucial to plug the USB cable into the JTAG adapter and into a PC to power the onboard buffer chip.  Without the USB cable connected, the adapter will not function.  There is also an LED on the JTAG adapter that will light when the device has sufficient power. Click on the below image to get a much larger image.</p>
<div id="attachment_629" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dockstarjtag.jpg"><img class="size-medium wp-image-629" title="Dockstar/TAIO JTAG connection table." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/dockstarjtag-300x185.jpg" alt="Dockstar/TAIO JTAG connection table." width="300" height="185" /></a><p class="wp-caption-text">Dockstar/TAIO JTAG connection table.</p></div>
<p>The Dockstar layout diagram on the right hand side of the image is bundled together to provide a reference.  Pin 1 of the JTAG port is on the LED side of the jumper and is towards the center of the board and is designated by a black dot in the image and a white triangle on the dockstar board itself as shown below.  The picture of the Dockstar is rotated 90 degrees clockwise to the layout diagram in the image above.</p>
<div id="attachment_630" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSJTAGport.jpg"><img class="size-medium wp-image-630" title="Dockstar JTAG port showing pin 1" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSJTAGport-300x225.jpg" alt="Dockstar JTAG port showing pin 1" width="300" height="225" /></a><p class="wp-caption-text">Dockstar JTAG port showing pin 1</p></div>
<p>You can use the following images as a reference that your dockstar is connected properly.  The below image is a picture of my CA-42 adapter&#8217;s serial header as discussed in the <a href="http://www.yourwarrantyisvoid.com/2010/07/21/seagate-dockstar-add-an-accessible-serial-port/" target="_blank">serial port post</a>. Also, since the serial port post discussed soldering to the header, if you haven&#8217;t done so already, remove the existing serial port wires so that your smokestack adapter will fit.  In the image below, the three jumpers coming off of the pins are colored as they would be if you had just cut and stripped back the CA-42&#8242;s cable. Remember that your CA-42 cable may be different!</p>
<div id="attachment_636" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0705.jpg"><img class="size-medium wp-image-636" title="Serial Port jumpers from CA42 USB cable." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0705-300x225.jpg" alt="Serial Port jumpers from CA42 USB cable." width="300" height="225" /></a><p class="wp-caption-text">Serial Port jumpers from CA42 USB cable.</p></div>
<p>The below image shows the top of the smokestack adapter and the respective colors.  You can see that the black wire for GND is attached to the USB shield pin we installed earlier. Remember, pin 1 and pin 7 on the smokestack are left not connected!</p>
<div id="attachment_637" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0700.jpg"><img class="size-medium wp-image-637" title="Top of smokestack adapter with jumpers." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0700-300x225.jpg" alt="Top of smokestack adapter with jumpers." width="300" height="225" /></a><p class="wp-caption-text">Top of smokestack adapter with jumpers.</p></div>
<p>The below image shows the JTAG adapter, properly wired and ready to go.  You can see the device is powered by the USB connector and that the orange and purple wires have been spared off.   Although the flash from my camera drowned out the red power LED, you will need to make sure that your LED is lit.  Please note, the JTAG adapter does require power however it will not show up as anything in Windows as we are using the USB port strictly for the power lines for the JTAG buffer.</p>
<div id="attachment_638" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0701.jpg"><img class="size-medium wp-image-638" title="TIAO JTAG wired up and ready." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0701-300x225.jpg" alt="TIAO JTAG wired up and ready." width="300" height="225" /></a><p class="wp-caption-text">TIAO JTAG wired up and ready.</p></div>
<p>An aerial view of the whole mess. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />     Yes, I know my desk is still messy.</p>
<div id="attachment_639" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0708.jpg">C:\Program Files\OpenOCD\0.4.0<img class="size-medium wp-image-639" title="Wow, what a rats nest!" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/DSCF0708-300x225.jpg" alt="Wow, what a rats nest." width="300" height="225" /></a><p class="wp-caption-text">Wow, what a rats nest.</p></div>
<p>Now that all of the required connections have been made, it&#8217;s time to get busy with the software. Plug in the power cable to your dockstar and proceed to the next section.</p>
<h2>Step III: Software</h2>
<p>If you haven&#8217;t already, go back up to the Parts list and download Kragorn&#8217;s dockstar.cfg, OpenOCD and the uBoot image.</p>
<p>Install the OpenOCD software and accept the defaults.  Once completed, unzip the dockstar.zip and copy dockstar.cfg to C:\Program Files\OpenOCD\0.4.0\board and then copy your uboot image to C:\Program Files\OpenOCD\0.4.0  It would be recommended to rename it to just &#8220;uboot.bin&#8221; so that way you won&#8217;t have to retype that complicated line later on.</p>
<p>Now that we have all the proper software in place let&#8217;s discuss what all is going to happen.  When you start OpenOCD in a DOS window, it will in turn start a telnet server on localhost, port 4444.  You will use PuTTY to connect to the telnet server process and issue commands to OpenOCD.   In conjunction with that, you will need a second PuTTY session established to COM1 (if your windows machine has the CA-42 cable plugged into it) or to SSH to the machine you have the cable connected to. The reason is that once you enter specific commands on the telnet window, you need visibility to the other window (serial or SSH) to see if your dockstar is booting. <span style="text-decoration: underline;"><em><strong>Timing is critical!</strong></em></span> From here on out, commands and things to look for in output are in <strong>bold</strong> with other important text in bold, italics and underline.</p>
<p>In my configuration, my windows computer is what will run OpenOCD and the telnet session, and a nearby Linux box will have the SSH session with an application called minicom.</p>
<p>Start off by opening a DOS window (Start -&gt; Run -&gt; &#8220;cmd&#8221; )</p>
<p>Type the following command in exactly as shown:  <strong> </strong></p>
<pre><strong>openocd -f board/dockstar.cfg</strong></pre>
<p>You should get output similar to the below image.  If you get what I have, then you can proceed to the next step.  If you get any errors, check your wiring. Make sure only those pins shown in the above images are what you have hooked up. Also, you may get a  Windows Firewall exception error.  If you do, just hit &#8220;Allow&#8221; otherwise you won&#8217;t be able to talk to OpenOCD.</p>
<div id="attachment_640" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/OpenOCD-1.jpg"><img class="size-medium wp-image-640" title="OpenOCD successful startup" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/OpenOCD-1-300x148.jpg" alt="OpenOCD successful startup." width="300" height="148" /></a><p class="wp-caption-text">OpenOCD successful startup</p></div>
<p>If OpenOCD is running without errors, minimize the DOS box and start PuTTY. Use the below configuration to establish a connection to the telnet process that OpenOCD started.</p>
<div id="attachment_644" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/puttytelnet.jpg"><img class="size-medium wp-image-644" title="PuTTY Telnet settings" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/puttytelnet-300x286.jpg" alt="PuTTY Telnet settings" width="300" height="286" /></a><p class="wp-caption-text">PuTTY Telnet settings</p></div>
<p>When you connect, you should get a window that says &#8220;<strong>Open On-Chip Debugger</strong>&#8221; with a caret &#8220;&gt;&#8221; prompt.  Before we continue, if you haven&#8217;t already pulled up your serial session to the dockstar, you will need to do that now.  The issue is that from here on out, we will either be communicating with OpenOCD via Telnet, or communicating with the Dockstar via serial.</p>
<p>Now that you&#8217;ve established your connection to OpenOCD, perform the next two steps.</p>
<ul>
<li>Type the command <strong>&#8220;init&#8221;</strong> into the telnet session and hit enter.</li>
<li>Type the command <strong>&#8220;sheevaplug_init</strong>&#8221; into the telnet session and hit enter.</li>
</ul>
<p>Now, here is the hard part. The routine sheevaplug_init from above will attempt to halt the processor.  The Marvell chip has two types of halt, one of which labelled &#8220;ARM&#8221; and one labelled &#8220;Thumb&#8221;.  If your output resembles the below output (processor halted in <strong>Thumb</strong> state), you will need to perform the next steps otherwise skip down to the next section. When in doubt,  continue with the instructions below.</p>
<div id="attachment_645" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/Thumbstatehalt.jpg"><img class="size-medium wp-image-645" title="Thumb State Halt is no good!" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/Thumbstatehalt-300x186.jpg" alt="Thumb State Halt is no good!" width="300" height="186" /></a><p class="wp-caption-text">Thumb State Halt is no good!</p></div>
<p><strong>If you got <em>&#8220;Target halted in Thumb State&#8221;</em></strong>: There is some additional trickery that must be performed.   The issue is that the processor must be halted in ARM state as this allows OpenOCD to communicate with the processor properly.</p>
<ul>
<li>Hit Ctrl-C in your OpenOCD session. Your PuTTY session will break and generate an error. Dismiss the error and restart OpenOCD.</li>
<li>Hold down the reset button <span style="text-decoration: underline;"><strong>and keep it held down</strong></span> with one hand and with the other, type &#8220;<strong>sheevaplug_init</strong>&#8221; and hit enter.  Ignore the error messages.</li>
<li> Type in the command &#8220;<strong>halt</strong>&#8221; . <em><strong>DO NOT HIT ENTER YET!</strong></em></li>
<li><em><span style="color: #ff0000;"><strong>Release the RESET switch and simultaneously hit Enter.</strong></span></em></li>
<li>You should see that the processor was halted in ARM state.
</li>
<li>Type in &#8220;<strong>sheevaplug_init</strong>&#8221; and hit enter. No output should be generated from this command.
</li>
</ul>
<p>Check your telnet session output with my output in the screenshot below.  Make sure your output matches the screenshot before proceeding.</p>
<div id="attachment_647" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/properhalt1.jpg"><img class="size-medium wp-image-647" title="Properly halted dockstar" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/properhalt1-300x186.jpg" alt="Properly halted dockstar" width="300" height="186" /></a><p class="wp-caption-text">Properly halted dockstar</p></div>
<p>Now for the ultimate test.  We need to probe the NAND flash to make sure that the processor can communicate with it. Type in &#8220;<strong>nand probe 0</strong>&#8221; (zero) and hit enter.  If everything is correct, you should get text returned similar to &#8220;<strong>NAND flash device &#8216;NAND 256MiB 3,3V 8-bit&#8217; found</strong>&#8220;.  If you get any other message <strong>ESPECIALLY</strong> anything about Unknown Manufacturer, restart OpenOCD and try again.  Here is my output so far:</p>
<div id="attachment_648" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/nandprobe0.jpg"><img class="size-medium wp-image-648" title="Nand Probe successful!" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/nandprobe0-300x186.jpg" alt="Nand Probe Successful!" width="300" height="186" /></a><p class="wp-caption-text">Nand Probe Successful!</p></div>
<p>Now that the processor has been correctly identified by OpenOCD and the processor has properly identified the flash memory, we can now load the image into the Dockstar&#8217;s RAM and tell the processor to execute it. Type in <strong>load_image uboot.bin 0&#215;800000</strong> (zero, letter x, 8 and five zeros). If you renamed your uboot file something other than &#8220;uboot.bin&#8221; then substitute as needed.  This will take a couple of minutes as the image is transferred. Here is the output of what I have after the image loaded into RAM:</p>
<div id="attachment_649" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/loadimage.jpg"><img class="size-medium wp-image-649" title="Load_Image successful!" src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/loadimage-300x186.jpg" alt="Load_Image successful!" width="300" height="186" /></a><p class="wp-caption-text">Load_Image successful!</p></div>
<p>When you get the caret prompt back &#8220;&gt;&#8221;, type in the command &#8220;<strong>resume 0&#215;800200</strong>&#8221; and check your serial connection for activity.  At this point, you can minimize the telnet session.  Now we will be dealing expressly with the serial connection.  Depending on your connection method, you may have a different window, but the text is the same.  As soon as you hit enter on the resume command, you should notice that the LED on your once dead dockstar is now blinking. Immediately switch over to the serial connection and hit a key to disrupt the boot process. If you did it right, you should see that the command prompt now shows <strong>Marvell&gt;&gt;</strong> as shown in the screenshot below:</p>
<div id="attachment_650" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/intboot.jpg"><img class="size-medium wp-image-650" title="Interrupted boot sequence." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/intboot-300x186.jpg" alt="Interrupted boot sequence." width="300" height="186" /></a><p class="wp-caption-text">Interrupted boot sequence</p></div>
<p><strong>DO NOT DISCONNECT POWER FROM THE DOCKSTAR YET! WE ARE NOT DONE.</strong> The Dockstar has successfully loaded and ran the uboot commands in RAM however if we hit the reset switch or powercycle the dockstar, the device will return to it&#8217;s zombie state, and we will have to do it all over again. The only thing left to do is to prepare and write the image to flash.</p>
<p>If you were like me and you accidentally typed in &#8216;nand erase&#8221; and bricked your dockstar, you will need to re-erase the flash to reload it.  If you bricked your dockstar by another method, skip this step and go on to the next paragraph. To do this, type in &#8220;<strong>nand erase</strong>&#8220;.  This will erase the entire flash chip.  Now to write the working uboot to flash, use the command &#8220;<strong>nand write.e 0&#215;800000 0&#215;0 0&#215;80000</strong>&#8220;  (zero x eight then 5 zeroes, zero x zero, then zero x eight then four zeros). You should get a message that the nand write was successful similar to the below screenshot.</p>
<div id="attachment_651" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/writeflash.jpg"><img class="size-medium wp-image-651" title="Successful flash write." src="http://www.yourwarrantyisvoid.com/wp-content/uploads/2010/09/writeflash-300x186.jpg" alt="Successful flash write." width="300" height="186" /></a><p class="wp-caption-text">Successful flash write.</p></div>
<p>If you did not brick your dockstar by an errant nand erase command, you will want to use &#8220;<strong>nand erase 0 0&#215;0 0xa0000</strong>&#8221; (zero, zero x zero, zero x a then four zeros).  The reason for this difference is that if you didn&#8217;t erase your flash, this command will preserve the u-boot environment variables, otherwise you would have to recreate them later on.</p>
<p>Now, it&#8217;s time for the moment of truth.  Don&#8217;t start disconnecting wires just yet, simply tap the reset switch to load the uboot from the flash and test your recovery.   You will notice two key things:  Your uboot will be stuck in a permanent loop (assuming you didn&#8217;t interrupt autoboot) and the LED on the dockstar will alternate between flashing green and flashing orange as uboot cycles through.  This is because the dockstar can&#8217;t find a valid kernel or filesystem to boot from.  If you used the same version of the uBoot I listed above then you will notice that this uboot will attempt to boot off of USB key drives unlike the original factory image which opens up a LOT of opportunity. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To clean up, simply exit the various windows you have open, and exit OpenOCD by hitting Ctrl-C.  Remove power from the Dockstar, then remove the smokestack adapter and the ground wire on the USB shield.  If you want to make sure (because you&#8217;re as paranoid as I am, reapply power after all the jumpers have been removed and make sure that the Dockstar&#8217;s LED continues to blink orange then blinks green and repeats.  This means that your dockstar is confirmed as running off it&#8217;s own flash.</p>
<p>Now get to hacking!</p>
<h2>Section IV: Notes and Credits</h2>
<p>This article was assembled using information and help from various sources.  I want to thank everyone listed below for your assistance in helping me with getting the Dockstar JTAG figured out.  It was definitely not easy for someone new to JTAG however it was an enjoyable learning experience once I got the bugs worked out,  even if I did scratch my head a lot.</p>
<p>From the PlugApps forums, I&#8217;d like to thank Admin, Kragorn, bzboi, klingon, ygator, mrbill, and jtagfun.</p>
<p>A special thanks to bzboi for the initial howto that most of the OpenOCD instructions were used from and to Admin for the starting post with the Dockstar&#8217;s JTAG diagram.</p>
<p>I&#8217;d also like to thank mrbill for getting me involved with these things. It&#8217;s all his fault that I even have a dockstar to break. <img src='http://www.yourwarrantyisvoid.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Thanks goes to Kragorn for finding out the proper settings in his dockstar.cfg so that all of us could unbrick after the inevitable &#8220;Oops&#8230;&#8221; moment.</p>
<p>Last, but not least, thanks goes out to Jeff Doozan for his work with uBoot and compiling in needed features into the bootloader so that we can use USB sticks as boot devices.</p>
<h2>Where do we go from here?</h2>
<p>The answer is &#8220;Where do you want to go?&#8221;  In my relatively short time with the Dockstar, I was working on getting OpenWRT compiled and installed on it.  OpenWRT is the same OS that they use for the Linksys and other branded routers and is pretty much it&#8217;s own distribution.  There are also processes on how to install Debian onto the dockstar, using a laptop drive and USB sled to run the OS.  There is a lot of people doing research and finding out other warranty voiding things to do with their dockstars so take a look around.</p>
<p>As far as me personally?  I have three of them and while one of them is going to be a small NAS fileserver, one of the more esoteric things I was planning on doing with mine is making it into a roving USB camera with wifi.  The idea is that the Dockstar&#8217;s mainboard would be the brains of the rover and could send commands to a Parallax BOE-BOT via a usb to serial converter.  Since the entire thing would be wireless off of a USB dongle, I could use the IP based connection to deliver video and commands via a custom written application.</p>
<p>I sincerely hope that you are able to recover your dockstar using the above process.  It&#8217;s no fun when you accidentally destroy something you have put so much work into however now you should be able to work on the Dockstar without fear that you&#8217;re going to damage it and prevent it from booting.  Also, if you decide to try custom boot loaders, you can do so worry free.</p>
<p>Happy Hacking!</p>
<p>FIRESTORM_v1</p>
<p><em> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourwarrantyisvoid.com/2010/09/08/dead-dockstar-resurrected-with-jtag/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

