<?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>jkroon &#187; E220</title>
	<atom:link href="http://jkroon.blogs.uls.co.za/tag/e220/feed" rel="self" type="application/rss+xml" />
	<link>http://jkroon.blogs.uls.co.za</link>
	<description>Ultimate Linux Solutions</description>
	<lastBuildDate>Wed, 25 Aug 2010 21:57:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Huawei E220</title>
		<link>http://jkroon.blogs.uls.co.za/it/networking/huawei-e220</link>
		<comments>http://jkroon.blogs.uls.co.za/it/networking/huawei-e220#comments</comments>
		<pubDate>Tue, 12 Aug 2008 23:27:45 +0000</pubDate>
		<dc:creator>Jaco Kroon</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[E220]]></category>
		<category><![CDATA[Huawei]]></category>
		<category><![CDATA[WINS]]></category>

		<guid isPermaLink="false">http://jkroon.blogs.uls.co.za/?p=21</guid>
		<description><![CDATA[I don&#8217;t really want to even start with this post.  This little device has caused me numerous headaches, from as simple as &#8220;it simply doesn&#8217;t work&#8221;, right through to incorrect DNS servers, and even failing VPN connections.  Which was the last straw.

The failing VPN connections turned out to be a problem with the [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t really want to even start with this post.  This little device has caused me numerous headaches, from as simple as &#8220;it simply doesn&#8217;t work&#8221;, right through to incorrect DNS servers, and even failing VPN connections.  Which was the last straw.</p>
<p><span id="more-21"></span></p>
<p>The failing VPN connections turned out to be a problem with the way I load balance DNS over all available connections, so having (for the particular site) a DSL line, an iBurst and a 3G connection in place things are mostly resonable and we&#8217;ve usually got some options to try when things do bomb out (ie, a dsl line doesn&#8217;t fail, it simply keeps on coming up/going down constantly, half the time not even long enough for lcp-echo-interval and lcp-echo-failure to pick up on the problem.  So what happens when you load balance the DNS over the available DNS servers (obviously pushing the requests over the correct devices) and _one_ of the three connections provides you with totally bogus DNS servers?  Well, let me tell you:  On average one out of three DNS requests fail.  This means that on average once every three minutes the DNS request for the IPSec peer&#8217;s IP fail, causing the vpn to come tumbling down.</p>
<p>Now, on the <a title="Linux South Africa presence" href="http://www.linux.org.za/" target="_blank">GLUG</a> mailing list the words WINS came up &#8211; which is totally bogus.  In fact, it&#8217;s so bogus that initially I discarded (and iirc partially flamed) the guy that brought it up.  In fact, WINS is so wrong that I have no idea how anybody initially got the idea, except perhaps for staring too long at too many pppd debug traces.</p>
<p>The bottom line is this:  The firmware on the Huawei E220 (and by implication the E270 and probably aothers too) is broken.  It passes some WINS servers to the pppd process running on the host.  If these WINS options are NAKed then things start going totally pearshaped.  In fact, it goes so pearshaped that in the last two weeks I didn&#8217;t obtain the correct DNS servers on a single instance.  So I eventually decided it&#8217;s time to give the WINS thing a shot (The more I thought about it, the more disgusting the idea got).  After about half an hour of cleaning up the patches that I could locate I finally managed to make it compile with pppd-2.4.4 (Gentoo variation) and install it.  And immediately I managed to get the correct DNS servers, connection setup times came down (to a few seconds compared to near minute times).</p>
<p>Annoying.  Highly annoying.  Anyway, a working patch is available <a href="http://jkroon.blogs.uls.co.za/wp-content/uploads/2008/08/pppd-wins.patch">here</a>.  I&#8217;d like to actually add usepeerwins as well, which will allow for pulling the WINS servers from a pppd peer, and passing that on to ip-up that can reconfigure samba for winbind (mostly) purposes.  But that&#8217;s the patch for another day.</p>
<p><strong>UPDATE</strong> (2008/08/17):</p>
<p>I&#8217;ve just finished writing usepeerwins support for pppd, which functions closer to the usepeerdns option in that it requests the peer to send up to two wins servers, and then exports them to ip-up and ip-down vir environment variables WINS1 and WINS2, as well as setting USEPEERWINS=1.  It doesn&#8217;t actually make any modifications to your smb.conf file.  The patch itself can be downloaded <a href="http://jkroon.blogs.uls.co.za/wp-content/uploads/2008/08/pppd-usepeerwins.patch">here</a>.  You can update smb.conf using sed commands such as:</p>
<blockquote>
<p style="text-align: left;">sed -re &#8220;s/^[[:space:]]*wins ?server.*/\0 ${LINKNAME}:${WINS1}/&#8221; -i /etc/samba/smb.conf</p>
</blockquote>
<p>For adding (ip-up), and for removing (ip-down):</p>
<blockquote>
<p style="text-align: left;">sed -re &#8220;s/^([[:space:]]*wins ?server.*) ${LINKNAME}:${WINS1//./\\.}/\1/&#8217; -i /etc/samba/smb.conf</p>
</blockquote>
<p>If you&#8217;re able to use either of these patches with success, please let me know.  Please note that from playing around a LOT over the weekend in writing the latter of the patches it seems that the device is especially annoying when plugged in the first time, even without the patch I seem to be able to with quite high repeatability obtain the correct DNS server values by making pppd disconnect and reconnecting <em>without</em> unplugging the device.</p>
<p><strong>UPDATE</strong> (2008/08/26):</p>
<p>For general information setting this up, please see <a title="Vodacom 3G" href="http://www.tlug.org.za/wiki/index.php/Vodacom_3G" target="_blank">this</a> post on <a title="Tuks Linux Users's Group" href="http://www.tlug.org.za" target="_blank">TLUG</a>&#8217;s Wiki.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://jkroon.blogs.uls.co.za/it/networking/huawei-e220" target="_blank"><img src="http://jkroon.blogs.uls.co.za/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://jkroon.blogs.uls.co.za/it/networking/huawei-e220" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://jkroon.blogs.uls.co.za/it/networking/huawei-e220/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
