<?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>Daniel's Blog.</title>
	<atom:link href="http://www.meta.net.nz/~daniel/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.meta.net.nz/~daniel/blog</link>
	<description></description>
	<lastBuildDate>Wed, 10 Jun 2009 00:00:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a DOS USB bootdisk under linux</title>
		<link>http://www.meta.net.nz/~daniel/blog/2009/06/10/creating-a-dos-usb-bootdisk-under-linux/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2009/06/10/creating-a-dos-usb-bootdisk-under-linux/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 00:00:41 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=110</guid>
		<description><![CDATA[Every now and then I need a DOS bootdisk to flash a BIOS or similar, and I only have linux with which to create it. I can never remember the quickest way to do this, so I&#8217;m documenting it here:
Lifted entirely from this webpage. I&#8217;m only archiving it here because content disappears over time.

I needed [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then I need a DOS bootdisk to flash a BIOS or similar, and I only have linux with which to create it. I can never remember the quickest way to do this, so I&#8217;m documenting it here:</p>
<p>Lifted entirely from <a href="http://gebi.supersized.org/archives/3-Create-a-bootable-FreeDOS-usb-stick.html">this webpage</a>. I&#8217;m only archiving it here because content disappears over time.</p>
<blockquote><p>
I needed to upgrade the bios of my Computer (Intel).</p>
<p>But how to do it without windows?</p>
<p>In my case, Intel has many options for bios upgrading and one is the plain old DOS method. This is the best and fastest way to upgrade your bios with linux.<br />
Create a <a href="http://www.freedos.org/">FreeDOS</a> based bootable usb-stick</p>
<p>    * Download a FreeDOS image, i&#8217;ll use <a href="http://www.finnix.org/Balder">Balder</a> for now.<br />
    * Prepare the usb-stick<br />
          o check partition (e.g cfdisk /dev/sda)<br />
          o mkfs.msdos /dev/sda1</p>
<p>Commands</p>
<p>qemu -boot a -fda balder10.img -hda /dev/sda<br />
A:\> sys c:<br />
A:\> xcopy /E /N a: c:</p>
<p>Check with</p>
<p>qemu -hda /dev/sda</p>
</blockquote>
<p>There are, of course, many ways to do this. With recent VirtualBox versions supporting USB passthrough, I could do it entirely from a windows VM. Several other websites suggest installing grub onto the USB disk and having it boot a floppy disk image directly, which also seems like it would work. Your FAT-formatted USB drive would appear as C:, and you can just copy whatever content you like straight onto that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2009/06/10/creating-a-dos-usb-bootdisk-under-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Changing Putty&#8217;s right-click behaviour</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/12/18/changing-puttys-right-click-behaviour/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/12/18/changing-puttys-right-click-behaviour/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:34:49 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tool of the Week]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[right-click]]></category>
		<category><![CDATA[right-click disable]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=103</guid>
		<description><![CDATA[Anyone who uses Putty a lot will inevitably accidentally paste something into their putty window due to Putty&#8217;s right-click to paste default behaviour, often resulting in pasting relatively embarassing content like SQL that should never be seen in daylight, or at least a customer&#8217;s root password.
However, I found this putty enhancement request today. Note at [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone who uses Putty a lot will inevitably accidentally paste something into their putty window due to Putty&#8217;s right-click to paste default behaviour, often resulting in pasting relatively embarassing content like SQL that should never be seen in daylight, or at least a customer&#8217;s root password.<br />
However, I found this <a href="http://www.putty.nl/wishlist/paste-semantics.html">putty enhancement request</a> today. Note at the bottom:</p>
<div class="codesnip-container" >
Update: as of 2003-11-21, there is a new mouse-handling option whereby the right button brings up a context menu containing a Paste option, rather than pasting directly.</div>
</p>
<p>And sure enough, putty supports this. It also supports &#8220;xterm mode&#8221;, which is a more standard middle-click to paste mode. Solved!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/12/18/changing-puttys-right-click-behaviour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QOS and IP Accounting with BGP under linux</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/09/24/qos-and-ip-accounting-with-bgp-under-linux/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/09/24/qos-and-ip-accounting-with-bgp-under-linux/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 10:50:14 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[NSP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[accounting]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[quagga]]></category>
		<category><![CDATA[realms]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=96</guid>
		<description><![CDATA[At NSP we&#8217;ve go a fibre connection into the building, and a 10MBit feed from our ISP, and over that we&#8217;re allowed 10MBit of national and 3 Mbit PIR of international traffic.  Note that this adds up to more than 10Mbit in total! This can cause annoying problems, like someone doing a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>At NSP we&#8217;ve go a fibre connection into the building, and a 10MBit feed from our ISP, and over that we&#8217;re allowed 10MBit of national and 3 Mbit PIR of international traffic.  Note that this adds up to more than 10Mbit in total! This can cause annoying problems, like someone doing a lot of national or APE traffic at 10MBit, and closing out real international traffic. For a long time I&#8217;ve wanted to separate this out, but have not had the time to look into it</p>
<p>This week I finally organised a BGP from my ISP, and had a look at what my options were.  I&#8217;d seen the <a href="http://www.ibiblio.org/john/pubs/route-qos/index.html">Route-based QOS mini-HOWTO</a> a while back, and it looked like it would work ok, but had a few problems.  There&#8217;s no current way it to apply tc or iptables rules selectively based on a routing decision, or even on a route table. You can match on a route realm, however. The mini-HOWTO suggests copying your BGP routes into a separate table and into a realm at the same time, and then using tc and iptable&#8217;s realm matching code.</p>
<p>A quick aside: route realms are best described as a collection of routes. The decision as to which realm a route is placed is made by the local administrator, and each realm can contain routes from a mix of origins. Realms are used to allow administrators to perform bulk operations on large groups of routes in an easy manner. From the <a href="http://linux-ip.net/gl/ip-cref/node153.htm"> iproute command reference</a>: </p>
<blockquote><p>The main application of realms is the TC route classifier [7], where they are used to help assign packets to traffic classes, to account, police and schedule them according to this classification. </p>
</blockquote>
<p>After a bit of digging, I found a link to a patch for <a href="http://www.quagga.net/">quagga</a> to provide <a href="http://vcalinus.gemenii.ro/quaggarealms.html">route realms</a> support. It&#8217;s even still maintained! After a bit of battling with autotools[1], and a bit of battling with linux capabilities[2], I had it up and running.</p>
<p>The <a href="http://vcalinus.gemenii.ro/quaggarealms.html">route realms</a> patch page covered off the BGP configuration I needed, and now I have a set of iptables counters for national, international and total traffic (for completeness).  The only bit it doesn&#8217;t cover off is graphing, but we already have a set of perl scripts which pull information from interface totals or iptables FWMARK counters, so I modified that to pull from these counters as well, and set up RRD graphs. I was previously graphing interface totals out the external nic, and it&#8217;s interesting to note that the iptables &#8220;total&#8221; traffic, while adding up to the sum of national and international, does not correspond to the interface totals.</p>
<p>It&#8217;s worth pointing out that, as seen in <a href="http://linux-ip.net/gl/ip-cref/node153.htm"> iproute command reference</a>, the <em>rtacct</em> tool will grab realm counts for you without needing iptables, so if you just want to something to graph things quickly, <em>rtacct</em> might do the job:</p>
<div class="codesnip-container" >
#kernel<br />
Realm      BytesTo    PktsTo     BytesFrom  PktsFrom<br />
           BPSTo      PPSTo      BPSFrom    PPSFrom<br />
unknown          5949K      57188      15839K      61776<br />
           0          0          0          0<br />
national        15839K      61776       5949K      57188<br />
           0          0          0          0</div>
<p>
<em>rtacct</em> has a naive limit of 256 realms however, where as the actual implementation supports a 16 bit number, so if you have a large number of realms, or you autoclassify your inbound BGP into realms based on the AS number, you will have to use iptables only</p>
<p>I&#8217;m currently only accounting for traffic using this mechanism, but I can also do QOS on it &#8211; tc will match directly on realm tags, and any iptables based match systems you may have can be adapted to match on a realm as well.</p>
<p>[1] The realms patch touched configure.ac, which then required the autotools chain to rebuild everything, but it needed a very particular combination of autoconf and automake. Because it took me an hour or so to get this right, I&#8217;ll record it here:</p>
<div class="codesnip-container" >
  patch -p1 < ../quagga-0.99.5-realms.diff<br />
  aclocal-1.7<br />
  autoheader<br />
  autoconf<br />
  autoconf2.50<br />
  libtoolize -c<br />
  automake-1.7  &#8211;gnu &#8211;add-missing &#8211;copy<br />
  ./configure &#8211;enable-realms &#8211;enable-user=quagga &#8211;enable-group=quagga &#8211;enable-vty-group=quaggavty &#8211;enable-vtysh  &#8211;localstatedir=/var/run/quagga                 &#8211;enable-configfile-mask=0640                 &#8211;enable-logfile-mask=0640</div>
</p>
<p>autoheader and autoconf above are version 2.13. I have no idea why I had to run autoconf2.13 then autoconf2.50, but it seems that this actually worked. </p>
<p>[2] I initially tried building against quagga-0.98.6, because the quaggarealms patch site implied this was the &#8220;stable&#8221; verson, but it seems that quagga drops priviledges too soon. This works out fine if you have &#8220;capabilities&#8221; support in your kernel, which mine didn&#8217;t. They&#8217;ve changed this behaviour in 0.99.5, and incidentally this is the version in debian etch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/09/24/qos-and-ip-accounting-with-bgp-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting Tape Autoloaders via iSCSI</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/09/09/exporting-tape-autoloaders-via-iscsi/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/09/09/exporting-tape-autoloaders-via-iscsi/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 02:41:07 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[NSP]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[autoloader]]></category>
		<category><![CDATA[ietd]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[tape]]></category>
		<category><![CDATA[tape autoloader]]></category>
		<category><![CDATA[tape library]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=94</guid>
		<description><![CDATA[A while ago I posted about {{post id=&#8221;iscsi-for-scsi-device-passthrough-under-xen-enterprise&#8221; text=&#8221;exporting a tape drive via iSCSI&#8221;}} to enable windows VMs to backup to a SCSI tape drive under Citrix Xenserver.   I spent a couple of hours googling for whether or not you could do the same thing with a tape autoloader, and didn&#8217;t find a [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I posted about {{post id=&#8221;iscsi-for-scsi-device-passthrough-under-xen-enterprise&#8221; text=&#8221;exporting a tape drive via iSCSI&#8221;}} to enable windows VMs to backup to a SCSI tape drive under Citrix Xenserver.   I spent a couple of hours googling for whether or not you could do the same thing with a tape autoloader, and didn&#8217;t find a lot of useful information.</p>
<p>So, I just dived in and tried it, and it turns out exactly the same process works fine for exporting a tape autoloader via iSCSI as well, as long as you are slightly careful about your configuration file.</p>
<p>First of all, find your <a href="http://www.wlug.org.nz/HCIL">HCIL</a> numbers with lsscsi:</p>
<div class="codesnip-container" >
[4:0:0:0]    tape    HP       Ultrium 4-SCSI   U24W  /dev/st0<br />
[4:0:0:1]    mediumx HP       1&#215;8 G2 AUTOLDR   1.70  -</div>
</p>
<p>So, we&#8217;ve got an HP Ultrium 4 tape drive on 4:0:0:0, and a 1&#215;8 G2 Autoloader on 4:0:0:1. Let&#8217;s configure IETd:</p>
<p>
<div class="codesnip-container" >
Target iqn.2007-04.com.example:changer0<br />
Lun 0 H=4,C=0,I=0,L=0,Type=rawio<br />
Type 1<br />
InitialR2T No<br />
ImmediateData Yes<br />
xMaxRecvDataSegmentLength 262144</p>
<p>Lun 1 H=4,C=0,I=0,L=1,Type=rawio<br />
Type 1</div>
</p>
<p>A couple of points to note:</p>
<ul>
<li>I&#8217;ve named it changer0, you don&#8217;t have to</li>
<li>You do have to make sure both the tape drive device(s) (in this case, 4:0:0:0) and the changer device (4:0:0:1) are exported as different LUNs under the same target</li>
<li>The other options (InitialR2T, ImmediateData etc) may or may not work for you, consult the IETd documentation for what you actually need and want.
</li>
</ul>
<p>Once you&#8217;ve restarted the iscsi target, you can load up an initiator and connect to it, and you should see both devices being exported under the one target. If you accidentally use a different target for the changer and the tape drive, you&#8217;ll find that your backup software probably can see the changer device, but will tell you there are not available drives. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/09/09/exporting-tape-autoloaders-via-iscsi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking up .local DNS names under OSX</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/08/27/looking-up-local-dns-names-under-osx/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/08/27/looking-up-local-dns-names-under-osx/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 23:35:17 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[NSP]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=92</guid>
		<description><![CDATA[My workplace uses a .local DNS suffix for all internal DNS, which of course causes problems when you&#8217;re running a system which uses any form of mdns &#8211; such as OSX or Ubuntu (or probably any modern Linux distro, I know SuSE had this problem about 6 years ago). The .local lookups fail, because mdns [...]]]></description>
			<content:encoded><![CDATA[<p>My workplace uses a .local DNS suffix for all internal DNS, which of course causes problems when you&#8217;re running a system which uses any form of mdns &#8211; such as OSX or Ubuntu (or probably any modern Linux distro, I know SuSE had this problem about 6 years ago). The .local lookups fail, because mdns takes over. (Thanks John and Phil for reminding me of this).   This shows up as resolution via host or dig working fine, as they make calls direct to your nameservers, but commands like ping failing, as it uses the NSS to do the lookup.</p>
<p>A quick bit of googling, and I found <a href="http://docs.info.apple.com/article.html?artnum=107800">this</a> gem on Apple&#8217;s website, and also <a href="http://www.multicastdns.org/DLLC/">this</a> one on www.multicastdns.org.  Apple&#8217;s suggested fix didn&#8217;t seem to work, but I suspect a reboot is required. I&#8217;ve applied the second one, and rebooted, and one of them is definitely working.</p>
<p>As an aside, this started with me wishing that it was possible to do per-domain resolver configuration. I initially gave up and set up dnsmasq which forward on requests to specific domains to specific servers, but then hit the mdns issue. This method looks very much like a per-domain resolver configuration however &#8211; it&#8217;s saying to use my local DNS server for .local lookups. I haven&#8217;t tested it, but it looks like it should support setting an arbitrary resolver for an arbitrary domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/08/27/looking-up-local-dns-names-under-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I love dmidecode</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/08/07/why-i-love-dmidecode/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/08/07/why-i-love-dmidecode/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 00:03:52 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Tool of the Week]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=87</guid>
		<description><![CDATA[I was asked to provide more ram for a server today, specified only by name. I have login details, but it&#8217;s in a datacentre in Auckland, and I&#8217;m in Hamilton, so I can&#8217;t wander over to check details. 
Enter dmidecode:

&#8230;
System Information
        Manufacturer: Dell Computer Corporation
    [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked to provide more ram for a server today, specified only by name. I have login details, but it&#8217;s in a datacentre in Auckland, and I&#8217;m in Hamilton, so I can&#8217;t wander over to check details. </p>
<p>Enter dmidecode:</p>
<div class="codesnip-container" >
&#8230;<br />
System Information<br />
        Manufacturer: Dell Computer Corporation<br />
        Product Name: PowerEdge 860<br />
&#8230;</div>
</p>
<p>That&#8217;s basically all I need right there. Having a namebrand machine helps, of course &#8211; getting the same sort of information from a generic motherboard isn&#8217;t as easy or useful. However, while checking which ram banks are populated I can also (typically) get the type of ram as well:</p>
<p>
<div class="codesnip-container" >
Handle 0&#215;1100, DMI type 17, 27 bytes<br />
Memory Device<br />
        Array Handle: 0&#215;1000<br />
        Error Information Handle: Not Provided<br />
        Total Width: 72 bits<br />
        Data Width: 64 bits<br />
        Size: 1024 MB<br />
        Form Factor: DIMM<br />
        Set: 1<br />
        Locator: DIMM1_A<br />
        Bank Locator: Not Specified<br />
        Type: DDR2<br />
        Type Detail: Synchronous<br />
        Speed: 533 MHz (1.9 ns)<br />
        Manufacturer: 7F7F7F0B00000000<br />
        Serial Number: 7A947291<br />
        Asset Tag: 0D0718<br />
        Part Number: NT1GT72U8PB0BY-37B</div>
</p>
<p>In this case, the other &#8220;Memory Device&#8221; entries had &#8220;No module installed&#8221; in the Size: section, so I know that this machine has one (1) 1GB DDR2-533 DIMM installed. </p>
<p>Of course, that output doesn&#8217;t seem to tell me that the Dell PowerEdge 860 wants ECC ram (although I know that anyway). And the output from dmidecode on a newer machine:</p>
<p>
<div class="codesnip-container" >
Handle 0&#215;1100, DMI type 17, 23 bytes.<br />
Memory Device<br />
        Array Handle: 0&#215;1000<br />
        Error Information Handle: Not Provided<br />
        Total Width: 72 bits<br />
        Data Width: 64 bits<br />
        Size: 2048 MB<br />
        Form Factor: <out OF SPEC><br />
        Set: 1<br />
        Locator: DIMM 1A<br />
        Bank Locator: Not Specified<br />
        Type: </out><out OF SPEC><br />
        Type Detail: Synchronous<br />
        Speed: 667 MHz (1.5 ns)</div>
<p></out></p>
<p>That&#8217;s from a brand new HP DL360 with FB-DIMMs, so I guess my version of dmidecode on this machine isn&#8217;t new enough to handle that. </p>
<p>In general though, it&#8217;s more than good enough :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/08/07/why-i-love-dmidecode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Further bugs in switches</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/08/07/further-bugs-in-switches/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/08/07/further-bugs-in-switches/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 11:48:20 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[advocacy]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=79</guid>
		<description><![CDATA[Further to my {{post id=&#8221;opennms-and-bugg-switches&#8221; text=&#8221;previous post&#8221;}} on the topic of uncovering bugs in switches with network monitoring systems, I have two more bits of news:
The first is that the vendor has given me a new firmware for one of the switch models which fixes the bug. Apparently it was a known but undocumented bug. [...]]]></description>
			<content:encoded><![CDATA[<p>Further to my {{post id=&#8221;opennms-and-bugg-switches&#8221; text=&#8221;previous post&#8221;}} on the topic of uncovering bugs in switches with network monitoring systems, I have two more bits of news:</p>
<p>The first is that the vendor has given me a new firmware for one of the switch models which fixes the bug. Apparently it was a known but undocumented bug.  Still waiting on a firmware for the other switches.</p>
<p>The second is that I have found another bug in the switches &#8211; this time with HTTPS. It&#8217;s not triggering during autodiscovery this time, and the bug takes a bit longer to manifest (2-4 weeks, it seems), so it&#8217;s slightly harder to track down. I&#8217;ve got to set up a test rig to hammer some of the switches with HTTPS connection attempts and see what shakes loose.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/08/07/further-bugs-in-switches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenNMS and buggy switches</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/07/19/opennms-and-bugg-switches/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/07/19/opennms-and-bugg-switches/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 23:40:57 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[MetaNET]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=70</guid>
		<description><![CDATA[One of my evening projects has been setting up OpenNMS to monitor a network primarily comprised of VENDORNAME switches. OpenNMS is being put in to replace a bundle of Nagios, Cacti, Smokeping, and Groundwork Fruity for Nagios configuration management. The existing system worked well enough, but the lack of autodiscovery of services/nodes along with the [...]]]></description>
			<content:encoded><![CDATA[<p>One of my evening projects has been setting up <a href="http://www.opennms.org/">OpenNMS</a> to monitor a network primarily comprised of VENDORNAME switches. OpenNMS is being put in to replace a bundle of <a href="http://www.nagios.org">Nagios</a>, <a href="http://www.cacti.net">Cacti</a>, <a href="http://oss.oetiker.ch/smokeping/">Smokeping</a>, and <a href="http://fruity.sourceforge.net/">Groundwork Fruity</a> for Nagios configuration management. The existing system worked well enough, but the lack of autodiscovery of services/nodes along with the poor integration between cacti and nagios was getting a bit annoying.</p>
<p>After setting up and trialling OpenNMS for a bit, we deployed it on this network. And then the switches started failing. They&#8217;d still switch packets, and I believe still responded to SNMP, but you couldn&#8217;t connect to them via any of the management interfaces.</p>
<p>So, we started looking at the differences between OpenNMS and Nagios/Cacti/Smokeping. Both do SNMP and ICMP queries, and some TCP port availability checks. The combined stack actually does more SNMP traffic because both Cacti and Nagios ended up querying the same OIDs. I&#8217;ve often noticed that Cacti sends individual requests for OIDs however, rather than grouping them, whereas OpenNMS defaults to requesting 10 OIDs per PDU. I changed this in the configuration (and later on changed it for real, as it was being set in a different config file as well), and let OpenNMS run against some test switches&#8230; and they locked up.</p>
<p>Perry suggested that it could be a memory leak due to the service polling, and set up a test where he polled the SSH server once a minute forever. This test got cancelled after 4 days or so, but the machines hadn&#8217;t died at that point, so we decided it wasn&#8217;t anything fundamental about the service checks.</p>
<p>I set up a range of services that were being monitored on 10 switches, and let them go for a bit. Due to power outages and equipment moves this step ended up taking longer than it needed to, but the end result was that no matter which services were being monitored, all the switches all locked up at around the same point.</p>
<p>And then I noticed that the switches had a growing number of stale &#8220;telnet-d&#8221; connections. These switches have capacity for up to 4 concurrent administrative logins &#8211; once all 4 slots are full, you can no longer log in. So, the theory is these stale connections were blocking real connections, and never timing out, thus causing the lockout of the management stack. They don&#8217;t time out, and you can&#8217;t kill them from the switch console short of rebooting the switch. Most of the switches weren&#8217;t being actively monitered for telnet, but OpenNMS does do service discovery periodically (I think once a day, and perhaps under other situations too), and this would probe each service. So I firewalled telnet out, and had the switches restarted, thinking this would solve it.</p>
<p>The switches still locked up.</p>
<p>The switches still had stale telnet connections appearing in them.</p>
<p>I turned off the telnet service on each switch, thinking that perhaps there was something else on the network that was talking to them, and restarted them. </p>
<p>Within 5 minutes of rebooting each switch, there was a stale telnet connection listed. Awesome.</p>
<p>So, we&#8217;re down to a service that is being misreported as a telnet service. I go through all of them, and discover that none of the other services &#8211; FTP, HTTP, HTTPS &#8211; even show up as an active session. Which leaves telnet &#8211; firewalled out &#8211; and SSH.</p>
<p>The<a href="http://www.krugle.org/kse/files/svn/svn.sourceforge.net/opennms/opennms/trunk/opennms-services/src/main/java/org/opennms/netmgt/capsd/plugins/SshPlugin.java"> OpenNMS plugin which handles discovery of SSH</a> servers is a bit smarter than a basic &#8220;is a service listening on port 22&#8243; sort of discovery &#8211; it waits for the SSH banner from the server, then sends it&#8217;s own SSH banner back, and verifies that it gets a response back. This means it&#8217;s getting part way through the SSH establishment, and then canning the connection.</p>
<p>As a quick test, I telnetted to port 22 on a switch and checked the login listing. With the banner is being displayed, nothing even shows up. When I pasted a valid looking SSH banner back, I got a bunch of binary data echoed into my telnet session, and ssh session to the switch locks up. On reconnecting and checking the login listing, sure enough &#8211; a stale telnet session was there.  </p>
<p>Further tests reveal that if you ssh to one of these switches, but don&#8217;t type your password in, the session gets reported as a telnet session. Furthermore, if you kill your ssh process or shell window while the ssh session is waiting for your password, the session never disappears.</p>
<p>So, we have a very live DOS exploit against VENDORNAME switches here, assuming anyone is unwise enough to allow SSH access from random networks and VLANs to their switches that is.  I have to point out that while it&#8217;s a particular &#8220;feature&#8221; of OpenNMS that triggered this problem for us, this isn&#8217;t a bug in OpenNMS at all, given that it&#8217;s trivial to trigger the same problems with the switches directly.</p>
<p>In regards to the actual problem at hand, OpenNMS is quite configurable, so at least I can change the way it does SSH service discovery to revert to a simple &#8220;is the port up&#8221; check. I&#8217;ve left this running for nearly two weeks now, and the switches on my test bed are all still behaving properly.</p>
<p>I held back from posting this until I could get a response from the vendor. They&#8217;ve acknowledged the bug, and a fix will be out in the next firmware release apparently. I might update once they have released a new firmware; I&#8217;ve edited out the vendor name from this post because I don&#8217;t believe it&#8217;s responsible to publish denial-of-service vulnerabilities without giving the vendor a chance to fix them.</p>
<p>I also noticed this <a href="http://blogs.opennms.org/sartin/?p=45">post</a> on the OpenNMS blog. The author there had similar problems with monitoring a firewall device, and while the scenario seems different, VENDORNAME makes firewalls as well as switches; I wonder if it&#8217;s the same vendor in his case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/07/19/opennms-and-bugg-switches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weird autoblogs</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/07/04/weird-autoblogs/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/07/04/weird-autoblogs/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 23:50:30 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=73</guid>
		<description><![CDATA[I just got a pingback on my earlier post, which was from a blog that indexes posts and articles with a particular word &#8211; acceptance &#8211; in it. Kind of an odd premise for a blog.
UPDATE As per the comment, the author/owner of More Lyrics updated his blog to remove the quote. My original comment [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a pingback on my earlier <a href="http://www.meta.net.nz/~daniel/blog/2008/07/04/citrix-on-xen/">post</a>, which was from a blog that indexes posts and articles with a particular word &#8211; <a href="http://acceptance.morelyrics.co.uk/about/">acceptance</a> &#8211; in it. Kind of an odd premise for a blog.</p>
<p><strong>UPDATE</strong> As per the comment, the author/owner of More Lyrics updated his blog to remove the quote. My original comment was tongue in cheek, but it&#8217;s only fair to remove it I think :) </p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/07/04/weird-autoblogs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Citrix on Xen</title>
		<link>http://www.meta.net.nz/~daniel/blog/2008/07/04/citrix-on-xen/</link>
		<comments>http://www.meta.net.nz/~daniel/blog/2008/07/04/citrix-on-xen/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 21:54:23 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.meta.net.nz/~daniel/blog/?p=72</guid>
		<description><![CDATA[It seems that the original subject of my post yesterday caught the eyes of much of the virtualisation community, including Simon Crosby, formerly from Xensource, and now working for Citrix.
He&#8217;s written a typically well thought out response, which covers off a lot of points:

HP have a multi-hypervisor management tool already which signs off on Xenserver, [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that the original <a href="http://www.brianmadden.com/blog/BrianMadden/Prediction-Citrix-will-drop-the-open-source-Xen-hypervisor-for-Hyper-V">subject</a> of my post <a href="http://www.meta.net.nz/~daniel/blog/2008/07/02/citrix-xenserver-xen-or-hyper-v-does-it-matter/">yesterday</a> caught the eyes of much of the virtualisation community, including Simon Crosby, formerly from Xensource, and now working for Citrix.</p>
<p>He&#8217;s written a typically well thought out <a href="http://community.citrix.com/display/~simoncr/2008/07/02/Xen+is+Dead!+Long+Live+Xen!">response</a>, which covers off a lot of points:</p>
<ul>
<li>HP have a multi-hypervisor <a href="http://h18004.www1.hp.com/products/servers/proliantessentials/valuepack/vms/">management tool</a> already which signs off on Xenserver, VMWare and Hyper-V support</li>
<li>Xenserver Platinum, which is comprised of Xenserver Enterprise and Citrix Provisioning Server, can already provision VMs to not only physical hardware and Xenserver, but to other hypervisors as well</li>
<li>He covered off again the ecosystem building around the Xenserver product range, specifically in HA areas &#8211; products like <a href="http://www.marathontechnologies.com/high_availability_xenserver.html">Marathon Everrun</a> and Stratus <a href="http://www.stratus.com/products/avance/index.htm">Avance</a>.</li>
</ul>
<p>He also wrote up a good bit on the position of Xen with regards to KVM. I haven&#8217;t really looked into KVM much, due to not ready access to test hardware with VT capable chips (the test hardware I do have is tied up with testing Xenserver), but I&#8217;ve always been wary of various claims that it&#8217;s a better VM stack than Xen is. (That might just be because I&#8217;ve not spent the time looking into it, and it might be because of the general not-invented-here feeling the &#8220;linux kernel&#8221; community seems to have about Xen. Again, not something I&#8217;ve spent a lot of time on). A lot of the stuff Simon writes is high level and enthusiastic of course, but it paints a clear picture &#8211; Xen already has massive uptake in mindset, and not just with traditional linux vendors either (<a href="http://www.sun.com/software/products/xvm/index.jsp">Sun xVM</a> and <a href="http://www.oracle.com/technologies/virtualization/index.html">Oracle VM</a> having Xen based stacks as well).  I guess the jury might still be out on which technology actually is technically superior, but as history <a href="http://en.wikipedia.org/wiki/Betamax">demonstrates</a>, it&#8217;s not always the technically superior technology that lasts.</p>
<p>Simon also claims that Xen will be in the BIOS hypervisor offering from <a href="http://www.virtualization.info/2007/11/phoenix-technologies-confirms-hypercore.html">Phoenix</a>, which is something I haven&#8217;t heard before. It certainly makes some amount of sense for Phoenix to not rewrite an entire hypervisor stack and then stick it some place that&#8217;s inherently difficult to upgrade &#8211; your BIOS, but I&#8217;m not sure how it works out regarding Xen&#8217;s requirement for a privileged Xen-aware guest to provide hardware drivers.</p>
<p>Simon also makes another point that I must have heard before from him, because it&#8217;s stuck with me and I agree entirely with the premise:</p>
<blockquote><p>
The founding thesis of XenSource, and the continued strategy at Citrix, is to promote fast, free, compatible and ubiquitous hypervisor based virtualization.  <strong>If the hypervisor is free, why worry about who delivers it?</strong>  Let the customer pick the implementation method that they want &#8211; the real money is in the up-sell with products that make virtualization valuable for customers.
</p>
</blockquote>
<p>Whether you like it that companies are in this to make money or not, this approach seems a good one. Piggybacking their moneymaking on an <a href="http://www.xen.org/">opensource</a> product, an action which drives development, acceptance and that horrible word &#8220;mindshare&#8221;, doesn&#8217;t have to be a bad thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta.net.nz/~daniel/blog/2008/07/04/citrix-on-xen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
