<?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>[LINICKX].com &#187; networking</title>
	<atom:link href="http://www.linickx.com/tag/networking/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linickx.com</link>
	<description>Moments of Genius followed by Trash.</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:06:32 +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>USB Networking with Fedora 7 &amp; n800</title>
		<link>http://www.linickx.com/315/usb-networking-with-fedora-7-n800</link>
		<comments>http://www.linickx.com/315/usb-networking-with-fedora-7-n800#comments</comments>
		<pubDate>Fri, 14 Sep 2007 18:14:56 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[n800]]></category>
		<category><![CDATA[770]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[maemo]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.linickx.com/blog/archives/315/usb-networking-with-fedora-7-n800/</guid>
		<description><![CDATA[There are times where you cannot use WiFi, for example my workplace&#8217;s WLAN uses LEAP, which maemo doesn&#8217;t support. I found that setting up USB networking on my n800 was a bit of a pain since there isn&#8217;t a single &#8230; <a href="http://www.linickx.com/315/usb-networking-with-fedora-7-n800">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are times where you cannot use WiFi, for example my workplace&#8217;s WLAN uses LEAP, which maemo doesn&#8217;t support. I found that setting up USB networking on my n800 was a bit of a pain since there isn&#8217;t a single document&#8230; if you check <a href="http://del.icio.us/linickx">my del.icio.us feed</a> you&#8217;ll see I bookmarked all I could find with a <a href="http://del.icio.us/linickx/usbnet">usbnet</a> tag.</p>
<p>These are the steps I ran through to enable usb networking between my nokia n800 and my fedora 7 laptop.</p>
<p>First we&#8217;ll start with the basic setup&#8230; I&#8217;ll assume you&#8217;ve read a getting started article similar to <a href="http://www.linickx.com/blog/archives/292/n800-getting-started-n00b-guide-part-one/">mine</a> and already have root &amp; xterm. By default n800 has a usb interface configured, you just need to enable it, so on your n800 type:<br />
<code><br />
sudo gainroot<br />
insmod /mnt/initfs/lib/modules/2.6.18-omap1/g_ether.ko<br />
ifup usb0<br />
</code><br />
The default settings add an interface with a static ip of 192.168.2.15/24 with a default gateway of 192.168.2.14.</p>
<p>Now lets set up something similar on Fedora, you need to create a file in <code>/etc/sysconfig/network-scripts</code> called <code>ifcfg-usb0</code> with the following&#8230;<br />
<code><br />
DEVICE=usb0<br />
BOOTPROTO=static<br />
IPADDR=192.168.2.14<br />
BROADCAST=192.168.2.255<br />
NETMASK=255.255.255.0<br />
NETWORK=192.168.2.0<br />
ONBOOT=no<br />
MII_NOT_SUPPORTED=no<br />
</code><br />
Now plug the usb cable into both devices, and on your fedora box (<em>as root</em>) type<br />
<code><br />
ifup usb0<br />
</code><br />
You now have connectivity, of course if you have a default fedora install pinging 192.168.2.15 will fail because of the firewall, it is probably best to temporarily disable the firewall (<code>/etc/init.d/iptables stop</code>) to see if it works, if so move onto configuring your firewall correctly (<code>/etc/init.d/iptables start</code> <em>starts it again</em>) <img src='http://www.linickx.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You may also get usb conflicts, you can try <code></code></p>
<p><code>rmmod uhci_hcd</code></p>
<p>but it will disable any USB devices, you have been warned.</p>
<p>With this basic connectivity setup you&#8217;ll have two issues; you only have connectivity between fedora &amp; n800 nothing else works, and opening any application on n800 causes it to try and connect to your wifi, so lets look at those&#8230;.</p>
<p>I&#8217;m going to assume you used system-config-securitylevel to configure your firewall, its worth noting that any changes you make now will be overwritten by any future use of system-config-securitylevel  so it&#8217;s probably best to take a backup of <code>/etc/sysconfig/ipatbles</code> now and later when you&#8217;re finished.</p>
<p>So as root type:<br />
<code><br />
iptables -I RH-Firewall-1-INPUT 2 -i usb -j ACCEPT<br />
iptables -I FORWARD 1 -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
iptables -I FORWARD 1 -s 192.168.2.0/24 -j ACCEPT<br />
iptables --table nat --append POSTROUTING --out-interface eth0 -s 192.168.2.0/24 -j MASQUERADE<br />
/etc/init.d/iptables save<br />
</code><br />
This will allow all connectivity in from the usb interface allowing the n800 to send packets into the fedora box whilst the firewall is running, it will also NAT any traffic from the usb network hiding the n800 behind fedora so that you get onward connectivity. To get the NAT to work you need to enable ip forwarding, this allows fedora to pass pakets between interfaces, to do that type <code></code></p>
<p><code>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</code></p>
<p>and to get it to survive a reboot update <code>/etc/sysctl.conf</code> with <code></code></p>
<p><code>net.ipv4.ip_forward = 1</code></p>
<p>The final part is to enable name resolution (DNS), on n800, I updated <code>/etc/resolv.conf</code> with the <a href="http://www.opendns.com/">opendns</a> servers&#8230;<br />
<code><br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
</code><br />
All things being equal you should now be able to ping www.google.com from your n800 <img src='http://www.linickx.com/wp/wp-includes/images/smilies/icon_cool.gif' alt=':cool:' class='wp-smiley' /> </p>
<p>To get applications to connect, I found on the latest version of ITOS that the <a href="http://maemo.org/community/wiki/dummyiap/">DUMMY IAP</a> didn&#8217;t work, so I stumbled across <a href="http://www.internettablettalk.com/forums/showpost.php?p=52174&amp;postcount=5">this solution</a>.</p>
<p>Create an &#8220;ad hoc&#8221; wifi connection with static IPs&#8230; anything it doesn&#8217;t matter, and when that&#8217;s connected in xterm (<em>as root</em>) type <code>ifconfig wlan0 down</code> , you should now be able to connect to the web with your browser / skype etc over your usb network&#8230; sweet!</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/315/usb-networking-with-fedora-7-n800/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

