{"id":93,"date":"2008-11-05T12:35:31","date_gmt":"2008-11-05T12:35:31","guid":{"rendered":"https:\/\/www.bishnet.net\/tim\/blog\/?p=93"},"modified":"2010-11-11T13:01:41","modified_gmt":"2010-11-11T13:01:41","slug":"a-new-router-soekris-draytek-and-nanobsd","status":"publish","type":"post","link":"https:\/\/www.bishnet.net\/tim\/blog\/2008\/11\/05\/a-new-router-soekris-draytek-and-nanobsd\/","title":{"rendered":"A new router (Soekris, Draytek and NanoBSD)"},"content":{"rendered":"<p>A few months back I wrote about <a href=\"https:\/\/www.bishnet.net\/tim\/blog\/2008\/06\/19\/ill-build-a-new-server-its-got-to-be-easier-than-patching-up-the-old-one\/\">building a new server<\/a>. It turned out to be more complicated than I thought, but 5 months on it&#8217;s still working well. Over the last few weeks I&#8217;ve been working on my next project &#8211; replacing my router.<\/p>\n<p>The old router was an old dual CPU Pentium 3 machine with a couple of small SCSI hard disks in it. It was a full tower case and took up a lot of room and made a lot of noise. And, surprisingly, the power consumption was pretty similar to the server I recently built (which has way more in it). It even still had the <a href=\"http:\/\/speedtouch.hysplace.co.uk\/images\/28_L.jpg\">original Speedtouch USB modem<\/a> that BT once gave to me. So it had to go.<\/p>\n<p>I spent quite some time deliberating the way forward. I could have gone for a domestic router like most other people do, but I&#8217;m a geek, and I like the flexibility of doing it myself. But at the same time, a small sized unit, with low power requirements, and no noise, is what I wanted. The solution came in the form of a <a href=\"http:\/\/www.soekris.com\/net5501.htm\">Soekris net5501<\/a>.<\/p>\n<p>I went for the net5501-70 which has a 500Mhz CPU and 512MB of RAM. Not a lot by today&#8217;s standards, but more than sufficient for what I needed. And incidently, it&#8217;s quicker than the old router. I got the model with a case, and got the mounting brackets for a hard drive (which although I don&#8217;t intend to use at this stage, it was cheaper to get it now than later). I also purchased a pair of <a href=\"http:\/\/www.sandisk.com\/Products\/Item(1182)-SDCFX3-004G-A31-SanDisk_Extreme_III_CompactFlash_4GB.aspx\">4GB SanDisk Extreme III Compact Flash<\/a> cards to run the thing from. It&#8217;s worth noting that Soekris recommend SanDisk CF cards, and they&#8217;re peanuts at play.com.<\/p>\n<p>The next point to consider was how to connect to the ADSL line. I could have stuck with the USB modem, but the drivers were aging, I wasn&#8217;t sure if it was the cause of the odd disconnections and failures to reconnect that I&#8217;d been getting. I looked at internal ADSL cards, but it seemed to be a bit of a gamble as to how they worked and if I&#8217;d be able to get the right drivers. In the end I settled on the <a href=\"http:\/\/www.draytek.co.uk\/products\/vigor110.html\">Draytek Vigor 110<\/a>.<\/p>\n<p>The Vigor 110 is basically just a PPPoA to PPPoE bridge. PPPoE isn&#8217;t widely used in the UK, but is in other parts of the world, so the support in FreeBSD was good (via ppp and the ng_pppoe module). It worked perfectly. It really was just a case of plugging it in and pointing ppp at it &#8211; no configuration required! And, just like the USB modem, it gives the router IP directly to the PC, so there&#8217;s no messing around to get that working either.<\/p>\n<p>Longer term I plan to fill the net5501&#8217;s PCI slot with a wireless card, but I haven&#8217;t decided which to go for yet. This would turn the unit in to my wifi access point as well, but for now I&#8217;ll just stick with the separate one. I&#8217;d welcome advice on cards that are supported by FreeBSD.<\/p>\n<p>So, that&#8217;s hardware all sorted. Next came the software. If you&#8217;ve been following my other posts you&#8217;ll know I&#8217;m a big fan of <a href=\"http:\/\/www.freebsd.org\/\">FreeBSD<\/a>, so it&#8217;s pretty clear what route I was going to take here. But given the use of CF cards I had to approach things differently. I also wanted to be able to power the system off without causing any filesystem problems, so this required the card to be mounted read-only.<\/p>\n<p><a href=\"http:\/\/www.freebsd.org\/doc\/en\/articles\/nanobsd\/article.html\">NanoBSD<\/a> to the rescue! NanoBSD is a script that builds an image containing FreeBSD that can be written directly to a CF card (or anything else, really). It&#8217;s customisable, and I wrote a few bits to pull down the packages I wanted, and to make some configuration tweaks. It has a read-only root filesystem on the card, and uses memory-backed filesystems for \/var and \/etc. Config is stored in a separate partition on the disk and is copied to the memory-backed \/etc during the boot process. But the best bit is the way it handles upgrades.<\/p>\n<p>Upgrades are neatly done by having two root filesystems on the card. When you&#8217;re running off one you&#8217;re free to upgrade the other. NanoBSD generates two images; one for the entire card, and one that can be written to a single root filesystem. It also provides a script to write the image to the card and update the boot loader to boot from the right partition. So upgrading is as simple as re-running the NanoBSD script, writing the new image to the &#8220;other&#8221; partition, and rebooting. It can all be done live, and the only downtime is the time taken for a reboot (which is under a minute).<\/p>\n<p>Of course, to use NanoBSD you need another system to do the builds on. Fortunately I&#8217;ve got a nice beefy server that can handle the job (although it took a few hacks to build the i386 image on an amd64 system). I&#8217;ve also got a nice <a href=\"http:\/\/tinderbox.marcuscom.com\/\">Tinderbox<\/a> setup which I already use for testing ports and which provided a nice supply of up-to-date packages.<\/p>\n<p>So I&#8217;m happy, at last. Apart from my wifi access point I&#8217;ve managed to replace all my aging, power hungry, noisy equipment with nice new stuff. I guess I&#8217;ll be doing it all again in a few years \ud83d\ude00 .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A look at how I replaced my ageing router and ADSL modem with a Soekris net5501 running FreeBSD.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[32,140,30,29,28,31,35],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-computing","category-freebsd","tag-draytek","tag-freebsd","tag-nanobsd","tag-net5501","tag-soekris","tag-vigor","tag-vigor-110"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":9,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":345,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions\/345"}],"wp:attachment":[{"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bishnet.net\/tim\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}