<?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 &#187; Networking</title>
	<atom:link href="http://www.ninjabadger.net/category/networking/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.2.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 any given interface. This is usually a good thing, until you wish to connect your [...]]]></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>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 currently testing &#038; tweaking an iSCSI setup that utilises a Dell 6224 switch. These are [...]]]></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 (throw that in your calculator) but certainly useful for testing nevertheless. Whilst slowly getting my [...]]]></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>m0n0wall and 3G USB modems</title>
		<link>http://www.ninjabadger.net/2009/01/12/m0n0wall-and-3g-usb-modems/</link>
		<comments>http://www.ninjabadger.net/2009/01/12/m0n0wall-and-3g-usb-modems/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 20:21:26 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[hsdpa]]></category>
		<category><![CDATA[k800i]]></category>
		<category><![CDATA[k850i]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[t-mobile]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=61</guid>
		<description><![CDATA[I&#8217;ve been running a m0n0wall router for some time now. The build and design of the machine was meant to be documented on the &#8216;RoutITX&#8217; page of this blog, but I&#8217;d never gotten around to finishing it off. I may do this now that I have more time, but I&#8217;m not promising anything&#8230; Even so, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been running a m0n0wall router for some time now. The build and design of the machine was meant to be documented on the &#8216;RoutITX&#8217; page of this blog, but I&#8217;d never gotten around to finishing it off. I may do this now that I have more time, but I&#8217;m not promising anything&#8230;</p>
<p>Even so, due to the impressive compatibility of the Sony Ericsson K800i and Linux, and the subsequent lack of the same DHCP/CDC USB Ethernet adapter functionality in the K850i, I thought it&#8217;d be quite cool to see if the K800i could be configured as a back-up WAN interface within m0n0wall.</p>
<p>So I fish my K800i (now retired, although I wish it wasn&#8217;t) out of its resting place, find a USB cable, and plug it into the back of the m0n0wall machine. No new interface appeared on the &#8216;assign interfaces&#8217; page, so I restarted it. Still no new interfaces. Upon checking the kernel messages in the log, I found these lines pertaining to the CDC USB Ethernet device:</p>
<p><code>Jan 4 20:28:06 	kernel: device_attach: cdce0 attach returned 6<br />
Jan 4 20:28:06 	kernel: cdce0: could not find data bulk in<br />
Jan 4 20:28:06 	kernel: cdce0: Sony Ericsson Sony Ericsson K800, rev 2.00/0.00, addr 2</code></p>
<p>Which, as a Linux geek, confused me somewhat. Google turned up a number of results for &#8216;cdce0&#8242; problems or &#8216;attach returned 6&#8242; regarding various other drivers, but <a href="http://forums.pcbsd.org/viewtopic.php?f=1&#038;t=10628">only one really addressed the issue in particular</a>, albeit for a much older SE phone. You&#8217;ll notice that there haven&#8217;t been any replies, either.</p>
<p>A former colleague pointed me in the direction of a <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=128485">patch that was submitted around October 2008</a> which enables the proper handling of the CDC USB device within the Nokia N80. Hopefully it should help, but it may be some time before the patch filters down to m0n0wall.</p>
<p>This is just one of those times when I wish I&#8217;d followed the world of software development a little more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2009/01/12/m0n0wall-and-3g-usb-modems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Sony, why?</title>
		<link>http://www.ninjabadger.net/2008/07/29/why-sony-why/</link>
		<comments>http://www.ninjabadger.net/2008/07/29/why-sony-why/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 13:26:38 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[hsdpa]]></category>
		<category><![CDATA[k800i]]></category>
		<category><![CDATA[k850i]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[t-mobile]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=38</guid>
		<description><![CDATA[I absolutely adored my Sony Ericsson K800i. What a phone; everyone&#8217;s had one or used one at some point. Given that they&#8217;re quite long in the tooth now, you&#8217;d be hard-pushed to have not come across someone that had/has one. So when the K850i came out, I was quite eager to get my upgrade. And [...]]]></description>
			<content:encoded><![CDATA[<p>I absolutely adored my Sony Ericsson K800i. What a phone; everyone&#8217;s had one or used one at some point. Given that they&#8217;re quite long in the tooth now, you&#8217;d be hard-pushed to have not come across someone that had/has one.</p>
<p>So when the K850i came out, I was quite eager to get my upgrade. And so far there&#8217;s been only one real drawback to it, that I&#8217;ve found: using it as a modem.</p>
<p>When I first moved into my current abode, I didn&#8217;t have any ADSL for a few weeks. Predictably one can steal some wireless broadband, or one can attempt to use some form of mobile broadband. Before signing my life away for a few months, I decided to test my phone (which at the time, was the K800i) with Ubuntu. To my sheer delight, the phone presents itself as a USB Ethernet adapter, and Ubuntu&#8217;s network-manager simply sent a DHCP request and received an ACK. No messing about here: I had 3G broadband within 5 seconds of plugging the USB cable in!</p>
<p>So obviously when I attempted the same trick with my K850i, I was really quite dismayed to find that you can&#8217;t do this any longer. The USB Ethernet device is there (<em>grep -i CDC /var/log/messages</em>) but for the life of me, I cannot find a way to obtain a DHCP lease via the usb0 interface.</p>
<p>Yes, it works perfectly (and with HSDPA speeds, thanks to my city-centre location) if you use wvdial or one of its GUI front-ends (gnome-ppp worked well) and I&#8217;ve been able to connect like this..</p>
<p>But I can&#8217;t understand why the Sony Ericsson engineers would want to remove such a simple mechanism in favour of the greatest faff-about in history. I&#8217;d be interested to hear from anyone that&#8217;s managed to get this working.. Although I fear by the time I get an answer, I&#8217;ll be back on some ADSL goodness: HSPDA is alright in a pinch, but T-Mobile UK&#8217;s data network seems so heavily sensitive to peak times (I suspect insane levels of contention) and the latency is atrocious. Half a second? Ugh. That&#8217;ll be the Deep Packet Inspection they do&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2008/07/29/why-sony-why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

