<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>LINICKX.com</title><link>https://www.linickx.com/</link><description></description><lastBuildDate>Fri, 14 Sep 2007 18:14:00 +0100</lastBuildDate><item><title>USB Networking with Fedora 7 &amp; n800</title><link>https://www.linickx.com/usb-networking-with-fedora-7-n800</link><description>&lt;p&gt;There are times where you cannot use WiFi, for example my workplace's
WLAN uses LEAP, which maemo doesn't support. I found that setting up USB
networking on my n800 was a bit of a pain since there isn't a single
document... if you check &lt;a href="http://del.icio.us/linickx"&gt;my del.icio.us
feed&lt;/a&gt; you'll see I bookmarked all I could
find with a &lt;a href="http://del.icio.us/linickx/usbnet"&gt;usbnet&lt;/a&gt; tag.&lt;/p&gt;
&lt;p&gt;These are the steps I ran through to enable usb networking between my
nokia n800 and my fedora 7 laptop.&lt;/p&gt;
&lt;p&gt;First we'll start with the basic setup... I'll assume you've read a
getting started article similar to
&lt;a href="https://www.linickx.com/blog/archives/292/n800-getting-started-n00b-guide-part-one/"&gt;mine&lt;/a&gt;
and already have root &amp;amp; xterm. By default n800 has a usb interface
configured, you just need to enable it, so on your n800 type:  &lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo gainroot insmod /mnt/initfs/lib/modules/2.6.18-omap1/g_ether.ko ifup usb0&lt;/code&gt;&lt;br /&gt;
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.&lt;/p&gt;
&lt;p&gt;Now lets set up something similar on Fedora, you need to create a file
in &lt;code&gt;/etc/sysconfig/network-scripts&lt;/code&gt; called &lt;code&gt;ifcfg-usb0&lt;/code&gt; with the
following...  &lt;/p&gt;
&lt;p&gt;&lt;code&gt;DEVICE=usb0 BOOTPROTO=static IPADDR=192.168.2.14 BROADCAST=192.168.2.255 NETMASK=255.255.255.0 NETWORK=192.168.2.0 ONBOOT=no MII_NOT_SUPPORTED=no&lt;/code&gt;&lt;br /&gt;
Now plug the usb cable into both devices, and on your fedora box (&lt;em&gt;as
root&lt;/em&gt;) type&lt;br /&gt;
&lt;code&gt;ifup usb0&lt;/code&gt;&lt;br /&gt;
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
(&lt;code&gt;/etc/init.d/iptables stop&lt;/code&gt;) to see if it works, if so move onto
configuring your firewall correctly (&lt;code&gt;/etc/init.d/iptables start&lt;/code&gt;
&lt;em&gt;starts it again&lt;/em&gt;) :) You may also get usb conflicts, you can try&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rmmod uhci_hcd&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;but it will disable any USB devices, you have been warned.&lt;/p&gt;
&lt;p&gt;With this basic connectivity setup you'll have two issues; you only have
connectivity between fedora &amp;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....&lt;/p&gt;
&lt;p&gt;I'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's
probably best to take a backup of &lt;code&gt;/etc/sysconfig/ipatbles&lt;/code&gt; now and
later when you're finished.&lt;/p&gt;
&lt;p&gt;So as root type:  &lt;/p&gt;
&lt;p&gt;&lt;code&gt;iptables -I RH-Firewall-1-INPUT 2 -i usb -j ACCEPT iptables -I FORWARD 1 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -I FORWARD 1 -s 192.168.2.0/24 -j ACCEPT iptables --table nat --append POSTROUTING --out-interface eth0 -s 192.168.2.0/24 -j MASQUERADE /etc/init.d/iptables save&lt;/code&gt;&lt;br /&gt;
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&lt;/p&gt;
&lt;p&gt;&lt;code&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;and to get it to survive a reboot update &lt;code&gt;/etc/sysctl.conf&lt;/code&gt; with&lt;/p&gt;
&lt;p&gt;&lt;code&gt;net.ipv4.ip_forward = 1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The final part is to enable name resolution (DNS), on n800, I updated
&lt;code&gt;/etc/resolv.conf&lt;/code&gt; with the &lt;a href="http://www.opendns.com/"&gt;opendns&lt;/a&gt;
servers...&lt;br /&gt;
&lt;code&gt;nameserver 208.67.222.222 nameserver 208.67.220.220&lt;/code&gt;&lt;br /&gt;
All things being equal you should now be able to ping www.google.com
from your n800 :cool:&lt;/p&gt;
&lt;p&gt;To get applications to connect, I found on the latest version of ITOS
that the &lt;a href="http://maemo.org/community/wiki/dummyiap/"&gt;DUMMY IAP&lt;/a&gt; didn't
work, so I stumbled across &lt;a href="http://www.internettablettalk.com/forums/showpost.php?p=52174&amp;amp;postcount=5"&gt;this
solution&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Create an "ad hoc" wifi connection with static IPs... anything it
doesn't matter, and when that's connected in xterm (&lt;em&gt;as root&lt;/em&gt;) type
&lt;code&gt;ifconfig wlan0 down&lt;/code&gt; , you should now be able to connect to the web
with your browser / skype etc over your usb network... sweet!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Fri, 14 Sep 2007 18:14:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2007-09-14:usb-networking-with-fedora-7-n800</guid><category>770</category><category>Fedora</category><category>how to</category><category>Linux</category><category>maemo</category><category>n800</category><category>networking</category><category>Nokia</category><category>redhat</category><category>usb</category></item></channel></rss>