<?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>Mike / Michael Fogel &#187; wifi</title>
	<atom:link href="http://www.fogel.ca/tag/wifi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fogel.ca</link>
	<description>soapbox and search engine spam</description>
	<lastBuildDate>Fri, 24 Jun 2011 05:50:17 +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>HOWTO: ubuntu/debian + mobile broadband + local wired subnet = internet access</title>
		<link>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/</link>
		<comments>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 23:31:22 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[t-mobile]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.fogel.ca/?p=1052</guid>
		<description><![CDATA[This post describes one way to quickly set up a two-computer network such that both machines on the network can access the outside internet.  The use case in mind here is you&#8217;re at a cafe with a friend, the wifi there sucks, you have your mobile broadband connection and you want to share it [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes one way to quickly set up a two-computer network such that both machines on the network can access the outside internet.  The use case in mind here is you&#8217;re at a cafe with a friend, the wifi there sucks, you have your mobile broadband connection and you want to share it with your friend.</p>
<p>Note that there are many ways to get to the desired end result here.  This solution has your local laptop doing NAT and forwarding packets at the IP layer.</p>
<p><strong>Supplies:</strong></p>
<ul>
<li>your debian/ubuntu laptop</li>
<li>a &#8220;mobile broadband&#8221; connection with some provider, like Verizon or T-Mobile</li>
<li>an ethernet cord</li>
</ul>
<p><strong>Step 0:</strong> Get your mobile broadband connection working, <a href="http://www.fogel.ca/2010/10/05/t-mobile-webconnect-rocket-2-0-on-debianubuntu">possibly with T-Mobile</a>.</p>
<p><strong>Step 1:</strong> Set up your machine to run a dhcp server for your local wired network</p>
<ul>
<li>sudo apt-get install isc-dhcp-server</li>
<li>Edit /etc/dhcp/dhcpd.conf.  Here are the relevant parts of mine. (Yes, the &#8216;authoritative&#8217; directive is commented out, I&#8217;m not sure how essential this is or not &#8211; but I&#8217;m trying avoid the dhcp server from taking over my local machine&#8217;s default route.)
<pre>
default-lease-time 600;
max-lease-time 7200;
#authoritative;
log-facility syslog;
subnet 172.16.16.0 netmask 255.255.255.0 {
  range 172.16.16.10 172.16.16.250;
  option domain-name-servers 208.67.222.222; # opendns
  option routers 172.16.16.1;
}
</pre>
</li>
<li>Edit /etc/defaults/isc-dhcp-server:
<pre>
mike@110psi:$ cat /etc/default/isc-dhcp-server | tail -n 1
INTERFACES="eth4"
</pre>
<li>sudo ifconfig eth4 172.16.16.1 netmask 255.255.255.0</li>
<li>sudo /etc/init.d/isc-dhcpd-server restart</li>
</ul>
<p>At this point you should physically connect your friend&#8217;s laptop to yours using an ethernet cable.  To watch the connection happen: tail -f /var/log/syslog. You should be able to go between the two computers and ping each other.  If you can&#8217;t, then you want to debug this until you can&#8230; the rest of this recipe won&#8217;t have any effect if your local wired net is broken.</p>
<p><strong>Step 2:</strong> Fix up your routing table</p>
<p>Between pppd, your local dhcp server, and you issuing manual ifconfig commands, it&#8217;s easy for your local routing table to get in a bad state.  Here&#8217;s what you want it to look like:</p>
<pre>
mike@110psi:~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.1        0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
172.16.16.0     0.0.0.0         255.255.255.0   U         0 0          0 eth4
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 ppp0
</pre>
<p>If you need to remove/add/edit routes, the tool you want to use is &#8216;route&#8217;.  For example:</p>
<pre>
sudo route del default
sudo route add default gw 10.0.0.1
</pre>
<p><strong>Step 3:</strong> Set up your computer to do some NAT</p>
<p>I scripted this out.  Here&#8217;s the script:</p>
<pre>
#!/bin/sh
# nat and firewall
# for now, just nat.

ipt=/sbin/iptables
EXTIF=ppp0
INTIF=eth4

case "$1" in
	start)
		echo "Starting firewall:"

		echo -ne "\tClearing existing rules..."
		$ipt -F INPUT
		$ipt -F OUTPUT
		$ipt -F FORWARD
		$ipt -t nat -F
		echo " done."

		echo -ne "\tInput / Output rules..."
		$ipt -P INPUT ACCEPT
		$ipt -P OUTPUT ACCEPT
		echo " done."

		echo -ne "\tForwarding rules, and /proc/sys/net/ipv4/ip_forward..."
		echo "1" > /proc/sys/net/ipv4/ip_forward
		#$ipt -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
		$ipt -A FORWARD -i $EXTIF -o $INTIF -j ACCEPT
		$ipt -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
		echo " done."

		echo -ne "\tEnabling MASQUERADE on $EXTIF..."
		$ipt -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
		echo " done."

		echo "Firewall.sh is up."
	;;
	stop)
		echo -n "Stopping firewall...";
		$ipt -F INPUT
		$ipt -F OUTPUT
		$ipt -F FORWARD
		$ipt -P INPUT ACCEPT
		$ipt -P FORWARD ACCEPT
		$ipt -P OUTPUT ACCEPT
		$ipt -t nat -F
		echo "0" > /proc/sys/net/ipv4/ip_forward
		echo " done.";
		echo "Firewall.sh is down."
	;;
	*)
		N=/etc/init.d/firewall.sh
        	echo "Usage: $N {start|stop}" >&#038;2
		exit 1
	;;
esac
</pre>
<p>Start your NAT up with &#8220;sudo ./nat-script-name.sh start&#8221;.</p>
<p><strong>Step 4:</strong> debug it because it doesn&#8217;t work.</p>
<p>Break the problem into pieces:</p>
<ul>
<li>debug the connection between the two computers (/var/log/syslog, ifconfig, isc-dhcp-server and ping are your friends here)</li>
<li>debug your local routing table (using netstat and route commands)</li>
<li>debug your connection to your mobile broadband provider (pppd, wvdial, minicom, ping, etc)</li>
</ul>
<p>If you find some variant of this recipe works better for your local machine, please post it in the comments so we can all share.  Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2010/11/15/howto-ubuntu-debian-mobile-broadband-local-wired-subnet-internet-access/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pushing on the Edges</title>
		<link>http://www.fogel.ca/2008/12/20/pushing-on-the-edges/</link>
		<comments>http://www.fogel.ca/2008/12/20/pushing-on-the-edges/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 00:22:28 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[egypt]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=340</guid>
		<description><![CDATA[I got to say, the Internet, as a singular invention, just keeps climbing up that list of the &#8216;most important&#8217; inventions of all time.  I expect in about 15 years time it&#8217;ll pass up electricity, the internal combustion engine and the printing press to take the number one spot.  Right about when some 90% of [...]]]></description>
			<content:encoded><![CDATA[<p>I got to say, the Internet, as a singular invention, just keeps climbing up that <a href="http://www.google.com/search?q=most+important+inventions">list</a> of the &#8216;most important&#8217; inventions of all time.  I expect in about 15 years time it&#8217;ll pass up electricity, the internal combustion engine and the printing press to take the number one spot.  Right about when some 90% of the earth&#8217;s population has high-speed wireless access (via your &#8216;phone&#8217; more so than your laptop, though it&#8217;ll be a semi-hybrid of the two anyway) to the internet.</p>
<p>What will change when we hit that point?  Well, consider that:</p>
<ul>
<li>The invention of writing effectively allowed humankind to &#8216;remember&#8217; knowledge reliably for timescales longer than a generation.  That changed a lot.</li>
<li>The invention of the printing press effectively allowed groups of people to &#8216;discuss&#8217; (mainly a one-to-many transmission) knowledge on the timescale of days to years, depending.  That arguably changed more.</li>
<li>The internet stands poised to allow <em>6+ billion </em>minds to all digest and contribute to our collective body of thought &#8211; on the timescale of <em>seconds</em>.</li>
</ul>
<p>Methinks that while I don&#8217;t know what change that last one will bring, I&#8217;m confident it&#8217;ll be solidly redonkulous.</p>
<p>This all makes a key assumption: that we&#8217;ll get to 90% global penetration of the Internet, in a form that&#8217;s still a relatively free, simple, and open communication, many-to-many style.  So are we really moving that way?  Well, this photo was taken last week in <a href="http://maps.google.com/?q=siwa+egypt&amp;z=5">Siwa</a>, an oasis some 300km out a not-entirely paved two lane dead-end road into the Egyptian Sahara desert by Libya.</p>
<p><img src="http://farm5.static.flickr.com/4037/4386508212_56874e7a72.jpg" alt="internet access in siwa, middle of f-ing nowhere" /></p>
<p>It&#8217;s a little hard to see in between all the crumbling rubble &#8211; but the sign on that building in the lower left says (in arabic and english but not <a href="http://en.wikipedia.org/wiki/Siwi">siwi</a>) &#8220;Cafe&#8221; and &#8220;Net&#8221;.  Yup, free wifi with your <a href="http://egyptian-food.suite101.com/article.cfm/how_to_cook_egyptian_foul_muddamas">foul</a>.  We are definetely pushing those edges, we are pushing the Internet out to the edges of our civilization harder and faster than clean water or basic shelter.  And while that might <a href="http://en.wikipedia.org/wiki/Maslow%27s_hierarchy">not make a ton of sense</a> &#8211; it sure is damn exciting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/12/20/pushing-on-the-edges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drowning in Wifi</title>
		<link>http://www.fogel.ca/2008/10/12/dbrowning-in-wifi/</link>
		<comments>http://www.fogel.ca/2008/10/12/dbrowning-in-wifi/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 03:27:34 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[paloalto]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=222</guid>
		<description><![CDATA[At some point, this just starts getting ridiculous.  Wifi access, anyone?

Yup, you&#8217;ll notice that 1200 vertical pixels isn&#8217;t enough to even display them all.  A little iwlist wlan0 scan reveals 32 networks in range.  Talk about redundant access.  80% of these likely funnel through the same 3 or 4 bottlenecks a few hops up anyway.  [...]]]></description>
			<content:encoded><![CDATA[<p>At some point, this just starts getting ridiculous.  Wifi access, anyone?</p>
<p><img src="http://farm5.static.flickr.com/4065/4386153347_c673d72d65_o.jpg" alt="wifi networks" /></p>
<p>Yup, you&#8217;ll notice that 1200 vertical pixels isn&#8217;t enough to even display them all.  A little <em>iwlist wlan0 scan</em> reveals 32 networks in range.  Talk about redundant access.  80% of these likely funnel through the same 3 or 4 bottlenecks a few hops up anyway.  But, I have to say&#8230; 32 networks?  Sweeeeeet!</p>
<p>Taken at the intersection of <a href="http://maps.google.com/?q=cowper+and+university+palo+alto+ca">Cowper and University, Palo Alto</a>, at Gyros and Gyros, sitting and enjoying a lamb &amp; beef gyros &#8211; <em>inside</em>.</p>
<p>Best name for a Wifi network ever: MyLawsuit.  lol!  Only topped by&#8230; <em>MyDivorce</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/10/12/dbrowning-in-wifi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless on the Stena Line</title>
		<link>http://www.fogel.ca/2008/09/19/wireless-on-the-stena-line/</link>
		<comments>http://www.fogel.ca/2008/09/19/wireless-on-the-stena-line/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 14:19:40 +0000</pubDate>
		<dc:creator>Mike Fogel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[england]]></category>
		<category><![CDATA[ferry]]></category>
		<category><![CDATA[holland]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[travel]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://blog.fogel.ca/?p=116</guid>
		<description><![CDATA[I&#8217;m on the Stena Line ferry right now heading from Hoek Van Holland to Harwich, England.  They have wireless!
Kinda.
As is common in captive-audience no-competition environments, (read: airports) wireless goes for outrageous prices.  But even given that peer set, this is ridiculous.  The only logical justification I&#8217;ve been able to come up with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on the <a href="http://www.stenaline.nl/en/ferry/crossing/">Stena Line</a> ferry right now heading from <a href="http://maps.google.com/?q=hoek+van+holland">Hoek Van Holland</a> to <a href="http://maps.google.com/?q=harwich,+england">Harwich, England</a>.  They have wireless!</p>
<p><em>Kinda</em>.</p>
<p>As is common in captive-audience no-competition environments, (read: airports) wireless goes for outrageous prices.  But even given that peer set, this is ridiculous.  The only logical justification I&#8217;ve been able to come up with for charging this much for access is to purposely limit the number of users so that the satellite link doesn&#8217;t get clogged.  But I doubt that&#8217;s the case.  I&#8217;m willing to bet 100 bucks (and my pride) that they&#8217;re off the &#8216;maximum profit peak&#8217; (I dunno econ) by at least a factor of two.</p>
<p>As an end-user, you have two choices:</p>
<ul>
<li>One device, one hour: 6 euro (~8.50 USD)</li>
<li>One device, three hours: 9 euro (~13 USD)</li>
</ul>
<p>I have two devices (a phone/camera and a laptop) I need to both be connected to the internet to publish content effectively.  I want to be connected the whole trip.  It&#8217;s a 6.5 hour ride.  I arrived an hour early.  So for internet access, I need:</p>
<p>Two devices, three three hour segments each, for a total cost of&#8230; 2&#215;3x9 = 54 euro (~77 USD).  Are you on crack?! I paid 33 euro for this trip!  I have a sneaking suspicion that the person/people making the decisions here know about as much about the internet and computing as <a href="http://www.telegraph.co.uk/news/newstopics/uselection2008/johnmccain/2403704/John-McCain-technology-illiterate-doesnt-email-or-use-internet.html">John McCain</a>&#8230;</p>
<p>So, hello VIP lounge!</p>
<p>Only 16 euro, and for the whole trip I get as much bandwidth as a I can drain, free drinks, plush seats, and no screaming kids and drunk guys.  Except maybe me.  Rock n&#8217; roll.  This could get addicting&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogel.ca/2008/09/19/wireless-on-the-stena-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

