<?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>Local Loop &#187; linux</title>
	<atom:link href="http://localloop.co.za/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://localloop.co.za</link>
	<description>Internet and Networking in South Africa</description>
	<lastBuildDate>Wed, 18 Apr 2012 12:27:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Getting the new Linux wireless regulatory domain stuff to work</title>
		<link>http://localloop.co.za/2009/06/getting-the-new-linux-wireless-regulatory-domain-stuff-to-work/</link>
		<comments>http://localloop.co.za/2009/06/getting-the-new-linux-wireless-regulatory-domain-stuff-to-work/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 19:50:41 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[crda]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=237</guid>
		<description><![CDATA[A few days ago I installed kernel 2.6.29 from backports.org on my new Debian Lenny machine in order to get Intel 5100 AGN wireless driver support. While trying to convince the driver that I am not, in fact, an American, I discovered that Linux&#8217;s wireless support is moving toward a new framework for handling the [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I installed kernel 2.6.29 from <a href="http://www.backports.org">backports.org</a> on my new Debian Lenny machine in order to get Intel 5100 AGN wireless driver support.</p>
<p>While trying to convince the driver that I am not, in fact, an American, I discovered that Linux&#8217;s wireless support is moving toward a <a href="http://http://linuxwireless.org/en/developers/Regulatory">new framework</a> for handling the regulatory domain information. Drivers use this to enable the correct (and legal) channels, RF power limits and other behavior for the country you&#8217;re in&#8230;</p>
<p>The first thing I tried was to create a file (<code>/etc/modprobe.d/cfg80211</code>) containing the string:</p>
<p><code>options cfg80211 ieee80211_regdom=ZA</code></p>
<p>This was a step in the right direction, but it turns out that only US, EU and JP regulatory information is hard-coded into the kernel. If one of those won&#8217;t work for you, you need the new <i>Wireless Central Regulatory Domain Agent</i> user-space utility. This little program is called by the cfg80211 module through udev and provides the missing regulatory info. So I grabbed and installed the <code>wireless-crda</code> package from Ubuntu, and put the following in <code>/etc/udev/rules.d/regulatory.rules</code>:</p>
<p><code>KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"</code></p>
<p>Reloading all the wireless-related modules I observed CRDA doing it&#8217;s magic:</p>
<p><code>charlie kernel: [ 4801.596578] cfg80211: Using static regulatory domain info<br />
charlie kernel: [ 4801.596581] cfg80211: Regulatory domain: US<br />
charlie kernel: [ 4801.596583]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)<br />
charlie kernel: [ 4801.596585]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)<br />
charlie kernel: [ 4801.596587]  (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)<br />
charlie kernel: [ 4801.596589]  (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)<br />
charlie kernel: [ 4801.596591]  (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)<br />
charlie kernel: [ 4801.596593]  (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)<br />
charlie kernel: [ 4801.596595]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)<br />
charlie kernel: [ 4801.596597] cfg80211: Calling CRDA for country: ZA<br />
charlie kernel: [ 4801.617628] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27ks<br />
charlie kernel: [ 4801.617631] iwlagn: Copyright(c) 2003-2008 Intel Corporation<br />
charlie kernel: [ 4801.617706] iwlagn 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18<br />
charlie kernel: [ 4801.617734] iwlagn 0000:03:00.0: setting latency timer to 64<br />
charlie kernel: [ 4801.617908] iwlagn: Detected Intel Wireless WiFi Link 5100AGN REV=0x54<br />
charlie kernel: [ 4801.639541] iwlagn: Tunable channels: 13 802.11bg, 24 802.11a channels<br />
charlie kernel: [ 4801.640028] wmaster0 (iwlagn): not using net_device_ops yet<br />
charlie kernel: [ 4801.640575] phy0: Selected rate control algorithm 'iwl-agn-rs'<br />
charlie kernel: [ 4801.640591] wlan0 (iwlagn): not using net_device_ops yet<br />
charlie kernel: [ 4801.644881] cfg80211: Regulatory domain changed to country: ZA<br />
charlie kernel: [ 4801.644883]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)<br />
charlie kernel: [ 4801.644885]  (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)<br />
charlie kernel: [ 4801.644888]  (5170000 KHz - 5250000 KHz @ 20000 KHz), (300 mBi, 1700 mBm)<br />
charlie kernel: [ 4801.644890]  (5250000 KHz - 5330000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)<br />
charlie kernel: [ 4801.644892]  (5490000 KHz - 5710000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)<br />
charlie kernel: [ 4801.644894]  (5735000 KHz - 5835000 KHz @ 20000 KHz), (300 mBi, 3000 mBm)</code></p>
<p>Notice that cfg80211 loads with the US regulatiory domain, then calls CRDA, and while it&#8217;s waiting, iwlagn initializes the wireless device. Finally, cfg80211 switches to ZA, using the info obtained from user-space.</p>
<p>Unfortunately at this point <code>iw dev wlan0 info</code> showed the card was still using US channels. I discovered through experimentation that ZA channels were enabled if cfg80211 had enough time to switch from US to ZA before the iwlagn driver is loaded.</p>
<p>I filed <a href="http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2020">a bug report</a> and Luis Rodriguez promptly responded with <a href="http://www.intellinuxwireless.org/bugzilla/attachment.cgi?id=2056">a patch</a> deleting 3 lines from <code>net/wireless/reg.c</code>, fixing the problem.</p>
<p><strong>Update:</strong><br />
The patch seems to have been merged into kernel 2.6.30. I&#8217;ve upgraded to 2.6.30 from backports.org and now the CRDA magic Just Works (TM).</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2009/06/getting-the-new-linux-wireless-regulatory-domain-stuff-to-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux home networking part 2: Dynamic default route</title>
		<link>http://localloop.co.za/2009/02/linux-home-networking-part-2-dynamic-default-route/</link>
		<comments>http://localloop.co.za/2009/02/linux-home-networking-part-2-dynamic-default-route/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 10:10:13 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[home networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ospf]]></category>
		<category><![CDATA[quagga]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=145</guid>
		<description><![CDATA[After getting the IP addressing on my home LAN sorted out (described in part one) I decided to tackle another unusual aspect of my setup: there is no fixed default route, instead I have M hosts on the network, and a subset of N that have wireless Internet modems, which means that at any given [...]]]></description>
			<content:encoded><![CDATA[<p>After getting the IP addressing on my home LAN sorted out (described in <a href="http://localloop.co.za/archives/143">part one</a>) I decided to tackle another unusual aspect of my setup: there is no fixed default route, instead I have M hosts on the network, and a subset of N that have wireless Internet modems, which means that at any given time there may be 0 to N number of ways to get to the Internet.</p>
<p>To make this work from any host on the network, I installed <code>quagga</code> on each machine, and configured OSPF to distribute the default routes. On one of the N possibly-Internet-connected hosts, my ospfd.conf looks like this (with the <code>router-id</code> set to the static IP of the host):<br />
<code><br />
password secretABC<br />
!<br />
interface eth0<br />
 ip ospf message-digest-key 1 md5 secretXYZ<br />
!<br />
router ospf<br />
 ospf router-id 10.0.0.1<br />
 network 10.0.0.0/24 area 0.0.0.0<br />
 area 0.0.0.0 authentication message-digest<br />
 default-information originate metric 100<br />
!<br />
</code></p>
<p>On the other hosts (set M minus set N), I have a similar configuration, but without the <code>"default-information"</code> line.</p>
<p>One could do this with a set of static routes, but I like this setup because it is dynamic and if I ever needed to do something fancy, OSPF has the flexibility. Now the Internet-connected hosts will advertise their default routes, and withdraw them when they disconnect.</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2009/02/linux-home-networking-part-2-dynamic-default-route/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux home networking part 1: Static IP fall-back</title>
		<link>http://localloop.co.za/2009/02/linux-home-networking-part-1-static-ip-fall-back/</link>
		<comments>http://localloop.co.za/2009/02/linux-home-networking-part-1-static-ip-fall-back/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 07:58:42 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[home networking]]></category>
		<category><![CDATA[ifplugd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networkmanager]]></category>
		<category><![CDATA[static ip fallback]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=143</guid>
		<description><![CDATA[NetworkManager has made it&#8217;s way into the top Linux distributions as the standard way to manage network interfaces on desktop/notebook computers. I like NetworkManager. It works well for both wired and wireless interfaces with DHCP, and using wireless security and authentication is a breeze. With more recent versions you can also configure static IP addresses, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projects.gnome.org/NetworkManager/"><code>NetworkManager</code></a> has made it&#8217;s way into the top Linux distributions as the standard way to manage network interfaces on desktop/notebook computers. I like <code>NetworkManager</code>. It works well for both wired and wireless interfaces with DHCP, and using wireless security and authentication is a breeze. With more recent versions you can also configure static IP addresses, but it doesn&#8217;t support a fall-back static IP configuration if DHCP fails to get a dynamic IP.</p>
<p>I need this capability, because my home network doesn&#8217;t have a router-like device to act as a DHCP server, but I would like to be able to take my notebook to work (or elsewhere), and use DHCP with minimal fuss.</p>
<p>It turns out this fall-back capability is supported in <code>dhcp3-client</code> (and perhaps other DHCP clients), by using a pre-defined lease in the config file (<code>/etc/dhcp3/dhclient.conf</code> on my Ubuntu 8.10 install):<br />
<code><br />
request subnet-mask, broadcast-address, time-offset, routers,<br />
        domain-name, domain-name-servers, domain-search, host-name,<br />
        netbios-name-servers, netbios-scope, interface-mtu;</p>
<p>timeout 10;</p>
<p>lease {<br />
  interface "eth0";<br />
  fixed-address 10.0.0.1;<br />
  option subnet-mask 255.255.255.0;<br />
  renew 2 2030/1/12 00:00:01;<br />
  rebind 2 2030/1/12 00:00:01;<br />
  expire 2 2030/1/12 00:00:01;<br />
}<br />
</code></p>
<p><code>dhcp3-client</code> will now try to get a lease from DHCP, and if it fails, it will configure the IP given in the pre-defined lease, effectively making this a static fall-back IP address.</p>
<p>Unfortunately when <code>NetworkManager</code> gets the news from the DHCP client that we could not get a lease from a DHCP server, it nukes the static configuration on the interface and takes us back to square one. I wanted a work-around that would allow me to keep <code>NetworkManager</code> (since I use it for my 3G modem too), so I came up with this:</p>
<p>I added the following stanza to my <code>/etc/network/interfaces</code> file:<br />
<code><br />
allow-hotplug eth0<br />
iface eth0 inet dhcp<br />
</code></p>
<p>This enables the standard Debian <code>ifup/ifdown</code> magic, and it also stops <code>NetworkManager</code> from managing the interface (which I don&#8217;t mind, since I never use 802.1x on wired networks).</p>
<p>In order to get back plug-and-play functionality (like <code>NetworkManager</code> provided by configuring the interface when it detected the link going up), I installed <code>ifplugd</code>, and configured it to watch my wired interface by changing <code>INTERFACES=""</code> to <code>INTERFACES="eth0"</code> in <code>/etc/default/ifplugd</code>, and restarting the daemon</code>.</p>
<p>An alternative to this setup would be to use IPv4LL addressing provided by <code>avahi-autoip</code>, but I prefer to manually allocate a static IP to each host.</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2009/02/linux-home-networking-part-1-static-ip-fall-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

