<?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>Professional Geekism</title>
	<atom:link href="http://www.ninjabadger.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ninjabadger.net</link>
	<description>Ninjas. Badgers. Linux. Me.</description>
	<lastBuildDate>Fri, 05 Aug 2011 13:49:31 +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>Source routing with OpenVZ &amp; Linux</title>
		<link>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/</link>
		<comments>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 13:43:18 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[openvz]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=147</guid>
		<description><![CDATA[If, like me, you have to run lots of OpenVZ-based virtual server hosts, you will likely have encountered the fun that is reverse-path filtering, or &#8216;rp_filter&#8217;. This is the function of the kernel that rejects &#8216;martian&#8217; IP addresses arriving on &#8230; <a href="http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If, like me, you have to run lots of OpenVZ-based virtual server hosts, you will likely have encountered the fun that is reverse-path filtering, or &#8216;rp_filter&#8217;. This is the function of the kernel that rejects &#8216;martian&#8217; IP addresses arriving on any given interface. This is usually a good thing, until you wish to connect your OpenVZ host to two separate networks and have it route IP addresses from both subnets to &amp; from your guests via the VENET-style interfaces.</p>
<p>Essentially, despite differing source addresses, only one default gateway exists to send traffic to IPs not within the connected subnets and thus, traffic on any &#8220;secondary&#8221; subnet is rejected as a martian when leaving the host&#8217;s interface that is connected to its default gateway.</p>
<p>Some people would use bridged intefaces, although this is sadly not an option for me right now. Whilst the performance of VENET is supposedly better, we also have a large install-base of VENET guests that do not wish to be disturbed. So for now I still need a way to make this work with VENET interfaces (and also VETH if required later).</p>
<p>There are two methods around the return_path filtering, with the first being a terrible hack that should only be used temporarily, if at all&#8230; If you echo &#8217;1&#8242; to /proc/sys/net/ipv4/conf/all/log_martians, you will be able to see which interface is filtering martian packets. With that information you can then simply disable the rp_filter function by echoing &#8217;0&#8242; to /proc/sys/net/ipv4/conf/INTERFACE/rp_filter and martians won&#8217;t be filtered.</p>
<p>However, this isn&#8217;t a sensible option. A better solution is to actually create a routing rule to alter the default gateway used, based on the source subnet. It took me a little bit of digging, but I eventually managed to get this working after combing a few sources (including, but not limited to, the iproute2 man file).</p>
<p>For reference, here&#8217;s my routing table showing two networks and two /32 IPs assigned to a guest&#8217;s VENET interface (note that the networks are /23&#8242;s, not /24&#8242;s!):</p>
<pre>Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.9.159      0.0.0.0         255.255.255.255 UH    0      0        0 venet0
10.0.125.53     0.0.0.0         255.255.255.255 UH    0      0        0 venet0
10.0.8.0        0.0.0.0         255.255.254.0   U     0      0        0 br0
10.0.124.0      0.0.0.0         255.255.254.0   U     0      0        0 br1
0.0.0.0         10.0.9.1        0.0.0.0         UG    0      0        0 br0</pre>
<p>Start by opening /etc/iproute2/rt_tables in your favourite editor. You&#8217;ll need to append a line to the bottom to create a new routing table:</p>
<pre># cat /etc/iproute2/rt_tables
#
# reserved values
#
255    local
254    main
253    default
0    unspec
#
# local
#
#1    inr.ruhep
100    vlan4</pre>
<p>As you can see, I&#8217;ve appended a new table named &#8216;vlan4&#8242; (picking a sensible name <em>helps</em>, in my case this is the VLAN name for 10.0.124.0/23)  and given it a priority of 100. As per my understanding, the priority should be decremented for each subsequent table defined.</p>
<p>Now you need to use ip to define the new rules &amp; routing behaviour, taking advantage of the new table we&#8217;ve defined. First, create a rule matching traffic from your secondary subnet:</p>
<pre>ip rule add from 10.0.124.0/23 iif venet0 table vlan4</pre>
<p>For reference, the &#8216;iif&#8217; attribute is not a mistake; &#8220;iif&#8221; not &#8220;if&#8221;. This was also a key part of the setup, as it <em>only</em> classifies traffic originating from the VENET interfaces, no-where else.</p>
<p>Now add a route to define the new default gateway for our new table of classified traffic and apply it:</p>
<pre>ip route add default via 10.0.125.1 dev br1 table vlan4
ip route flush cache</pre>
<p>You should now find that guest traffic from either network is routed correctly without having to change any rp_filter settings. At any time you can use the following two commands to see your configuration:</p>
<pre>ip rule show</pre>
<pre>ip route show table vlan4</pre>
<p>Be sure to re-apply the &#8216;ip rule&#8217; and &#8216;ip route&#8217; statements on your next reboot; under Scientific Linux 6.0 I&#8217;ve used the /etc/rc.local file, but you can just as easily apply them on ifup in Debian&#8217;s network configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Firefox search add-ons in Ubuntu</title>
		<link>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/</link>
		<comments>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 13:42:08 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=138</guid>
		<description><![CDATA[I booted up my work machine today (a fully-patched Ubuntu 10.10 x86_64 installation) to find that most of my search engine add-ons in Firefox had disappeared. Anyone that&#8217;s had this happen to them will notice that you literally cannot find/retrieve &#8230; <a href="http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I booted up my work machine today (a fully-patched Ubuntu 10.10 x86_64 installation) to find that most of my search engine add-ons in Firefox had disappeared.</p>
<p>Anyone that&#8217;s had this happen to them will notice that you literally cannot find/retrieve these basic add-ons with via the Add-ons store, and most searches online bring back results related to the Google toolbar (not helpful).</p>
<p>Eventually I tracked-down <a href="http://support.mozilla.com/en-US/questions/751010#answer-146360">this post</a> and I am eternally grateful to the poster because, not only did it it allow me to fix the issue myself (copy the missing .xml files from /usr/lib/firefox-addons/searchplugins/en-US/ to the corresponding &#8216;en-GB&#8217; folder) but I have also finally found a method to send my queries to google.co.uk instead of google.com&#8230; Just edit the appropriate .xml file, changing .com to .co.uk.</p>
<p>So no more having to deal with American shopping results!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell 6224 switch &#8216;Oversize Packets&#8217; counter</title>
		<link>http://www.ninjabadger.net/2011/01/28/dell-6224-switch-oversize-packets-counter/</link>
		<comments>http://www.ninjabadger.net/2011/01/28/dell-6224-switch-oversize-packets-counter/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 16:00:13 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[argh]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[san]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=131</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve written anything on my blog, but following the lack of any hits on Google regarding this, I felt this might well be a useful snippet to those in the same boat as myself. I&#8217;m &#8230; <a href="http://www.ninjabadger.net/2011/01/28/dell-6224-switch-oversize-packets-counter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve written anything on my blog, but following the lack of any hits on Google regarding this, I felt this might well be a useful snippet to those in the same boat as myself.</p>
<p>I&#8217;m currently testing &#038; tweaking an iSCSI setup that utilises a Dell 6224 switch. These are very fast switches for the money (about ~£900 if you&#8217;ve got a good account manager!) and provide a lot of features, including stacking, if you have more than one. Their drawbacks, however, are mostly in the lack of documentation and/or the same level of user interface &#8216;polish&#8217; that you receive from other manufacturers. Most people will say; &#8216;you get what you pay for&#8217;, but for the most part they are great switches for the money you pay.</p>
<p>One such &#8220;lack of documentation&#8221; has had me annoyed today. I&#8217;ve been using <a href="http://en.wikipedia.org/wiki/Link_Aggregation_Control_Protocol#Link_Aggregation_Control_Protocol">LACP</a> to bond ports and, at the same time, have raised the MTU to the maximum of 9216 (which can be done per-port, without a reboot or a switchport up/down event, I might add) across all ports. All this, in an attempt to glean a little more performance (i.e. lower processing overhead) from my iSCSI sessions.</p>
<p>And it seemed to work just fine. However, upon inspecting the interface counters, I noticed a stunning amount of packets being regarded as &#8216;Oversize Packets&#8217;:</p>
<p><code><br />
switch#show interfaces counters port-channel 1<br />
Alignment Errors: ............................. 0<br />
FCS Errors: ................................... 0<br />
Single Collision Frames: ...................... 0<br />
Multiple Collision Frames: .................... 0<br />
Late Collisions: .............................. 0<br />
Excessive Collisions: ......................... 0<br />
Oversize Packets: ............................. 15829678<br />
Internal MAC Rx Errors: ....................... 0<br />
Received Pause Frames: ........................ 0<br />
Transmitted Pause Frames: ..................... 0<br />
</code><br />
I wasn&#8217;t sure whether or not to take this as an error or just a simple &#8216;count&#8217; of packets. &#8220;Oversize&#8221; would indicate that they&#8217;re bigger than the port was expecting, but I was still hitting around 120MB/sec (out of the theoretical 125MB/sec that Gigabit Ethernet can physically provide) which wouldn&#8217;t be conducive to a serious string of frame/packet errors.</p>
<p>I couldn&#8217;t find anything online, so I contacted Dell ProSupport to raise a ticket. I had to go through the annoying rigmarole of explaining the problem three times over, but eventually a &#8216;switch expert&#8217; explained that he wasn&#8217;t certain on the use of that counter and that its purpose <strong>depended on the firmware version currently in use</strong> (in my case, this was 3.2.0.9) and needed to check with his colleagues.</p>
<p>He eventually rang back to inform me that this was not a problem with the switch. The &#8220;Oversize Packets&#8221; counter merely serves to log packets that have a payload in excess of 1518 bytes. A fixed amount. It doesn&#8217;t matter than the MTU was set to 9216, it just continues counting the packets. Utterly useless, then!</p>
<p>As some form of consolation, he also mentioned that it didn&#8217;t update in real time.. Owing me to believe that there was some form of port stats analysing process running over the real time output. When it&#8217;s this useless, could I please have an option to turn it off? Or better yet, don&#8217;t bother logging it by default! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2011/01/28/dell-6224-switch-oversize-packets-counter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IPv6 on m0n0wall</title>
		<link>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/</link>
		<comments>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 23:05:18 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[m0n0wall]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=124</guid>
		<description><![CDATA[I finally got around to sending my first ping6 echos! Who knew I&#8217;d get replies on my first go?! My ADSL provider Andrews &#038; Arnold have provided me with a /48 IPv6 subnet, which seems somewhat wasteful at 2^80 addresses &#8230; <a href="http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I finally got around to sending my first ping6 echos! Who knew I&#8217;d get replies on my first go?!</p>
<p>My ADSL provider <a href="http://aaisp.net">Andrews &#038; Arnold</a> have provided me with a /48 IPv6 subnet, which seems somewhat wasteful at 2^80 addresses (throw that in your calculator) but certainly useful for testing nevertheless. Whilst slowly getting my head around the task that is variable-length subnetting of IPv6 ranges &#8211; painful at best &#8211; I decided to just throw in a /64 subnet and set a static gateway address on <a href="http://m0n0.ch/wall">m0n0wall</a>&#8216;s LAN interface to see if it would &#8216;just work&#8217;.</p>
<p>The result, is a working IPv6 LAN by simply enabling autoconfig from the m0n0wall box and telling Ubuntu&#8217;s Network Manager to use it. Et voila:</p>
<p><code>teh@desktop:~$ ifconfig eth0<br />
eth0      Link encap:Ethernet  HWaddr 00:01:29:fc:37:1d<br />
          inet addr:81.187.xxx.xxx  Bcast:81.187.xxx.xxx  Mask:255.255.255.240<br />
          inet6 addr: 2001:8b0:ff87:1:201:29ff:fefc:371d/64 Scope:Global<br />
          inet6 addr: fe80::201:29ff:fefc:371d/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:1616524 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:2224946 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:277202062 (277.2 MB)  TX bytes:519498762 (519.4 MB)<br />
          Interrupt:18</code></p>
<p>You&#8217;ll notice that the last 80 bits of my IPv6 address on this host were assigned via autoconfig, using part of my MAC address (the part that doesn&#8217;t correspond to a certain manufacturer, IIRC) as well as some randomly-generated bits, too.</p>
<p>And to make my night, ping6 worked straight away, too:</p>
<p><code>teh@desktop:~$ ping6 2001:08B0:FF88:0001::1<br />
PING 2001:08B0:FF88:0001::1(2001:8b0:ff88:1::1) 56 data bytes<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=1 ttl=64 time=3.81 ms<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=2 ttl=64 time=0.130 ms<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=3 ttl=64 time=0.132 ms</code></p>
<p><code>--- 2001:08B0:FF88:0001::1 ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2000ms<br />
rtt min/avg/max/mdev = 0.130/1.358/3.813/1.735 ms</code></p>
<p>Now to plan how I&#8217;m going to roll this out at work&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Pretending to be a Solaris admin</title>
		<link>http://www.ninjabadger.net/2010/01/03/pretending-to-be-a-solaris-admin/</link>
		<comments>http://www.ninjabadger.net/2010/01/03/pretending-to-be-a-solaris-admin/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 14:50:32 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Storage]]></category>
		<category><![CDATA[nexenta]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=117</guid>
		<description><![CDATA[I&#8217;m always, always forgetting how to discover the available disks on a Solaris/OpenSolaris machine. As I was having another (un-successful) crack at getting a disk controller (other than the motherboard&#8217;s IDE controller) to work with Nexenta Core v2, I&#8217;d again &#8230; <a href="http://www.ninjabadger.net/2010/01/03/pretending-to-be-a-solaris-admin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m always, always forgetting how to discover the available disks on a Solaris/OpenSolaris machine.</p>
<p>As I was having another (un-successful) crack at getting a disk controller (other than the motherboard&#8217;s IDE controller) to work with <a href="http://nexenta.org">Nexenta Core</a> v2, I&#8217;d again forgotten how I was meant to discover the disks as-probed by the OpenSolaris kernel.</p>
<p>Of course, Nexenta includes Ubuntu Hardy&#8217;s userland tools, but anything kernel/device-related is still very different to what I&#8217;m used to.</p>
<p>I finally found a particularly <a href="http://southbrain.com/south/tutorials/zpools.html">well-written post</a> by <a href="http://southbrain.com/south/about-me.html">Pascal Gienger</a>, whom notes that:</p>
<blockquote><p>First we will try to look up the disks accessible by our system:</p>
<p><code># format<br />
Searching for disks...done<br />
AVAILABLE DISK SELECTIONS:<br />
       0. c0d0 <default cyl 2085 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0<br />
       1. c1d0 </default><default cyl 1042 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0<br />
Specify disk (enter its number): ^C</default></code></p>
<p>Type CTRL-C to quit &#8220;format&#8221;.</p>
<p>If your disks do not show up, use devfsadm:</p>
<p><code># devfsadm<br />
# format<br />
Searching for disks...done<br />
AVAILABLE DISK SELECTIONS:<br />
       0. c0d0 <default cyl 2085 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0<br />
       1. c0d1 </default><default cyl 1042 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0<br />
       2. c1d0 </default><default cyl 1042 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0<br />
       3. c1d1 </default><default cyl 1042 alt 2 hd 255 sec 63><br />
          /pci@0,0/pci-ide@1f,1/ide@1/cmdk@1,0<br />
Specify disk (enter its number): ^C</default></code></p>
<p>You&#8217;ll notice that the virtual disks are mapped as IDE/ATA drives, so the disk device names don&#8217;t have a target specification &#8220;t&#8221;.</p></blockquote>
<p>Which has helped me to finally find out that my second-hand (i.e. &#8216;borrowed&#8217; from an old work machine) Adaptec RAID card, doesn&#8217;t work with Nexenta Core v2. Still, Core v3 will be out in a few months &#8211; maybe I&#8217;ll try again then.</p>
<p>Also worth noting, as it may be useful, <code>iostat -En</code> prints out similar information useful when searching for disks to use with ZFS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2010/01/03/pretending-to-be-a-solaris-admin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

