<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.openmoko.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Sander&amp;feedformat=atom</id>
		<title>Openmoko - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Sander&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Special:Contributions/Sander"/>
		<updated>2013-05-20T19:16:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.6</generator>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Specialized_USB_cables</id>
		<title>Specialized USB cables</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Specialized_USB_cables"/>
				<updated>2011-03-05T11:35:38Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: add delock y-cable hub&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|work in progress}}&lt;br /&gt;
&lt;br /&gt;
== Attaching the Neo (acting as a USB host) to a USB device ==&lt;br /&gt;
&lt;br /&gt;
The USB port (5 position mini type B jack) on the Neo 1973 and Neo FreeRunner can be both a USB device or a USB host. The provided cable (5 position mini type B plug to type A plug) is used when attaching the Neo to a USB host.&lt;br /&gt;
&lt;br /&gt;
A specialized cable is required when attaching the Neo to a USB device. (The device has a USB type A jack).&lt;br /&gt;
&lt;br /&gt;
(picture)&lt;br /&gt;
&lt;br /&gt;
Alternately, an adapter capable of connecting two type A plugs will allow attaching the provided USB cable to the USB cable that came with the USB device. This adapter is also known as a gender changer.&lt;br /&gt;
&lt;br /&gt;
(picture)&lt;br /&gt;
&lt;br /&gt;
=== Ready-made mini type A plug to a type A jack adapter ===&lt;br /&gt;
&lt;br /&gt;
You can now purchase a proper [http://www.electronicproductonline.com/catalog/product_info.php?products_id=2043 custom-manufacturered mini-A to full-sized A USB adapter from here]. This adapter already has Pins 4 and 5 shorted together internally; the unique form factor also makes it very handy and eliminated the need for things like the double USB female adapter trick shown at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
[[Image:USBOTGSwivel.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Ready-made mini type B plug to a type A jack cable ===&lt;br /&gt;
&lt;br /&gt;
You can buy [[http://www.jaykang.com/usbafetousbm1.html this]] ready-made USB A-Type Female to USB Mini-B Type 5 Pin Male Adapter.&lt;br /&gt;
[[Image:jaykang_usbafetousbm1.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
It is available in Europe from Openmoko distributor Goldelico: http://www.handheld-linux.com/wiki.php?page=Neo%20Freerunner%3AUSB%20Adapter&lt;br /&gt;
&lt;br /&gt;
A Mini-B to Female-A cable is also available from [http://www.usbfirewire.com/Parts/rr-2mb-020.html www.usbfirewire.com].&lt;br /&gt;
&lt;br /&gt;
Adapter $1.45 including worldwide shipping, http://www.dealextreme.com/details.dx/sku.26783 --[[User:Schorhr|Schorhr]] 05:24, 16 September 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== How to make a mini type B plug to a type A jack cable ===&lt;br /&gt;
&lt;br /&gt;
(picture, as soon as I build it)&lt;br /&gt;
&lt;br /&gt;
Parts list:&lt;br /&gt;
&lt;br /&gt;
* Mini type B plug: Digi-Key [[http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=H2958-ND H2958-ND]]&lt;br /&gt;
* type A jack: I have not yet been able to find a source for these. Meanwhile, use the jack from a standard USB extension cord&lt;br /&gt;
* Cable: Ideally, the data lines should be twisted and 28 AWG, the power lines should be 20 or 28 AWG, e.g. Hitachi Cable [[http://www.hcm.hitachi.com/electronic_round_cable/bulk-usb-cable.shtml 49248 ]]&lt;br /&gt;
&lt;br /&gt;
Construction instructions:&lt;br /&gt;
&lt;br /&gt;
(TBA)&lt;br /&gt;
&lt;br /&gt;
=== Ready-made type A jack to a type A jack adapter (gender changer) ===&lt;br /&gt;
&lt;br /&gt;
You can buy [[http://www.jaykang.com/usbtyfetotyf.html this]] ready-made USB Type A Female to Female Gender Changer.&lt;br /&gt;
[[Image:jaykang_usbtyfetotyf.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
=== How to make a type A jack to a type A jack adapter (gender changer) ===&lt;br /&gt;
&lt;br /&gt;
This community provided instruction shows how to build an adapter from a USB socket salvaged from a computer motherboard.&lt;br /&gt;
&lt;br /&gt;
Note that these instructions are provided in the hope that they are useful but without any warranty!&lt;br /&gt;
&lt;br /&gt;
[[Image:2-usb-receptables.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
:#Find an old motherboard with a set of two USB receptacles as shown above.&lt;br /&gt;
:#Desolder this set of receptacles from the motherboard. This can be bit tricky but it is doable at least with a desoldering gun.  Solder braid (available at electronic parts stores including Radio Shack) works better than even a professional desoldering gun and is a lot cheaper.&lt;br /&gt;
:#Each receptacle has four pins. Use a multimeter to verify that you have no short circuits between the pins or the shield.&lt;br /&gt;
:#Solder adjacent pins together (GND to GND, D- to D-, D+ to D+, VCC to VCC).&lt;br /&gt;
:#(Optional) Build a test cable. Cut an USB cable with A plug into half, connect it a receptacle and again measure that you have no short circuits. Then connect the test cable to PC and verify that you see&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red +5V&lt;br /&gt;
:#FreeRunner is shipped with a mini-B-to-A-plug cable. Connect this to a receptacle.&lt;br /&gt;
:#(Optional)Connect test cable to the other receptacle and verify that you see&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red 0V&lt;br /&gt;
when freerunner acts as a device and&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red +5V&lt;br /&gt;
when it acts as a host.&lt;br /&gt;
:#At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter. Here's how the setup should look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Usb-gender-changer1.jpg&lt;br /&gt;
Image:Usb-gender-changer2.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to make a type A jack to a type A jack adapter (gender changer) without soldering ===&lt;br /&gt;
&lt;br /&gt;
:#Find a 2-port USB front-panel with a 9-pin connector. Usually you can get one from a PC motherboard package box.&lt;br /&gt;
:#Align it in a way so you see the connector pins as a 2 row 5 column matrix with one pin missing.&lt;br /&gt;
:#Use 4 staples to short the pins residing in a same column.&lt;br /&gt;
:#FreeRunner is shipped with a mini-B-to-A-plug cable. Use it to connect the first port of your panel with your FreeRunner.&lt;br /&gt;
:#At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter.&lt;br /&gt;
&lt;br /&gt;
If you have a ASUS USB/MIR front panel, it is even easier - you can use jumpers to short the pins.&lt;br /&gt;
&lt;br /&gt;
[[Image:asususb.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Compatibility ===&lt;br /&gt;
&lt;br /&gt;
The adapter works with kingston data traveller 4G memory stick and aiptec pencam webcam. However, for some reason (probably the missing 15k resistors at D+ and D-) it did not work with any of the tested USB keyboards or mice:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 24&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 25&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 26&lt;br /&gt;
usb 1-2: device not accepting address 26, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 27&lt;br /&gt;
usb 1-2: device not accepting address 27, error -62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, if I connect neo to small (unpowered) USB hub&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 61&lt;br /&gt;
usb 1-2: configuration #1 chosen from 1 choice&lt;br /&gt;
hub 1-2:1.0: USB hub found&lt;br /&gt;
hub 1-2:1.0: 4 ports detected&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and connect the keyboard to the hub then it is correctly recognized:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2.3: new low speed USB device using s3c2410-ohci and address 62&lt;br /&gt;
usb 1-2.3: configuration #1 chosen from 1 choice&lt;br /&gt;
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.0/input/input13&lt;br /&gt;
input: USB HID v1.10 Keyboard [  USB Keyboard] on usb-s3c24xx-2.3&lt;br /&gt;
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.1/input/input14&lt;br /&gt;
input: USB HID v1.10 Device [  USB Keyboard] on usb-s3c24xx-2.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With the hub I can also use both keyboard and usb memory stick at the same time.&lt;br /&gt;
&lt;br /&gt;
==== Power consumption ====&lt;br /&gt;
&lt;br /&gt;
When I unplug the USB hub (with only keyboard connected to it) the power consumption estimate at /sys/devices/platform/bq2700-battery.0/power_supply/bat/current_now decreases from 175000 to 145000 (are these microamperes?).&lt;br /&gt;
&lt;br /&gt;
== Buy a USB Y cable for powering USB devices and charging the Freerunner while in host mode ==&lt;br /&gt;
&lt;br /&gt;
You do not need to make a cable, you can just buy a &amp;quot;USB 2.0 Dual Power Cable, 2 x Type A to mini B&amp;quot; from [http://www.lindy.co.uk/1m-usb-2-dual-power-cable-2-x-type-a-50cm-apart-to-mini-b/31782.html lindy]. You then plug (via an adapter) the central plug of the Y cable into the upstream port (B socket or A plug) of your powered USB hub, the other A plug of the Y cable into one of the A sockets of your hub, and the mini-B plug of the Y cable into your Freerunner. Put your Freerunner into USB unpowered host mode. It will charge and you can plug a keyboard, a mouse, a disk, cable modem, etc, into the hub.&lt;br /&gt;
&lt;br /&gt;
Adapters, [http://www.rueducommerce.fr/Accessoires-Consommables/Cables-USB/Adaptateurs-convertisseurs/-/MO-35F4EM2168156-Adaptateur-Usb-type-A-Femelle-type-B-Male.htm A female to B male] or [http://www.rueducommerce.fr/Accessoires-Consommables/Cables-USB/Adaptateurs-convertisseurs/-/MO-B7A48M2167837-Changeur-Usb-type-A-Femelle-Femelle.htm A female to A female], are easy to find on the net. You will need a &amp;quot;A female to B male&amp;quot; if your hub has a type B socket or a &amp;quot;A female to A female&amp;quot; if your hub has a type A plug.&lt;br /&gt;
&lt;br /&gt;
another store : [http://www.picco.nl/product_info.php?products_id=1758 picco.nl]&lt;br /&gt;
&lt;br /&gt;
== How to make a USB cable for powering attached USB devices and charging the Neo while in host mode (aka Y-Cable) ==&lt;br /&gt;
&lt;br /&gt;
{{note|work in progress}}&lt;br /&gt;
&lt;br /&gt;
This method was invented by [[User:JOERG|Joerg Reisenweber]], and was&lt;br /&gt;
since implemented practically by many community members. See&lt;br /&gt;
http://lists.openmoko.org/pipermail/community/2008-March/013978.html .&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
You can find some pictures (schematics, parts and part numbers&lt;br /&gt;
at http://om.quatrox.org/om/ but be careful!!!&lt;br /&gt;
Report any bugs to quatrox&lt;br /&gt;
(irc #openmoko, #openmoko-cdevel, #ocp at freenode.org)&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This cable might be necessary for a number of reasons, e.g.&lt;br /&gt;
&lt;br /&gt;
* The application requires that the Neo not become suspended&lt;br /&gt;
* The application requires long run time&lt;br /&gt;
* The attached USB device consumes a lot of power&lt;br /&gt;
&lt;br /&gt;
(However, as there is a wide range[http://permalink.gmane.org/gmane.comp.handhelds.openmoko.hardware/415]&lt;br /&gt;
of USB hubs out there, one might find power (on a powered USB hub)&lt;br /&gt;
is available already on the hub's mini USB 5 pin socket already, so not need a specialized cable after all!&lt;br /&gt;
Check with a test meter.)&lt;br /&gt;
&lt;br /&gt;
These instructions will show you how to make a cable with 3 ends:&lt;br /&gt;
&lt;br /&gt;
* A mini-USB type B cable for the Neo itself&lt;br /&gt;
* A cable of whatever type to go to your USB device.&lt;br /&gt;
* A cable going to a +5V +/-10%(max!) power supply with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.&lt;br /&gt;
&lt;br /&gt;
You connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device.&lt;br /&gt;
You have to connect 2 pcs  15k ohm resistors, one from D+ to ground, and one from D- to ground, to comply with USB-spec for hostmode, as Neo is switching off the internal resistors when you enable charging/powering over USB by asserting EN_USBHOST.&lt;br /&gt;
See schematics, LOCATION:49XX&lt;br /&gt;
&lt;br /&gt;
Just for reference, the USB wires from left to right are:&lt;br /&gt;
*Black: Power -&lt;br /&gt;
*Green: Data -&lt;br /&gt;
*White: Data +&lt;br /&gt;
*Red: Power +&lt;br /&gt;
&lt;br /&gt;
The Mini_USB-B connector has a fifth pin, the ID-pin.&lt;br /&gt;
This pin is supposed to be short to ground to signal FreeRunner to enter hostmode. For the Y-cable and enabling external power while in hostmode, you may connect a 47k ohm resistor from ID-pin to ground. This is the same trick the OM-wallcharger uses to signal to FreeRunner it can charge with 1A. Future kernels should switch to hostmode + external power when seeing this 47k resistor.&lt;br /&gt;
&lt;br /&gt;
===Parts===&lt;br /&gt;
USB 2.0 Plug type A to mini 5 pin USB Plug type B that should include the ID signal, so that you can add the 47k ohm resistor to ID-pin to trigger fast charging&lt;br /&gt;
&lt;br /&gt;
# [http://www.firefold.com/Products/6-Foot-USB-20-Plug-type-A-to-mini-USB-Plug-type-B-5-pin-Cable---Black__USB-5PMINI-6.aspx firefold]&lt;br /&gt;
# Belkin 5 pin (find reference)&lt;br /&gt;
#https://www.argentdata.com/catalog/product_info.php?products_id=111&lt;br /&gt;
#http://www.partsdata.de/USB_Mini-B-Verlaengerung_Kabel_1m_CU-XB05-10.html&lt;br /&gt;
&lt;br /&gt;
== USB hubs that can be used like a Y-cable without modifications ==&lt;br /&gt;
&lt;br /&gt;
[http://www.dealextreme.com/details.dx/sku.13526 Cable Style Dual-Power 1000mA USB 2.0 4-Port Hub]. Connect power source to the red upstream connector and openmoko to the black upstream connector. Then connect USB devices to the downstream ports. After settings usb_mode=host the openmoko will charge and will still be able to talk to the downstream ports.&amp;lt;br&amp;gt;&lt;br /&gt;
also available on ebay: [http://cgi.ebay.com/High-Speed-Smart-3-Ports-USB-Hub-5-Pin-Cable-for-PC_W0QQitemZ260567368077QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item3cab06818d]&lt;br /&gt;
&lt;br /&gt;
Or maybe this Delock one [http://www.picco.nl/product_info.php?products_id=6493 Delock Hub] (will test when I receive it)&lt;br /&gt;
&lt;br /&gt;
==  USB reduction with own power source  ==&lt;br /&gt;
To this [http://multi.xeres.cz/elektronika/usb-redukce reduction with own power source] you can plug FreeRunner and USB device  and both power from solo battery.&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Neo FreeRunner Hardware]]&lt;br /&gt;
[[Category:Power]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Specialized_USB_cables</id>
		<title>Specialized USB cables</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Specialized_USB_cables"/>
				<updated>2011-03-05T11:33:45Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: add y-cable store&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|work in progress}}&lt;br /&gt;
&lt;br /&gt;
== Attaching the Neo (acting as a USB host) to a USB device ==&lt;br /&gt;
&lt;br /&gt;
The USB port (5 position mini type B jack) on the Neo 1973 and Neo FreeRunner can be both a USB device or a USB host. The provided cable (5 position mini type B plug to type A plug) is used when attaching the Neo to a USB host.&lt;br /&gt;
&lt;br /&gt;
A specialized cable is required when attaching the Neo to a USB device. (The device has a USB type A jack).&lt;br /&gt;
&lt;br /&gt;
(picture)&lt;br /&gt;
&lt;br /&gt;
Alternately, an adapter capable of connecting two type A plugs will allow attaching the provided USB cable to the USB cable that came with the USB device. This adapter is also known as a gender changer.&lt;br /&gt;
&lt;br /&gt;
(picture)&lt;br /&gt;
&lt;br /&gt;
=== Ready-made mini type A plug to a type A jack adapter ===&lt;br /&gt;
&lt;br /&gt;
You can now purchase a proper [http://www.electronicproductonline.com/catalog/product_info.php?products_id=2043 custom-manufacturered mini-A to full-sized A USB adapter from here]. This adapter already has Pins 4 and 5 shorted together internally; the unique form factor also makes it very handy and eliminated the need for things like the double USB female adapter trick shown at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
[[Image:USBOTGSwivel.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Ready-made mini type B plug to a type A jack cable ===&lt;br /&gt;
&lt;br /&gt;
You can buy [[http://www.jaykang.com/usbafetousbm1.html this]] ready-made USB A-Type Female to USB Mini-B Type 5 Pin Male Adapter.&lt;br /&gt;
[[Image:jaykang_usbafetousbm1.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
It is available in Europe from Openmoko distributor Goldelico: http://www.handheld-linux.com/wiki.php?page=Neo%20Freerunner%3AUSB%20Adapter&lt;br /&gt;
&lt;br /&gt;
A Mini-B to Female-A cable is also available from [http://www.usbfirewire.com/Parts/rr-2mb-020.html www.usbfirewire.com].&lt;br /&gt;
&lt;br /&gt;
Adapter $1.45 including worldwide shipping, http://www.dealextreme.com/details.dx/sku.26783 --[[User:Schorhr|Schorhr]] 05:24, 16 September 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== How to make a mini type B plug to a type A jack cable ===&lt;br /&gt;
&lt;br /&gt;
(picture, as soon as I build it)&lt;br /&gt;
&lt;br /&gt;
Parts list:&lt;br /&gt;
&lt;br /&gt;
* Mini type B plug: Digi-Key [[http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=H2958-ND H2958-ND]]&lt;br /&gt;
* type A jack: I have not yet been able to find a source for these. Meanwhile, use the jack from a standard USB extension cord&lt;br /&gt;
* Cable: Ideally, the data lines should be twisted and 28 AWG, the power lines should be 20 or 28 AWG, e.g. Hitachi Cable [[http://www.hcm.hitachi.com/electronic_round_cable/bulk-usb-cable.shtml 49248 ]]&lt;br /&gt;
&lt;br /&gt;
Construction instructions:&lt;br /&gt;
&lt;br /&gt;
(TBA)&lt;br /&gt;
&lt;br /&gt;
=== Ready-made type A jack to a type A jack adapter (gender changer) ===&lt;br /&gt;
&lt;br /&gt;
You can buy [[http://www.jaykang.com/usbtyfetotyf.html this]] ready-made USB Type A Female to Female Gender Changer.&lt;br /&gt;
[[Image:jaykang_usbtyfetotyf.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
=== How to make a type A jack to a type A jack adapter (gender changer) ===&lt;br /&gt;
&lt;br /&gt;
This community provided instruction shows how to build an adapter from a USB socket salvaged from a computer motherboard.&lt;br /&gt;
&lt;br /&gt;
Note that these instructions are provided in the hope that they are useful but without any warranty!&lt;br /&gt;
&lt;br /&gt;
[[Image:2-usb-receptables.jpg|thumb|none]]&lt;br /&gt;
&lt;br /&gt;
:#Find an old motherboard with a set of two USB receptacles as shown above.&lt;br /&gt;
:#Desolder this set of receptacles from the motherboard. This can be bit tricky but it is doable at least with a desoldering gun.  Solder braid (available at electronic parts stores including Radio Shack) works better than even a professional desoldering gun and is a lot cheaper.&lt;br /&gt;
:#Each receptacle has four pins. Use a multimeter to verify that you have no short circuits between the pins or the shield.&lt;br /&gt;
:#Solder adjacent pins together (GND to GND, D- to D-, D+ to D+, VCC to VCC).&lt;br /&gt;
:#(Optional) Build a test cable. Cut an USB cable with A plug into half, connect it a receptacle and again measure that you have no short circuits. Then connect the test cable to PC and verify that you see&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red +5V&lt;br /&gt;
:#FreeRunner is shipped with a mini-B-to-A-plug cable. Connect this to a receptacle.&lt;br /&gt;
:#(Optional)Connect test cable to the other receptacle and verify that you see&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red 0V&lt;br /&gt;
when freerunner acts as a device and&lt;br /&gt;
*black GND&lt;br /&gt;
*green 0V&lt;br /&gt;
*white 0V&lt;br /&gt;
*red +5V&lt;br /&gt;
when it acts as a host.&lt;br /&gt;
:#At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter. Here's how the setup should look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Usb-gender-changer1.jpg&lt;br /&gt;
Image:Usb-gender-changer2.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to make a type A jack to a type A jack adapter (gender changer) without soldering ===&lt;br /&gt;
&lt;br /&gt;
:#Find a 2-port USB front-panel with a 9-pin connector. Usually you can get one from a PC motherboard package box.&lt;br /&gt;
:#Align it in a way so you see the connector pins as a 2 row 5 column matrix with one pin missing.&lt;br /&gt;
:#Use 4 staples to short the pins residing in a same column.&lt;br /&gt;
:#FreeRunner is shipped with a mini-B-to-A-plug cable. Use it to connect the first port of your panel with your FreeRunner.&lt;br /&gt;
:#At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter.&lt;br /&gt;
&lt;br /&gt;
If you have a ASUS USB/MIR front panel, it is even easier - you can use jumpers to short the pins.&lt;br /&gt;
&lt;br /&gt;
[[Image:asususb.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Compatibility ===&lt;br /&gt;
&lt;br /&gt;
The adapter works with kingston data traveller 4G memory stick and aiptec pencam webcam. However, for some reason (probably the missing 15k resistors at D+ and D-) it did not work with any of the tested USB keyboards or mice:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 24&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 25&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: device descriptor read/64, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 26&lt;br /&gt;
usb 1-2: device not accepting address 26, error -62&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 27&lt;br /&gt;
usb 1-2: device not accepting address 27, error -62&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, if I connect neo to small (unpowered) USB hub&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2: new full speed USB device using s3c2410-ohci and address 61&lt;br /&gt;
usb 1-2: configuration #1 chosen from 1 choice&lt;br /&gt;
hub 1-2:1.0: USB hub found&lt;br /&gt;
hub 1-2:1.0: 4 ports detected&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and connect the keyboard to the hub then it is correctly recognized:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb 1-2.3: new low speed USB device using s3c2410-ohci and address 62&lt;br /&gt;
usb 1-2.3: configuration #1 chosen from 1 choice&lt;br /&gt;
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.0/input/input13&lt;br /&gt;
input: USB HID v1.10 Keyboard [  USB Keyboard] on usb-s3c24xx-2.3&lt;br /&gt;
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.1/input/input14&lt;br /&gt;
input: USB HID v1.10 Device [  USB Keyboard] on usb-s3c24xx-2.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With the hub I can also use both keyboard and usb memory stick at the same time.&lt;br /&gt;
&lt;br /&gt;
==== Power consumption ====&lt;br /&gt;
&lt;br /&gt;
When I unplug the USB hub (with only keyboard connected to it) the power consumption estimate at /sys/devices/platform/bq2700-battery.0/power_supply/bat/current_now decreases from 175000 to 145000 (are these microamperes?).&lt;br /&gt;
&lt;br /&gt;
== Buy a USB Y cable for powering USB devices and charging the Freerunner while in host mode ==&lt;br /&gt;
&lt;br /&gt;
You do not need to make a cable, you can just buy a &amp;quot;USB 2.0 Dual Power Cable, 2 x Type A to mini B&amp;quot; from [http://www.lindy.co.uk/1m-usb-2-dual-power-cable-2-x-type-a-50cm-apart-to-mini-b/31782.html lindy]. You then plug (via an adapter) the central plug of the Y cable into the upstream port (B socket or A plug) of your powered USB hub, the other A plug of the Y cable into one of the A sockets of your hub, and the mini-B plug of the Y cable into your Freerunner. Put your Freerunner into USB unpowered host mode. It will charge and you can plug a keyboard, a mouse, a disk, cable modem, etc, into the hub.&lt;br /&gt;
&lt;br /&gt;
Adapters, [http://www.rueducommerce.fr/Accessoires-Consommables/Cables-USB/Adaptateurs-convertisseurs/-/MO-35F4EM2168156-Adaptateur-Usb-type-A-Femelle-type-B-Male.htm A female to B male] or [http://www.rueducommerce.fr/Accessoires-Consommables/Cables-USB/Adaptateurs-convertisseurs/-/MO-B7A48M2167837-Changeur-Usb-type-A-Femelle-Femelle.htm A female to A female], are easy to find on the net. You will need a &amp;quot;A female to B male&amp;quot; if your hub has a type B socket or a &amp;quot;A female to A female&amp;quot; if your hub has a type A plug.&lt;br /&gt;
&lt;br /&gt;
another store : [http://www.picco.nl/product_info.php?products_id=1758 picco.nl]&lt;br /&gt;
&lt;br /&gt;
== How to make a USB cable for powering attached USB devices and charging the Neo while in host mode (aka Y-Cable) ==&lt;br /&gt;
&lt;br /&gt;
{{note|work in progress}}&lt;br /&gt;
&lt;br /&gt;
This method was invented by [[User:JOERG|Joerg Reisenweber]], and was&lt;br /&gt;
since implemented practically by many community members. See&lt;br /&gt;
http://lists.openmoko.org/pipermail/community/2008-March/013978.html .&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
You can find some pictures (schematics, parts and part numbers&lt;br /&gt;
at http://om.quatrox.org/om/ but be careful!!!&lt;br /&gt;
Report any bugs to quatrox&lt;br /&gt;
(irc #openmoko, #openmoko-cdevel, #ocp at freenode.org)&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This cable might be necessary for a number of reasons, e.g.&lt;br /&gt;
&lt;br /&gt;
* The application requires that the Neo not become suspended&lt;br /&gt;
* The application requires long run time&lt;br /&gt;
* The attached USB device consumes a lot of power&lt;br /&gt;
&lt;br /&gt;
(However, as there is a wide range[http://permalink.gmane.org/gmane.comp.handhelds.openmoko.hardware/415]&lt;br /&gt;
of USB hubs out there, one might find power (on a powered USB hub)&lt;br /&gt;
is available already on the hub's mini USB 5 pin socket already, so not need a specialized cable after all!&lt;br /&gt;
Check with a test meter.)&lt;br /&gt;
&lt;br /&gt;
These instructions will show you how to make a cable with 3 ends:&lt;br /&gt;
&lt;br /&gt;
* A mini-USB type B cable for the Neo itself&lt;br /&gt;
* A cable of whatever type to go to your USB device.&lt;br /&gt;
* A cable going to a +5V +/-10%(max!) power supply with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.&lt;br /&gt;
&lt;br /&gt;
You connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device.&lt;br /&gt;
You have to connect 2 pcs  15k ohm resistors, one from D+ to ground, and one from D- to ground, to comply with USB-spec for hostmode, as Neo is switching off the internal resistors when you enable charging/powering over USB by asserting EN_USBHOST.&lt;br /&gt;
See schematics, LOCATION:49XX&lt;br /&gt;
&lt;br /&gt;
Just for reference, the USB wires from left to right are:&lt;br /&gt;
*Black: Power -&lt;br /&gt;
*Green: Data -&lt;br /&gt;
*White: Data +&lt;br /&gt;
*Red: Power +&lt;br /&gt;
&lt;br /&gt;
The Mini_USB-B connector has a fifth pin, the ID-pin.&lt;br /&gt;
This pin is supposed to be short to ground to signal FreeRunner to enter hostmode. For the Y-cable and enabling external power while in hostmode, you may connect a 47k ohm resistor from ID-pin to ground. This is the same trick the OM-wallcharger uses to signal to FreeRunner it can charge with 1A. Future kernels should switch to hostmode + external power when seeing this 47k resistor.&lt;br /&gt;
&lt;br /&gt;
===Parts===&lt;br /&gt;
USB 2.0 Plug type A to mini 5 pin USB Plug type B that should include the ID signal, so that you can add the 47k ohm resistor to ID-pin to trigger fast charging&lt;br /&gt;
&lt;br /&gt;
# [http://www.firefold.com/Products/6-Foot-USB-20-Plug-type-A-to-mini-USB-Plug-type-B-5-pin-Cable---Black__USB-5PMINI-6.aspx firefold]&lt;br /&gt;
# Belkin 5 pin (find reference)&lt;br /&gt;
#https://www.argentdata.com/catalog/product_info.php?products_id=111&lt;br /&gt;
#http://www.partsdata.de/USB_Mini-B-Verlaengerung_Kabel_1m_CU-XB05-10.html&lt;br /&gt;
&lt;br /&gt;
== USB hubs that can be used like a Y-cable without modifications ==&lt;br /&gt;
&lt;br /&gt;
[http://www.dealextreme.com/details.dx/sku.13526 Cable Style Dual-Power 1000mA USB 2.0 4-Port Hub]. Connect power source to the red upstream connector and openmoko to the black upstream connector. Then connect USB devices to the downstream ports. After settings usb_mode=host the openmoko will charge and will still be able to talk to the downstream ports.&amp;lt;br&amp;gt;&lt;br /&gt;
also available on ebay: [http://cgi.ebay.com/High-Speed-Smart-3-Ports-USB-Hub-5-Pin-Cable-for-PC_W0QQitemZ260567368077QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item3cab06818d]&lt;br /&gt;
&lt;br /&gt;
==  USB reduction with own power source  ==&lt;br /&gt;
To this [http://multi.xeres.cz/elektronika/usb-redukce reduction with own power source] you can plug FreeRunner and USB device  and both power from solo battery.&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Neo FreeRunner Hardware]]&lt;br /&gt;
[[Category:Power]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T10:14:37Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: +Ubuntu karmic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
=== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ===&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an USB port. '''udev''' and the older '''Hotplug''' system.&lt;br /&gt;
 &lt;br /&gt;
=== Systems using '''udev''' ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common ways the USB networking device can be handled by your systems.&lt;br /&gt;
&lt;br /&gt;
If there is a definition for the USB networking device in /etc/network/interfaces, it is handled by the '''ifupdown''' system. If not, it is handled by '''NetworkManager'''.&lt;br /&gt;
&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
===Systems using''' hotplug''' - Using the interfaces file ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.10 - the Karmic Koala ===&lt;br /&gt;
&lt;br /&gt;
Karmic has a bug in one of the upstart scripts, that makes it fail to properly bring down an unplugged network device (not just USB networking).&lt;br /&gt;
&lt;br /&gt;
Edit /etc/init/network-interface.conf and replace this line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;stop on net-device-removed INTERFACE=$INTERFACE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... with this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;stop on net-device-remove INTERFACE=$INTERFACE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use /etc/network/interfaces, make sure the device is marked 'auto'. Plugging and unplugging will then work automagically. &lt;br /&gt;
&lt;br /&gt;
('allow-hotplug' doesn't work, because upstart on ubuntu doesn't support 'allow-hotplug' defined devices)&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope === &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T10:03:49Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Using the interfaces file- works on systems using hotplug */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
=== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ===&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an USB port. '''udev''' and the older '''Hotplug''' system.&lt;br /&gt;
 &lt;br /&gt;
=== Systems using '''udev''' ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common ways the USB networking device can be handled by your systems.&lt;br /&gt;
&lt;br /&gt;
If there is a definition for the USB networking device in /etc/network/interfaces, it is handled by the '''ifupdown''' system. If not, it is handled by '''NetworkManager'''.&lt;br /&gt;
&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
===Systems using''' hotplug''' - Using the interfaces file ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T10:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Systems using udev */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
=== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ===&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an USB port. '''udev''' and the older '''Hotplug''' system.&lt;br /&gt;
 &lt;br /&gt;
=== Systems using '''udev''' ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common ways the USB networking device can be handled by your systems.&lt;br /&gt;
&lt;br /&gt;
If there is a definition for the USB networking device in /etc/network/interfaces, it is handled by the '''ifupdown''' system. If not, it is handled by '''NetworkManager'''.&lt;br /&gt;
&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T10:01:14Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Debian, Ubuntu and others */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
=== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ===&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an USB port. '''udev''' and the older '''Hotplug''' system.&lt;br /&gt;
 &lt;br /&gt;
=== Systems using '''udev''' ===&lt;br /&gt;
&lt;br /&gt;
There are 2 common ways the USB networking device can be handled by your systems.&lt;br /&gt;
&lt;br /&gt;
If there is a definition for the USB networking device in /etc/network/interfaces, it is handled by the '''ifupdown''' system. If not, it is handled by NetworkManager.&lt;br /&gt;
&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T09:41:43Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Openmoko Networking Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
=== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ===&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an &amp;lt;usb port. '''Hotplug''', and more recent system '''udev'''.&lt;br /&gt;
 &lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Using network-manager on systems using '''udev''' ===&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
Depending on which boot loader your device is running it shows as either usb0 or eth1 (or 2). Choose the next section based on which it is for you. uBoot or old version of Qi show as usb0, the newer versions of Qi show as eth1.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T09:40:37Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Openmoko Networking Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
=== Suspend ===&lt;br /&gt;
&lt;br /&gt;
When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ==&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
=== My distro ===&lt;br /&gt;
&lt;br /&gt;
There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an &amp;lt;usb port. '''Hotplug''', and more recent system '''udev'''.&lt;br /&gt;
 &lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Using network-manager on systems using '''udev''' ===&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
Depending on which boot loader your device is running it shows as either usb0 or eth1 (or 2). Choose the next section based on which it is for you. uBoot or old version of Qi show as usb0, the newer versions of Qi show as eth1.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T09:34:19Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Ubuntu 9.04 - the Jaunty Jackalope -- udev */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
* When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
* There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ==&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an &amp;lt;usb port. '''Hotplug''', and more recent system '''udev'''.&lt;br /&gt;
 &lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Using network-manager on systems using '''udev''' ===&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
Depending on which boot loader your device is running it shows as either usb0 or eth1 (or 2). Choose the next section based on which it is for you. uBoot or old version of Qi show as usb0, the newer versions of Qi show as eth1.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1''' (or '''eth2''' etc.). Go to System-&amp;gt;Administration-&amp;gt;Network (or edit /etc/network/interfaces) and add the parameters for eth1; static ip 192.168.0.200, netmask 255.255.255.192&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/USB_Networking</id>
		<title>USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/USB_Networking"/>
				<updated>2010-01-14T09:27:34Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: removed too technical stuff in 2nd paragraph, which was too specific for (old) distros anyway&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:USB software]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
&lt;br /&gt;
{{Languages|USB_Networking}}&lt;br /&gt;
&lt;br /&gt;
{|align=left&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Openmoko Networking Setup =&lt;br /&gt;
&lt;br /&gt;
In order to communicate via TCP/IP to your FreeRunner, a basic understanding of the networking expectations is required.  Each end of the USB connection forms a LAN (local area network) segment, with the FreeRunner's USB networking device at one end (default 192.168.0.202) and your laptop or desktop at the other end (192.168.0.200 in this guide).&lt;br /&gt;
&lt;br /&gt;
Normally, your desktop machine will know how to reach the Internet, having had its gateway (the IP address of the machine or device which knows how to send packets to machines beyond your subnet) configured via DHCP or statically (probably via a router).  For the FreeRunner to reach the Internet, your desktop will have to be configured to route and masquerade (NAT) packets from it.&lt;br /&gt;
&lt;br /&gt;
Normally, none of this is an issue, but problems can arise when the subnet between the FreeRunner and your desktop overlap with the desktop to the router (which forms a second LAN), since your desktop might not know how to route traffic properly.&lt;br /&gt;
&lt;br /&gt;
In other words: if your existing router and desktop have addresses 192.168.0.(something) changing them to e.g. 192.168.1.(something) might save you a lot of troubleshooting later. A discussion of this is [http://lists.openmoko.org/pipermail/support/2008-August/thread.html#1277 here].&lt;br /&gt;
&lt;br /&gt;
== Things to keep in mind ==&lt;br /&gt;
&lt;br /&gt;
* When the FreeRunner suspends it disables its USB networking interface. Therefore it is a good idea to turn off the FreeRunners suspend function when using USB networking.&lt;br /&gt;
&lt;br /&gt;
* There are many differences between distributions, both on the phone and an the desktop. Also within a single distribution there can be big changes over time, so remember that solutions provided here might not always exactly match your situation.&lt;br /&gt;
&lt;br /&gt;
== So is it &amp;quot;usb0&amp;quot; or is it &amp;quot;eth1&amp;quot;? ==&lt;br /&gt;
&lt;br /&gt;
* The documentation below refers to the network interface name on the host side as &amp;quot;usb0&amp;quot;.  However, the actual name is determined by your host system, and many host systems will rename the interface based on the mac (or hardware) address presented by the Neo or Freerunner.  Use the &amp;quot;ifconfig -a&amp;quot; command, or use &amp;quot;dmesg&amp;quot; to examine the output from your host's kernel, to find which interface name was actually assigned to your device.  If it wasn't &amp;quot;usb0&amp;quot;, it will almost always be the next available &amp;quot;eth''n''&amp;quot; name.&lt;br /&gt;
&lt;br /&gt;
In all the steps below where you see the interface referred to as &amp;quot;usb0&amp;quot;, you may need to substitute the interface name that your host assigned.&lt;br /&gt;
&lt;br /&gt;
For those interested in the technical details, the &amp;quot;usb0&amp;quot; interface name is used on the host system when the mac (hardware) address presented by the Freerunner or Neo is a locally-generated (random) address.  Because the address is random, the ability to easily manage the interface with network managment tools is somewhat compromised. In fact, the Freerunner has been assigned official mac addresses, including addresses for the USB network interface.  When these addresses are correctly used on the Freerunner (which is the case with the Qi bootloader, and with certain of the distros for the Freerunner), then the host system sees official mac addresses, and responds by configuring a permanent network interface for that device.  By convention, this permanent interface is one of the &amp;quot;eth&amp;quot; interfaces.  The specific interface name chosen will be remembered, and will be used each time that specific Freerunner is connected, and used only for that Freerunner.  This is a particularly useful feature for users who have multiple USB-networked devices.&lt;br /&gt;
&lt;br /&gt;
As of the time of this writing, the Android and SHR distros will correctly pass the official mac address to the host, and will appear as &amp;quot;eth''n''&amp;quot; interfaces on the host.&lt;br /&gt;
&lt;br /&gt;
= Simple Manual Linux Configuration =&lt;br /&gt;
Try this first (as root on your desktop, with FreeRunner attached via USB cable and booted properly, not at the Boot Menu).  If it works, then you can add permanent configuration or use more sophisticated setups below.&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions (Fedora, SuSE, Red Hat, Debian and others) and network configurations. It was even successfully applied to connect another Linux based handhelds like TDS Nomad and surely can be recommended as the first attempt. The way assumes that you have the recent Linux distribution with USB networking enabled and also rather typical network setup. &lt;br /&gt;
&lt;br /&gt;
With the device connected configure usb0 interface (as root or via sudo like in this example):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ip address add 192.168.0.200/24 dev usb0&lt;br /&gt;
sudo ip link set dev usb0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo route add -host 192.168.0.202 dev usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The login ===&lt;br /&gt;
&lt;br /&gt;
Log in to the Neo (you do not need to be a root on the desktop host just to log in).&lt;br /&gt;
 $ ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
On some SHR Version the default root password is blank.&lt;br /&gt;
&lt;br /&gt;
'''If you get an error like: &amp;quot;Permission denied, please try again.&amp;quot; try to set a new password on the phone:'''&lt;br /&gt;
&lt;br /&gt;
open a terminal on the phone and type:&lt;br /&gt;
&lt;br /&gt;
 passwd&lt;br /&gt;
&lt;br /&gt;
then enter a new password and establish a new ssh connection.&lt;br /&gt;
&lt;br /&gt;
Note that an '''empty passwords''' won't work on some SHR releases!&lt;br /&gt;
&lt;br /&gt;
Do not forget to allow ssh (open the port 22) on your firewall so that you can connect to the device. If you suspect any firewall issues, the simplest way is to unplug the main Internet cable leaving only Neo connected and then temporary turn the firewall off.&lt;br /&gt;
&lt;br /&gt;
Also, some old or narrowly configured Linux distributions may not have USB networking support. For such cases the simple way might be just to upgrade.&lt;br /&gt;
&lt;br /&gt;
=== The more advanced way ===&lt;br /&gt;
If the previously described simple approach does not work, you may try the more complex one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
ip addr add 192.168.0.200/24 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your Internet connection is also in the range 192.168.0.x then instead you might want to use only:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ip addr add 192.168.0.200/28 dev usb0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(This will just map the net from 192.168.0.192 to 192.168.0.207 onto usb0. If you get the error 'Cannot find device &amp;quot;usb0&amp;quot;', double-check that your FreeRunner is turned on and connected by USB. Ensure also that the uhci_hcd module is loaded on your PC. If that doesn't work, try unplugging and replugging the USB cable.)&lt;br /&gt;
&lt;br /&gt;
And in this case you should enable ARP proxy on internet facing interface INSTEAD of using iptables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl net.ipv4.conf.eth2.proxy_arp=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This assuming that eth2 is connected to ISP.&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&amp;lt;pre&amp;gt;ip link set usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
or (deprecated)&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig usb0 up&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then (ideally, not as root):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ssh root@192.168.0.202&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Due to the fact that in most cases your Neo will use the same dns servers as your computer uses, you can automate the process of writing dns servers to your phone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
/sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again if your net already is 192.168.0.0, replace the POSTROUTING statement with&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/28&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This simple script will set up routing for your Freerunner and than copy resolv.conf with dns addresses straight to the phone.&lt;br /&gt;
All you have to do is connect phone to the computer, run the script and enjoy internet connection from your phone.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Neo IP address ===&lt;br /&gt;
&lt;br /&gt;
Like mentioned above, if the default Neo subnet 192.168.0.X is already used, it might be necessary to change the&lt;br /&gt;
Neo [http://en.wikipedia.org/wiki/IP_address IP adress] and subnet.&lt;br /&gt;
To achieve this, edit /etc/network/interfaces on the Neo (and reboot /etc/init.d/networking).&lt;br /&gt;
In the following example the Neo will use the IP address 192.168.100.1 (instead of the default 192.168.0.202)&lt;br /&gt;
within the network 192.168.100.X (instead of 192.168.0.X),&lt;br /&gt;
another [http://en.wikipedia.org/wiki/Private_network private] class C network.&lt;br /&gt;
(The [http://en.wikipedia.org/wiki/Subnetwork#Binary_subnet_masks netmask] indicates that the first 3 bytes (all bits set) are used to determine the subnet&lt;br /&gt;
and the last byte (no bits set) to determine the machine.)&lt;br /&gt;
The gateway (the computer, the Neo is attached to) also has to be part of the subnet and is expected to be 192.168.100.200 (instead of 192.168.0.200) here.&lt;br /&gt;
&lt;br /&gt;
Modifications for /etc/network/interfaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.100.1&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.100.0&lt;br /&gt;
        gateway 192.168.100.200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The network entry seems to be redundant information, since it can be derived from address and netmask?)&lt;br /&gt;
Note that wiki articles usually expect default settings and you have to adjust the IP adress, gateway, etc entries according to your changes.&lt;br /&gt;
&lt;br /&gt;
= Linux Kernel Support =&lt;br /&gt;
&lt;br /&gt;
Your Linux desktop/laptop needs to have suitable support. In particular you will need to have enabled USB networking and masquerading support in the kernel. For default kernels in many Linux distributions this will already be the case.&lt;br /&gt;
&lt;br /&gt;
== USB Networking support ==&lt;br /&gt;
&lt;br /&gt;
The following options need to be enabled:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET (''Multi-purpose USB Networking Framework''. Module will be called &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER (''CDC Ethernet support''. Module will be called &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
These options are available in ''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters'' or ''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters.&lt;br /&gt;
&lt;br /&gt;
In order for USB networking to work you need to load the &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; module (when loading &amp;lt;tt&amp;gt;cdc_ether&amp;lt;/tt&amp;gt; the module &amp;lt;tt&amp;gt;usbnet&amp;lt;/tt&amp;gt; will be loaded automatically). For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Olamba&lt;br /&gt;
&lt;br /&gt;
== Masquerading support ==&lt;br /&gt;
&lt;br /&gt;
Masquerading options are found in ''Networking ---&amp;gt; Networking options ---&amp;gt;'' (tested on Linux 2.6.26.3).&lt;br /&gt;
&lt;br /&gt;
To enable the needed options you first have to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NETFILTER (''Network packet filtering framework (Netfilter)'')&lt;br /&gt;
&lt;br /&gt;
Then, from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
Core Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need at least following options enabled as modules:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK (''Netfilter connection tracking support'')&lt;br /&gt;
* CONFIG_NF_CONNTRACK_FTP (''FTP protocol support'')&lt;br /&gt;
* CONFIG_NETFILTER_XTABLES (''Netfilter Xtables support'')&lt;br /&gt;
&lt;br /&gt;
Rest of the needed options are found from&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;&lt;br /&gt;
[*] Network packet filtering framework (Netfilter) ---&amp;gt;&lt;br /&gt;
IP: Netfilter Configuration ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to enable (again, as modules is fine):&lt;br /&gt;
&lt;br /&gt;
* CONFIG_NF_CONNTRACK_IPV4 (''IPv4 connection tracking support (required for NAT)'')&lt;br /&gt;
* CONFIG_IP_NF_IPTABLES (''IP tables support (required for filtering/masq/NAT)'')&lt;br /&gt;
* CONFIG_NF_NAT (''Full NAT'')&lt;br /&gt;
* CONFIG_IP_NF_TARGET_MASQUERADE (''MASQUERADE target support'')&lt;br /&gt;
&lt;br /&gt;
= Firewall Issues =&lt;br /&gt;
&lt;br /&gt;
On some systems, you may have firewall rules which prevent this working - such as added by the iptables service on Fedora.  You may care to stop these, and/or review any rules or policies you think might cause issues.&lt;br /&gt;
&lt;br /&gt;
The most relevant table is the nat table, which controls translation of addresses:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t nat -v -n&lt;br /&gt;
&lt;br /&gt;
Unless you have a special setup, you'll want to see only the MASQUERADE rule that you apply below, and ACCEPT as the default policy.  Also look at the filter table:&lt;br /&gt;
&lt;br /&gt;
iptables -L -t filter -v -n&lt;br /&gt;
&lt;br /&gt;
If this contains anything in the FORWARD chain, then this may prevent passing packets.  It can be flushed with:&lt;br /&gt;
&lt;br /&gt;
iptables -t filter -F FORWARD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Other Issues =&lt;br /&gt;
&lt;br /&gt;
In case the Freerunner was recognized and you could assign the IP address to the device, but you get after trying to connect with 'ssh root@192.168.0.202' an error like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ssh: connect to host 192.168.0.202 port 22: No route to host &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then your USB cable could be broken. Try to connect with another cable.&lt;br /&gt;
&lt;br /&gt;
== Regular drop-outs ==&lt;br /&gt;
If you've connected, and your connection keeps dropping and then coming back up, make sure that you don't have automatic wireless network connections - in some distros, the the wireless connection scripts automatically disable the usb network interface.&lt;br /&gt;
&lt;br /&gt;
= DNS =&lt;br /&gt;
&lt;br /&gt;
In addition to routing issues, to be practical, DNS will need to work.  In some cases, you might already be running a DNS server on your desktop such as dnsmasq or bind9, which is the default assumption the FreeRunner makes.  In other cases, you'll need to configure DNS to that of your router, or a DNS server further out on the internet such as that provided by your ISP.&lt;br /&gt;
&lt;br /&gt;
== Configure Default Neo DNS ==&lt;br /&gt;
&lt;br /&gt;
DNS is configured in /etc/resolv.conf on your FreeRunner.&lt;br /&gt;
&lt;br /&gt;
You should add the IP address of the DNS servers as provided by your ISP. Check your router's or PC's network status for the nameserver IP addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver xxx.xxx.xxx.xxx &amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add the public DNS server called openDNS:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These settings will be lost on reboot. You can set the DNS for the next connect, by adding the following to the end of the usb0 setting in /etc/network/interfaces, right above the bluetooth networking section:&lt;br /&gt;
&amp;lt;pre&amp;gt;up echo nameserver 208.67.222.222 &amp;gt; /etc/resolv.conf&lt;br /&gt;
up echo nameserver 208.67.220.220 &amp;gt;&amp;gt; /etc/resolv.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS from Desktop/Laptop ==&lt;br /&gt;
&lt;br /&gt;
If you move about, making assumptions about the network may not be convenient, and it is possible to proxy DNS requests via your host laptop (which you are also taking with you), without running or installing a DNS server.  There are a number of ways to do this:&lt;br /&gt;
&lt;br /&gt;
=== Proxying with dnrd ===&lt;br /&gt;
&lt;br /&gt;
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the DNS proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.&lt;br /&gt;
&lt;br /&gt;
=== Proxying with a UDP forwarder ===&lt;br /&gt;
&lt;br /&gt;
Another easy setup is using a UDP forwarder like the one from http://www.tapor.com/udpf/ - use it with the command&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;udpf-elf -p=53-f=`awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf`:53&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
&lt;br /&gt;
It is possible to forward DNS requests with iptables using the DNAT target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&lt;br /&gt;
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;192.168.0.1&amp;lt;/tt&amp;gt; is the IP of your router.&lt;br /&gt;
&lt;br /&gt;
Test if it works:&lt;br /&gt;
&amp;lt;pre&amp;gt;ping www.google.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If so, then this is sufficient for most internet access. But manual changes to resolv.conf are usually lost later if for example one uses DHCP, especially for WiFi, and so may not be convenient to configure manually.&lt;br /&gt;
&lt;br /&gt;
= Testing Your Connection =&lt;br /&gt;
You should be able to connect to your Neo! Make sure you can ping your Neo to be sure.&lt;br /&gt;
ping 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then log into your Neo using ssh:&lt;br /&gt;
ssh root@192.168.0.202&lt;br /&gt;
The default password is blank (press enter).&lt;br /&gt;
&lt;br /&gt;
You can also [[scp]] files back and forth. You can telnet, SSH, SMB or do whatever you want if you install software that enables you to set up TCP/IP network over your USB connection.&lt;br /&gt;
&lt;br /&gt;
Now, make sure you can ping back to your desktop&lt;br /&gt;
ping 192.168.0.200&lt;br /&gt;
(Note that some systems like Vista, don't respond to ICMP ping by default)&lt;br /&gt;
&lt;br /&gt;
Try pinging the outside world (a Google IP address)&lt;br /&gt;
ping 74.125.19.147&lt;br /&gt;
This demonstrates that masquerading is working - your desktop is sending/receiving packets to the wider internet.&lt;br /&gt;
&lt;br /&gt;
Lastly, verify that DNS is correctly configured between the Neo &amp;amp; Network:&lt;br /&gt;
ping www.google.com&lt;br /&gt;
&lt;br /&gt;
== Connection script ==&lt;br /&gt;
With the contents of this page [[User:Cristianpark|I]] made [http://www.mediafire.com/download.php?zm0gtz2tyjq this script] to easily get your FreeRunner connected with your PC.&lt;br /&gt;
&lt;br /&gt;
All you have to do is run the script (after connect the FR to the PC):&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo sh usb_networking.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
You have to:&lt;br /&gt;
# Disconnect FreeRunner&lt;br /&gt;
# Connect it again&lt;br /&gt;
# Re-run the script and voila the connection is there!&lt;br /&gt;
&lt;br /&gt;
; Notes &lt;br /&gt;
* It needs root privileges to be executed for the iptables and sysctl commands (if you don't like sudo, login as root instead)&lt;br /&gt;
* It uses the eth1 interface so on OM and other distros different from SHR, you have to put usb0&lt;br /&gt;
* Thanks to Tony Berth: if the first time you run the script you can't ping/access 192.168.0.202.&lt;br /&gt;
&lt;br /&gt;
= OS or Distro Specific &amp;amp; Automatic Configuration =&lt;br /&gt;
&lt;br /&gt;
Based on [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
These instructions should keep you from having to run the Simple Manual Linux Configuration every time you plug in and want to connect to an Openmoko device.  One run and then you're done!&lt;br /&gt;
&lt;br /&gt;
If the Simple Manual Linux Configuration does not work for your OS or Distro (MacOS X, MS Windows, etc) there may be instructions here that work for you.&lt;br /&gt;
&lt;br /&gt;
== MacOS X ==&lt;br /&gt;
See [[MacOS_X#USB_Networking|MacOS X USB Networking]].&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
See [[Neo1973_and_Windows#USB_Ethernet_emulation|Windows USB Ethernet emulation for Neo1973]].&lt;br /&gt;
&lt;br /&gt;
There is also a very helpful tutorial for connecting with Vista at [http://sam.curren.ws/index.cfm/2008/7/14/Using-the-Neo-FreeRunner-with-Windows-XPVista].&lt;br /&gt;
&lt;br /&gt;
== FreeBSD ==&lt;br /&gt;
You need to load the cdce kernel module (if it is not already linked into your kernel). As root do:&lt;br /&gt;
&lt;br /&gt;
 # kldload cdce&lt;br /&gt;
&lt;br /&gt;
The Neo should then show up as cdce0 interface and you can handle the cdce0 interface just like the usb0 device under Linux. For more information see the cdce manpage. An easy way to assign the IP address to the cdce0 interface is using the devd(8) daemon. Create the following two files,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.conf&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notify 1 {&lt;br /&gt;
match &amp;quot;system&amp;quot;          &amp;quot;IFNET&amp;quot;;&lt;br /&gt;
match &amp;quot;subsystem&amp;quot;       &amp;quot;cdce0&amp;quot;;&lt;br /&gt;
match &amp;quot;type&amp;quot;            &amp;quot;ATTACH&amp;quot;;&lt;br /&gt;
action &amp;quot;/usr/local/etc/devd/cdce.sh $subsystem $type&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;/usr/local/etc/devd/cdce.sh&amp;lt;/tt&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case $2 in&lt;br /&gt;
'ATTACH')&lt;br /&gt;
ifconfig cdce0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
exit 0 ;&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart the devd(8) daemon with:&lt;br /&gt;
&lt;br /&gt;
 # /etc/rc.d/devd restart&lt;br /&gt;
&lt;br /&gt;
If you now plugin the FreeRunner into the USB port the cdce0 interface gets created and the IP addr will be assigned.&lt;br /&gt;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&lt;br /&gt;
There are two systems which deal with hotplugginng devices, which is what you do when you plug in Freerunner in an &amp;lt;usb port. '''Hotplug''', and more recent system '''udev'''.&lt;br /&gt;
 &lt;br /&gt;
===Using the interfaces file- works on systems using''' hotplug''' ===&lt;br /&gt;
Edit /etc/network/interfaces and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is more sophisticated than the manual setup.  The 'auto usb' stanza ties into the Linux hotplug system so that when the device appears and vanishes, as happens when the FreeRunner is connected via USB, this is run.&lt;br /&gt;
&lt;br /&gt;
In addition, the desktop-side netmask is limited to a much smaller range, so that overlapping subnets are less of a problem - Linux will use more specific routes first when deciding where to send packets.&lt;br /&gt;
&lt;br /&gt;
Another possible configuration that adds DNS forward and removes&lt;br /&gt;
the iptables changes after unplugging:&lt;br /&gt;
&lt;br /&gt;
in /etc/network/interfaces add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# freerunner&lt;br /&gt;
allow-hotplug usb0&lt;br /&gt;
iface usb0 inet static&lt;br /&gt;
        address 192.168.0.200&lt;br /&gt;
        netmask 255.255.255.192&lt;br /&gt;
        post-up /etc/network/freerunner start&lt;br /&gt;
        pre-down /etc/network/freerunner stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
create file /etc/network/freerunner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# configures the freerunner for internet&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
REMOTE_IPADDR=192.168.0.202&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# get first ip for dns&lt;br /&gt;
DNSIP=$(awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}' /etc/resolv.conf)&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$(cat /proc/sys/net/ipv4/ip_forward)&amp;quot; = &amp;quot;0&amp;quot; ]; then&lt;br /&gt;
echo &amp;quot;temoprarely allow ip_forward for openmoko&amp;quot; &amp;gt; /var/run/openmoko.ip_forward&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR&lt;br /&gt;
iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR --dport domain -j DNAT --to-destination $DNSIP&lt;br /&gt;
&lt;br /&gt;
if [ -f /var/run/openmoko.ip_forward ]; then&lt;br /&gt;
rm /var/run/openmoko.ip_forward&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
fi&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make /etc/network/freerunner executable with&lt;br /&gt;
 chmod +x /etc/network/freerunner&lt;br /&gt;
&lt;br /&gt;
=== Using network-manager on systems using '''udev''' ===&lt;br /&gt;
It is possible to use network-manager to automatically connect to the Freerunner using udev. The process uses udev to run a script when the Freerunner is plugged in.&lt;br /&gt;
&lt;br /&gt;
Depending on which boot loader your device is running it shows as either usb0 or eth1 (or 2). Choose the next section based on which it is for you. uBoot or old version of Qi show as usb0, the newer versions of Qi show as eth1.&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as usb0 ====&lt;br /&gt;
&lt;br /&gt;
The script uses the ip command to set the mac address of the usb network interface.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# rule to assign a fixed mac address specified in /&lt;br /&gt;
KERNEL==&amp;quot;usb[0-9]*&amp;quot;, DRIVERS==&amp;quot;cdc_ether&amp;quot;, ACTION==&amp;quot;add&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh %k&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
ip link set &amp;quot;$1&amp;quot; address 00:00:22:55:bb:$busNum &amp;amp;&amp;gt; /dev/null&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For devices showing as eth1 ====&lt;br /&gt;
&lt;br /&gt;
This script allows ipforwarding so your device can access the internet through your pc.&lt;br /&gt;
&lt;br /&gt;
To begin, create /etc/udev/rules.d/80-freerunner.rules replacing the mac address with the one from your device (run ifconfig on the pc, or use udevinfo, note that it must match udev's case):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This file causes programs to be run on device insertion.&lt;br /&gt;
# See udev(7) for syntax.&lt;br /&gt;
# http://www.reactivated.net/writing_udev_rules.html#example-netif&lt;br /&gt;
KERNEL==&amp;quot;eth*&amp;quot;, ATTR{address}==&amp;quot;00:1f:11:01:28:d6&amp;quot;, RUN+=&amp;quot;/usr/local/sbin/freerunner-usb-add.sh&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, create the /usr/local/sbin/freerunner-usb-add.sh :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -P FORWARD ACCEPT&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== For all devices ====&lt;br /&gt;
Finally run &amp;quot;chmod +x /usr/local/sbin/freerunner-usb-add.sh&amp;quot; to make it executable. Now you can use network-manager with '''mac-address specific settings''' and get it to automatically connect.&lt;br /&gt;
&lt;br /&gt;
* Plug your phone into your computer's usb port.&lt;br /&gt;
* Note the mac address from &amp;quot;ifconfig usb0&amp;quot; (or eth1)&lt;br /&gt;
* Right-click the network manager icon in the panel.&lt;br /&gt;
* Click &amp;quot;Edit Connections...&amp;quot;&lt;br /&gt;
* Delete the &amp;quot;Auto usb0&amp;quot; entry. (or eth1)&lt;br /&gt;
* Add a new connection named 'freerunner' (or whatever you fancy) &lt;br /&gt;
* Tick &amp;quot;System setting&amp;quot;&lt;br /&gt;
* Enter the mac address from above.&lt;br /&gt;
* Click the &amp;quot;IPv4 Settings&amp;quot; tab.&lt;br /&gt;
* Change &amp;quot;Method&amp;quot; to &amp;quot;Manual&amp;quot;&lt;br /&gt;
* Add an address of 192.168.0.200, 255.255.255.0 (address and netmask respectively).&lt;br /&gt;
* Click &amp;quot;Ok&amp;quot;&lt;br /&gt;
* Enter your system password (if prompted) to allow changing of this system setting.&lt;br /&gt;
&lt;br /&gt;
(watch out for this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/284298 )&lt;br /&gt;
&lt;br /&gt;
You should now be able to ping/ssh your phone.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.04 - the Jaunty Jackalope -- udev=== &lt;br /&gt;
&lt;br /&gt;
One can see /etc/udev/rules.d that a device plugged in on USB will be called '''eth1'''. Go to system-&amp;gt;Administration-&amp;gt;Network and add the parameters for eth1 &amp;lt; static ip, address 192.168.0.200 mask 255.255.255.192 add your default gateway&amp;gt;. &lt;br /&gt;
Thats is all.&lt;br /&gt;
&lt;br /&gt;
Tested with Qi bootloader aka official MAC address of the Freerunner : on Android Koolu beta 7 &lt;br /&gt;
&lt;br /&gt;
Carig Philippines --[[User:Frank|frank]] 14:11, 17 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.10 - Easy Way === &lt;br /&gt;
&lt;br /&gt;
:1. Connect Neo to PC and wait about a minute when NetworkManager stops scanning usb for dhcp (wait when icon in the tray switches to normal).&lt;br /&gt;
&lt;br /&gt;
:2. Open &amp;quot;nm-connection-editor&amp;quot;, select &amp;quot;Auto usb0&amp;quot;, click &amp;quot;Edit&amp;quot;, then &amp;quot;IPv4 Settings&amp;quot;. Set &amp;quot;Method&amp;quot; - &amp;quot;Manual&amp;quot;, click &amp;quot;Add&amp;quot;. In the &amp;quot;Address&amp;quot; field write &amp;quot;192.168.0.200&amp;quot;, &amp;quot;Netmask&amp;quot; - &amp;quot;255.255.255.0&amp;quot;, leave &amp;quot;Gateway&amp;quot; field empty (or 0.0.0.0). Change the &amp;quot;Connection name&amp;quot; and click &amp;quot;Apply&amp;quot;, then &amp;quot;Close&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:3. Now you can connect via ssh to 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Note: After reflashing the Neo you have to copy the &amp;quot;MAC Address&amp;quot; from &amp;quot;Auto usb0&amp;quot; into your new connection.&lt;br /&gt;
&lt;br /&gt;
Then, based on [http://sebastian-bergmann.de/index.php?url=archives/801-OpenMoko-Freerunner-and-Ubuntu.html#feedback these instructions], you should be able to setup masquerading by running the following commands on your Ubuntu PC: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
sudo bash -c 'echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Issues ===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10 doesn't work as expected if you used /etc/network/interfaces to automate the connection.&amp;lt;br&amp;gt;&lt;br /&gt;
Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection.&lt;br /&gt;
Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the /usr/local/sbin/freerunner-usb-add.sh script for some automatism can be a workaround:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
(&lt;br /&gt;
ip address add 192.168.0.200/26 netmask dev usb0 &amp;gt; /dev/null&lt;br /&gt;
ip link set usb0 up &amp;gt; /dev/null&lt;br /&gt;
/etc/network/freerunner start&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty, Gutsy and Hardy reportedly have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.  This is mentioned at https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/130437&lt;br /&gt;
&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS==&amp;quot;*?&amp;quot; out of the top GOTO, to ACTION==&amp;quot;add&amp;quot; line fixes the problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, GOTO=&amp;quot;net_start&amp;quot;&lt;br /&gt;
GOTO=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Bring devices up and down only if they're marked auto.&lt;br /&gt;
# Use start-stop-daemon so we don't wait on dhcp&lt;br /&gt;
ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
ck&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;,       RUN+=&amp;quot;/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bug is that the DRIVERS variable isn't set at all when the device is unplugged.&lt;br /&gt;
&lt;br /&gt;
This appears to be fixed in Ubuntu 8.04 [[User:Mattt|Mattt]] 11:38, 30 July 2008 (UTC)&lt;br /&gt;
:Actually it appears that it's not fixed, but patching that file and disconnecting and reconnecting the phone works perfectly. --[[User:Johndoesacc|Johndoesacc]] 18:37, 20 August 2008 (UTC)&lt;br /&gt;
:Well, yes, it must be fixed because it worked for me out-of-the-box without tweaking the udev rule on 8.04 --[[User:EtienneG|EtienneG]] November 26th, 2008&lt;br /&gt;
:It wasn't solved in my case, as of 3. February 2009 in 8.04 (AMD64), the patch above solved my problem thou. --[[User:VilleWitt|VilleWitt]] February 3td, 2009.&lt;br /&gt;
&lt;br /&gt;
====Iptables Configuration with GUI====&lt;br /&gt;
&lt;br /&gt;
Firestarter can be used to allow the freerunner to connect to the internet without manually running iptables commands. Firestarter is in the ubuntu repositories and can be installed with a &lt;br /&gt;
&amp;lt;pre&amp;gt;sudo aptitude install firestarter&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once installed, the firestarter preferences dialog has a network section, under which a drop-down box appeasr which is labeled  &amp;quot;Local network connected device.&amp;quot; Select the freerunner, generally &amp;quot;Unknown device(usb0)&amp;quot; and check the &amp;quot;Enable internet connection sharing&amp;quot; box. Uncheck local network DHCP and the freerunner should be able to access the internet.&lt;br /&gt;
-Tested in ubuntu 8.10--[[User:makito|Makito]] February 26, 2009&lt;br /&gt;
&lt;br /&gt;
Be aware that when firestarter is running it by default blocks all incoming connections, so if you where using your linux box as a mail-server, web-server or whatever those connections will be blocked. It is quick and easy to add exceptions for whatever protocol you are using in the policy tab of firestarter.&lt;br /&gt;
-Tested in ubuntu 9:04--[[User:chrestomanci|David]] September 2009&lt;br /&gt;
&lt;br /&gt;
Note: Firestarter needs to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu Workaround ===&lt;br /&gt;
Use [http://wicd.sourceforge.net/ wicd] instead of networkmanager:&lt;br /&gt;
It is much further in development than networkmanager yet and doesn't make any problems with USB networking. You can use the &amp;quot;normal&amp;quot; settings in /network/interfaces.&lt;br /&gt;
;Note: Because of it's dependencies it deinstalls networkmanager.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu and QI ===&lt;br /&gt;
If you have trouble connecting to the freerunner after installing qi, check to see if the address has changed to eth&amp;lt;n&amp;gt;. Many host systems will assign eth&amp;lt;n&amp;gt; addresses when they detect an official (non-locally-generated) mac address on the usb network connection.  Qi passes in the official Openmoko USB mac address; u-boot does not.&lt;br /&gt;
&lt;br /&gt;
== Mandriva ==&lt;br /&gt;
&lt;br /&gt;
This first file configures the network system for the usb0 interface. Any time you plug in the FreeRunner the interface will be configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DEVICE=usb0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.0.200&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
NETWORK=192.168.0.0&lt;br /&gt;
BROADCAST=192.168.0.255&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
METRIC=10&lt;br /&gt;
MII_NOT_SUPPORTED=no&lt;br /&gt;
USERCTL=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next file configures the static routes that we need to communicate to the subnet. Since it has &amp;quot;usb0&amp;quot; in the name, the system will automatically apply these static routes any time that the usb0 interface is configured. (i.e. when you connect the FreeRunner)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/usb0-routes&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to restart the network system to pick up the changes.&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This didn't work for me (Mandriva 2008.1), giving errors from Shorewall. However, simply using MCC, Network-&amp;gt;Sharing Internet Access worked fine. You need to connect Neo when starting it. --[[User:Alih|Alih]] 18:50, 22 September 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SuSE ==&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 STARTMODE=onboot&lt;br /&gt;
&lt;br /&gt;
For more information on getting USB networking up using YaST, see [[USB Networking with openSUSE]].&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
=== Option A - Tested with FC9, FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
edit file &amp;lt;tt&amp;gt;/etc/sysconfig/network-scripts/ifcfg-usb0&amp;lt;/tt&amp;gt; to look like this:&lt;br /&gt;
&lt;br /&gt;
 # USB configuration for PDAs (openmoko)&lt;br /&gt;
 # from &amp;lt;nowiki&amp;gt;http://www.handhelds.org/moin/moin.cgi/UsbNet&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 BOOTPROTO=none&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
and restart networking service by typing:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
if your '''openmoko''' is connected when you restart network you should see system message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Bringing up interface usb0      [OK]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Option B ===&lt;br /&gt;
&lt;br /&gt;
This setup is probably over-complex:&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
 DEVICE=usb0&lt;br /&gt;
 IPADDR=192.168.0.200&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} up&lt;br /&gt;
 /sbin/ip addr add dev ${DEVICE} ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/iptables -I POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=1&lt;br /&gt;
 /sbin/iptables -I FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -I FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
Set /etc/sysconfig/network-scripts/ifdown-usb:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ./etc/init.d/functions&lt;br /&gt;
 cd /etc/sysconfig/network-scripts&lt;br /&gt;
 ../network-functions&lt;br /&gt;
 [ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
 CONFIG=${1}&lt;br /&gt;
 need_config ${CONFIG}&lt;br /&gt;
 source_config&lt;br /&gt;
 NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
 /sbin/iptables -D FORWARD -d ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/iptables -D FORWARD -s ${IPADDR}/${NETBITS} -j ACCEPT&lt;br /&gt;
 /sbin/sysctl net.ipv4.ip_forward=0&lt;br /&gt;
 /sbin/iptables -D POSTROUTING -t nat -j MASQUERADE -s ${IPADDR}/${NETBITS}&lt;br /&gt;
 /sbin/ip link set dev ${DEVICE} down&lt;br /&gt;
 /sbin/ip addr flush dev ${DEVICE} 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
If you are using NetworkManager, restart it and enable the usb device from its menu, otherwise it will disable your connection shortly after you enable it.&lt;br /&gt;
&lt;br /&gt;
 /sbin/service NetworkManager restart&lt;br /&gt;
&lt;br /&gt;
=== Option C - tested on FC8, FC9 and F10 ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically but you should ignore it.&lt;br /&gt;
Open Network Configuration tool (System -&amp;gt; Administration -&amp;gt; Network) and perform following steps:&lt;br /&gt;
# Click '''New''' button on top bar&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select OpenMoko from device list&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Select 'Statically set IP address:' and enter address: 192.168.0.200, netmask 255.255.255.0 (or use 255.255.255.240 if you want only route ip range 192.168.0.192-192.168.0.207). Leave gateway empty.&lt;br /&gt;
# Click '''Forward'''&lt;br /&gt;
# Click '''Apply''' to close add dialog&lt;br /&gt;
# Select newly added usb0 device from the device list.&lt;br /&gt;
# Click '''Edit''' button on top bar&lt;br /&gt;
# You might want to remove a tick from 'Activate device when computer starts' check box.&lt;br /&gt;
# Click '''Ok''' to close window  dialog.&lt;br /&gt;
Save settings and close the window.&lt;br /&gt;
&lt;br /&gt;
Open Firewall Configuration (System -&amp;gt; Administration -&amp;gt; Firewall) and enable masquerading:&lt;br /&gt;
# Select '''Masquerading''' from left panel&lt;br /&gt;
# Check device(s) which you'd like to share internet connection. Typically eth0 or wlan0.&lt;br /&gt;
# Click '''Apply''' and close application&lt;br /&gt;
&lt;br /&gt;
Open terminal and perform (as root user):&lt;br /&gt;
# ifdown usb0&lt;br /&gt;
# ifup usb0&lt;br /&gt;
The first command will remove any existing settings given by the NetworkManager and second command brings the device up with appropriate settings.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to ping e.g. 74.125.39.99 [www.google.com] from OpenMoko. Configure /etc/resolv.conf and you should have full a internet access.&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
If Network Configuration tool cannot see the the usb0 try to unplug the usb cable for a few seconds and wait until the NetworkManager finds it again.&lt;br /&gt;
&lt;br /&gt;
NetworkManager will assign a new ip address for the OpenMoko if link goes down for a while. You can fix this by issuing '''ifup usb0''' again.&lt;br /&gt;
&lt;br /&gt;
=== Option D - tested on Fedora 11 (Leonidas) ===&lt;br /&gt;
&lt;br /&gt;
Plug in the usb cable. NetworkManager should detect the phone automatically. Perform following steps:&lt;br /&gt;
# Rightclick NetworkManager Icon&lt;br /&gt;
## Click '''Edit Connections ...'''&lt;br /&gt;
## Type root password when requested&lt;br /&gt;
## Select first entry in List (eg. Auto eth1)&lt;br /&gt;
## Click '''Edit'''&lt;br /&gt;
## Change '''Connectionname''' to '''neo freerunner'''&lt;br /&gt;
## Chose tab '''IPv4 Properties'''&lt;br /&gt;
## Choose '''manual''' in Drop-Down-Box '''Method'''&lt;br /&gt;
## Click '''Add''' at '''Adresses'''&lt;br /&gt;
## Enter this values:&lt;br /&gt;
### Address: 192.168.0.200&lt;br /&gt;
### Netmask: 255.255.255.0&lt;br /&gt;
### Gateway: 0.0.0.0&lt;br /&gt;
## Click '''Apply'''&lt;br /&gt;
## Click '''Close''' on dialog &amp;quot;network connections&amp;quot;&lt;br /&gt;
# Open Shell&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -d 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I FORWARD -j ACCEPT -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''iptables -I POSTROUTING -t nat -j MASQUERADE -s 192.168.0.202/32'''&lt;br /&gt;
## Enter '''/etc/init.d/iptables save'''&lt;br /&gt;
## Enter '''chkconfig iptables on'''&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Red Hat or Similar (tested with Workstation 5) ==&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case $INTERFACE in&lt;br /&gt;
# interfaces that are registered after being &amp;quot;up&amp;quot; (?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usb0)&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&lt;br /&gt;
route add 192.168.0.202 usb0&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
exit 0&lt;br /&gt;
;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
&lt;br /&gt;
Open /etc/conf.d/net and add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Neo&lt;br /&gt;
config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
routes_usb0=( &amp;quot;192.168.0.202/32 via 192.168.0.200&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Store them:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
&lt;br /&gt;
If you want the routing by default:&lt;br /&gt;
&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
&lt;br /&gt;
You must also inform the kernel, to start forwarding.&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
=== Automatic Configuration ===&lt;br /&gt;
One way to automate all this is to create /etc/conf.d/net.usb0 as follows. It sets IP forwarding and the iptables rules all in one go. It removes the iptables rules and disables ip forwarding when the FreeRunner is unplugged.&lt;br /&gt;
Therefore the net.usb0 service must be hotpluggable (/etc/rc.conf or /etc/conf.d/rc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preup() {&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
postdown() {&lt;br /&gt;
echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
iptables -D INPUT -s 192.168.0.202 -j ACCEPT&lt;br /&gt;
iptables -D OUTPUT -s 192.168.0.200 -j ACCEPT&lt;br /&gt;
iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware (tested with 12.1) ==&lt;br /&gt;
&lt;br /&gt;
Following is based on [http://www.enricozini.org/2008/tips/autodock-freerunner.html Enrico Zini's solution].&lt;br /&gt;
&lt;br /&gt;
Create a new udev rules file &amp;lt;tt&amp;gt;/etc/udev/rules.d/91-openmoko.rules&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, ATTRS{idVendor}==&amp;quot;1457&amp;quot;, ATTRS{idProduct}==&amp;quot;5122&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} start&amp;quot;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;remove&amp;quot;, ENV{INTERFACE}==&amp;quot;usb[0-9]&amp;quot;, RUN+=&amp;quot;/sbin/om-usb $env{INTERFACE} stop&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create the script &amp;lt;tt&amp;gt;/sbin/om-usb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
INTERFACE=$1&lt;br /&gt;
ACTION=$2&lt;br /&gt;
&lt;br /&gt;
# udev fails silently when the script fails, e.g. due to commands not&lt;br /&gt;
# being found&lt;br /&gt;
PATH=/usr/sbin:/sbin:/usr/bin:/bin&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
'start')&lt;br /&gt;
# Put all your setup here&lt;br /&gt;
;;&lt;br /&gt;
'stop')&lt;br /&gt;
# Put all your tear down here&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
echo &amp;quot;Usage: $0 {start|stop}&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;INTERFACE&amp;lt;/tt&amp;gt; will be &amp;lt;tt&amp;gt;usb0&amp;lt;/tt&amp;gt; in most cases.&lt;br /&gt;
&lt;br /&gt;
== Archlinux ==&lt;br /&gt;
Following is based on [http://xenos.altervista.org/blogs/index.php?blog=3&amp;amp;title=openmoko-usb-networking-su-archlinux furester's solution].&lt;br /&gt;
&lt;br /&gt;
Install package [http://aur.archlinux.org/packages.php?ID=20220 openmoko-usb-networking] from AUR:&lt;br /&gt;
&lt;br /&gt;
$ yaourt -S openmoko-usb-networking&lt;br /&gt;
&lt;br /&gt;
= SSH Extras =&lt;br /&gt;
&lt;br /&gt;
Reportedly, the ssh daemon (dropbear 0.49) on the FreeRunner appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.&lt;br /&gt;
&lt;br /&gt;
To avoid ssh adding a new line for every ssh host-key to your known_hosts you can add the following to the phone section in ~/.ssh/config (or see the snippet at : [[USB Networking#Changing_host_keys]] bellow)&lt;br /&gt;
&lt;br /&gt;
UserKnownHostsFile /dev/null&lt;br /&gt;
&lt;br /&gt;
You might want to use keys to bypass the login prompt too.&lt;br /&gt;
&lt;br /&gt;
== SSH Keys ==&lt;br /&gt;
&lt;br /&gt;
== From desktop to FreeRunner ==&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type:&lt;br /&gt;
&lt;br /&gt;
 user@host$ ssh-keygen -t rsa&lt;br /&gt;
&lt;br /&gt;
When prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh:&lt;br /&gt;
&lt;br /&gt;
 root@phone# mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
Then from your desktop copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 user@host$ scp ~/.ssh/id_rsa.pub root@phone:~/.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone without a password prompt using a command like 'ssh root@phone' from the account user@host because the public key in the file user@host:~/.ssh/id_rsa.pub is contained in the list of keys which have access in the file root@phone:~/.ssh/authorized_keys (since scp is used, only one key exists, but you can grant access to the phone from more than one account, for example user@host, user@laptop).&lt;br /&gt;
&lt;br /&gt;
To make ssh login as root by default, add the following lines to ~/.ssh/config:&lt;br /&gt;
&lt;br /&gt;
 Host phone&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
Replace ''phone'' with the hostname or ip of your phone. You should now be able to ssh into the phone without having to type ''root@'' every time.&lt;br /&gt;
&lt;br /&gt;
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_EXTRA_ARGS=&amp;quot;-s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You will need to restart dropbear for this to take effect.&lt;br /&gt;
&lt;br /&gt;
=== From FreeRunner to Desktop ===&lt;br /&gt;
&lt;br /&gt;
Generate the key:&lt;br /&gt;
&lt;br /&gt;
 dropbearkey -t rsa -f id_rsa&lt;br /&gt;
&lt;br /&gt;
The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Will output 1024 bit rsa secret key to 'id_rsa'&lt;br /&gt;
 Generating key, this may take a while...&lt;br /&gt;
 Public key portion is:&lt;br /&gt;
 ssh-rsa AAAAB3Nza[...]&lt;br /&gt;
 Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8&lt;br /&gt;
&lt;br /&gt;
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).&lt;br /&gt;
&lt;br /&gt;
From the phone, ssh with -i:&lt;br /&gt;
&lt;br /&gt;
 ssh -i id_rsa user@host&lt;br /&gt;
&lt;br /&gt;
=== Changing host keys ===&lt;br /&gt;
&lt;br /&gt;
If you reflash, your hosts keys will change.  Try this ~/.ssh/config snippet:&lt;br /&gt;
&lt;br /&gt;
 Host moko&lt;br /&gt;
 HostName 192.168.0.202&lt;br /&gt;
 StrictHostKeyChecking no&lt;br /&gt;
 UserKnownHostsFile /dev/null&lt;br /&gt;
 User root&lt;br /&gt;
&lt;br /&gt;
This is suggested because ssh on your desktop may complain if the key matching a certain IP changes (stored in .ssh/known_hosts). Now you have set this, you can issue the following command to connect to your moko (the usual &amp;quot;root@&amp;quot; isn't required as it's set by the user section in the config file) :&lt;br /&gt;
&lt;br /&gt;
 ssh moko&lt;br /&gt;
&lt;br /&gt;
== GUI on desktop through SSH ==&lt;br /&gt;
&lt;br /&gt;
To get the GUI on the FreeRunner onto the desktop via USB, you can use ssh as follows (execute on desktop):&lt;br /&gt;
&lt;br /&gt;
 xhost +&lt;br /&gt;
 ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Using this, run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.&lt;br /&gt;
&lt;br /&gt;
If you get an error like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to&lt;br /&gt;
autolaunch D-Bus session: Autolaunch requested, but X11 support not compiled in.&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you need to set the DBUS_SESSION_BUS_ADDRESS environment variable to the value on the FreeRunner before launching the process from your desktop.  You can find the value of this variable by using a command such as&lt;br /&gt;
&lt;br /&gt;
 ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&lt;br /&gt;
&lt;br /&gt;
Note that you must run that command on the FreeRunner.  Back on your desktop, run the process you want with the ''env'' command like this:&lt;br /&gt;
&lt;br /&gt;
 env DBUS_SESSION_BUS_ADDRESS=''dbus_address'' ''process'' #(isn't the &amp;quot;env&amp;quot; redundant here?)&lt;br /&gt;
&lt;br /&gt;
==Display Remote Applications on FreeRunner==&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your FreeRunner, first log in:&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost +192.168.0.200&lt;br /&gt;
&lt;br /&gt;
After this you can close the ssh session. Back on the desktop computer, run:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=openmoko:0 xclock&lt;br /&gt;
&lt;br /&gt;
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:&lt;br /&gt;
&lt;br /&gt;
  DISPLAY=:0 xhost -192.168.0.200&lt;br /&gt;
&lt;br /&gt;
== sftp ==&lt;br /&gt;
After you get the SSH connection working, it is possible to use Konqueror, Nautilus or another sftp - enabled tool to browse the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&lt;br /&gt;
&lt;br /&gt;
== sshfs ==&lt;br /&gt;
You can use sshfs to mount the phones filesystem into the hosts filesystem. Make sure that fuse-sshfs is installed and that you are allowed to use fuse. Now run:&lt;br /&gt;
&lt;br /&gt;
  sshfs 192.168.0.202:REMOTE_PATH LOCAL_MOUNT_POINT&lt;br /&gt;
&lt;br /&gt;
REMOTE_PATH can now be accessed through LOCAL_PATH.&lt;br /&gt;
&lt;br /&gt;
E.g. you create copy audio files to SD card create a directory  on your desktop computer and mount the card via sshfs&lt;br /&gt;
  desktop# mkdir /mnt/freerunner&lt;br /&gt;
  desktop# mkdir /mnt/freerunner/card&lt;br /&gt;
  desktop# sshfs 192.168.0.202:/media/card /mnt/freerunner/card&lt;br /&gt;
No the content of card of your FR can be access via /mnt/freerunner/card.&lt;br /&gt;
&lt;br /&gt;
==Automated setup network and mounting partitions==&lt;br /&gt;
&lt;br /&gt;
See [https://bugs.launchpad.net/ubuntu/+bug/289548 Ubuntu bug report in launchpad].&lt;br /&gt;
&lt;br /&gt;
== other similar tutorials ==&lt;br /&gt;
* http://left.subtree.org/category/freerunner/&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Applications</id>
		<title>Applications</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Applications"/>
				<updated>2008-11-11T12:32:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: Pingus linked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the wiki's master application list for the Openmoko smartphones. &lt;br /&gt;
&lt;br /&gt;
== How to register new applications ?==&lt;br /&gt;
&lt;br /&gt;
This list can not be exhaustive, as new things are showing up every week. This page is here to help spreading awareness about applications. Here are instructions on how to add a specific application to this list. There are many ways to go, but prefered method is the following:&lt;br /&gt;
* Register your application with the structured directory at http://opkg.org. You will get a package number there, for example 33.&lt;br /&gt;
* Notify the community mailing list.&lt;br /&gt;
* Come back here, click on &amp;quot;edit&amp;quot; next to the appropriate section title, then add a line like:&lt;br /&gt;
&amp;lt;pre&amp;gt;* {{opkg.org|33|Application name}} A short description&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, to just link to wherever the application is hosted. Click on &amp;quot;edit&amp;quot; next to the appropriate section title, add a line like:&lt;br /&gt;
&amp;lt;pre&amp;gt;* [http://your.host.domain/the/path/to/app/page.html Application name] A short description&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alteralternatively, to create a new page in this wiki. Click on &amp;quot;edit&amp;quot; next to the appropriate section title, then add a line like:&lt;br /&gt;
&amp;lt;pre&amp;gt;* [[Application name]] A short description&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sections in this page have a link to a separate wiki page named &amp;quot;List of ''X'' applications&amp;quot;, where one can find/give more details like screenshots, installation instructions, and availability.&lt;br /&gt;
&lt;br /&gt;
== Audio ==&lt;br /&gt;
&lt;br /&gt;
* [[Openmoko-mediaplayer2]] - Play music and video (mp3...)&lt;br /&gt;
* Qtopia Mediaplayer - Play music (mp3...)&lt;br /&gt;
* [[Openmokast]] - Play audio stream and slideshow stream&lt;br /&gt;
* [http://projects.openmoko.org/projects/pythm/ pythm] - Audio player GUI using mplayer and mpd as backend.&lt;br /&gt;
* [[Mokoko]]-Play music.&lt;br /&gt;
More about these audio applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Audio Applications]]&lt;br /&gt;
&lt;br /&gt;
Note that most of the video applications also play audio, see below.&lt;br /&gt;
&lt;br /&gt;
== Games ==&lt;br /&gt;
&lt;br /&gt;
* [[Games/Om 2007.2]] - Many small games on Om 2007.2&lt;br /&gt;
* [[Om 2008.8 Sudoku]] - Number placement based puzzle game&lt;br /&gt;
* Moko-sudoku - Another sudoku puzzle game.&lt;br /&gt;
* [[Scummvm]] - Plays certain classic graphical point-and-click adventure games&lt;br /&gt;
* [[Kobodeluxe]] - A top-view space shooter, available from 2008.8 repositories.&lt;br /&gt;
* xjig - A virtual jigsaw puzzle.&lt;br /&gt;
* Battle of Wesnoth - An addictive turn-based strategy game.&lt;br /&gt;
* [[Sander|Pingus]] - Pingus is a lemmings clone with penguins.&lt;br /&gt;
* [[Duke Nukem 3D]] - Legendary First Person Shooter.&lt;br /&gt;
* [[Numptyphysics]] - A drawing puzzle game.&lt;br /&gt;
* [http://lists.openmoko.org/pipermail/community/2008-November/034962.html Gnuboy] - An emulator for the handheld gaming all-time bestseller.&lt;br /&gt;
* Chess - Gnuchess, console based.&lt;br /&gt;
* [[XBill]] - Little action game to stop Bill from installing Windows(tm) on computers.&lt;br /&gt;
* {{opkg.org|33|Xlogical}} A puzzle based game where you turn spinners to move balls around.&lt;br /&gt;
* [http://unsyncopated.com/BrainSolvent/Doom%20Port DOOM]- Classic&lt;br /&gt;
More about games:&lt;br /&gt;
&lt;br /&gt;
* [[List of Games]]&lt;br /&gt;
&lt;br /&gt;
== GPS ==&lt;br /&gt;
&lt;br /&gt;
* [[GPS Sight]] - Display GPS information, location, tracks, etc, without maps.&lt;br /&gt;
* [[Gpsdrive]] - Car (bike, etc) navigation system&lt;br /&gt;
* [[Om 2008.8 Locations]] - (aka Splinter) - Location sharing based on GPS and SMS&lt;br /&gt;
* [[Navit]] - Car navigation system with routing engine&lt;br /&gt;
* [[TangoGPS]] - Display map (OSM..), record GPS tracks...&lt;br /&gt;
* [[Pyroute]] -&lt;br /&gt;
* [http://wiki.openstreetmap.org/index.php/Mumpot mumpot] - Display map (OSM), routing, OSM tag editing, a bit of live editing&lt;br /&gt;
* [[QMapControl]] - Display maps (OSM..) and add points, lines...&lt;br /&gt;
* [[Qpegps]] - Display map with current position&lt;br /&gt;
* [[Idle Hands]] - Give a task to you based on your location&lt;br /&gt;
&lt;br /&gt;
More about GPS applications:&lt;br /&gt;
&lt;br /&gt;
* [[GPS applications|List of GPS applications]]&lt;br /&gt;
&lt;br /&gt;
== Graphics ==&lt;br /&gt;
&lt;br /&gt;
* [[Orrery]] - Displays the night sky&lt;br /&gt;
* [[OMView]] - Image viewer&lt;br /&gt;
* [[PyPenNotes]] - Write notes using pen and touchscreen&lt;br /&gt;
* [[Gpe-scap]] - Take screenshots&lt;br /&gt;
* [[Flash|Gnash]]-Play flash file on Neo&lt;br /&gt;
&lt;br /&gt;
More about graphics applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Graphics Applications]]&lt;br /&gt;
&lt;br /&gt;
== Internet ==&lt;br /&gt;
&lt;br /&gt;
* [[Twinkle]] - Voice over IP&lt;br /&gt;
* [[Linphone]] - Voice over IP&lt;br /&gt;
* [[Midori]] - Webkit based web browser&lt;br /&gt;
* [[Minimo]] - Mozilla based web browser&lt;br /&gt;
* [http://www.dillo.org/ Dillo] - Multiplatform fast and small web browser ([http://misc.andi.de1.cc/dillo/ .ipk]).&lt;br /&gt;
* [[Mokopedia]] - Read small Wikipedia dumps offline&lt;br /&gt;
* [[Openmoko-browser2]] - The original Openmoko web browser&lt;br /&gt;
* [[Openmokast]] - Play audio stream and slideshow stream&lt;br /&gt;
* [[Openmoko Mail]] - E-mail client&lt;br /&gt;
* [[Instant Messaging|Pidgin]] - Instant messaging client (ICQ, MSN, Jabber, Yahoo and more.)&lt;br /&gt;
* [http://www.cs.helsinki.fi/u/rantalai/freerunner/centerim/ Centerim] - Instant messaging client (terminal-based).&lt;br /&gt;
* [[PyFeedRead]] - RSS feed reader&lt;br /&gt;
* [[Qtmail]] - Default mail program on Om 2008.8&lt;br /&gt;
&lt;br /&gt;
More about internet applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Internet Applications]]&lt;br /&gt;
&lt;br /&gt;
== Office ==&lt;br /&gt;
&lt;br /&gt;
* [[Epdfview]] - PDF reader.&lt;br /&gt;
* Evince - Document reader for PDF, PS, DJVU and more.&lt;br /&gt;
* [[FBReader]] - E-book reader program (TXT, FB2, HTML and more)&lt;br /&gt;
* [[Gutenflash]] - Fast text reader by scrolling text&lt;br /&gt;
&lt;br /&gt;
More about office applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Office Applications]]&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
* [[Mofi]] - Wifi setup tool&lt;br /&gt;
* [[Lint-wifi]] - Wifi setup tool&lt;br /&gt;
* [[Om 2008.8 Installer]] - Graphical software installer&lt;br /&gt;
* [[Opkg]] - Command line software installer&lt;br /&gt;
* [[Sephora]] - Settings manager&lt;br /&gt;
* [[SettingsGUI]] - Edit various settings&lt;br /&gt;
* [[Wicd]] - Wifi setup tool&lt;br /&gt;
&lt;br /&gt;
More about Settings applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Settings Applications]] TBD&lt;br /&gt;
&lt;br /&gt;
== System ==&lt;br /&gt;
&lt;br /&gt;
* [[Auxlaunch]] - Finger-friendly app launcher and window switcher&lt;br /&gt;
* [[Display Locker]] - Screen lock&lt;br /&gt;
* [[Gestures]] - Detect movement and display information, rotate screen&lt;br /&gt;
* [[Keychain]] - SSH keys&lt;br /&gt;
* [[MokoFEM]] - Monitors GSM information&lt;br /&gt;
* [[Mokostat]] - Monitors battery&lt;br /&gt;
* [[Openmoko Bluetooth remote controller|ReMoko]] - Control stuff via BlueTooth&lt;br /&gt;
* [[Rotate]] - Rotate screen when phone is rotated&lt;br /&gt;
* [[Terminal]] - Commando prompt&lt;br /&gt;
* [[Ts calibrate]] - Calibrates touchscreen&lt;br /&gt;
* [[Zedlock]] - Screen locker&lt;br /&gt;
* [http://fso-control.projects.openmoko.org/ fso-control] - Popup Power menu to shutdown/suspend/reboot.&lt;br /&gt;
* [[omkeys_functions]] - Remap AUX key bindings&lt;br /&gt;
&lt;br /&gt;
More about system applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of System Applications]]&lt;br /&gt;
&lt;br /&gt;
== Telephony ==&lt;br /&gt;
&lt;br /&gt;
* [[Dialer/2007.2]] - The dialer application in Om 2007.2&lt;br /&gt;
&lt;br /&gt;
More about telephony applications:&lt;br /&gt;
&lt;br /&gt;
* [[List of Telephony Applications]] TBD&lt;br /&gt;
* [[:Category:Telephony|Telephony category]]&lt;br /&gt;
&lt;br /&gt;
== Utility ==&lt;br /&gt;
&lt;br /&gt;
* [[HP48 Series RPN Calculator]] - Calculator with many functions&lt;br /&gt;
* [http://qwo.projects.openmoko.org/ qwo] An alternative input method.&lt;br /&gt;
&lt;br /&gt;
More about utility applications&lt;br /&gt;
&lt;br /&gt;
* [[List of Utility Applications]] TBD&lt;br /&gt;
* [[:Category:Utility Applications|Utility Applications]]&lt;br /&gt;
* [http://www.srcf.ucam.org/~taw27/openmoko/openmoocow/ OpenMooCow] FreeRunner mooes on flip.&lt;br /&gt;
* [http://meuk.spritesserver.nl/lightsaber-0.1.tgz The Lightsaber]. Pre-alpha starwaresque orphanware.&lt;br /&gt;
&lt;br /&gt;
== Video ==&lt;br /&gt;
&lt;br /&gt;
* [[Video Player]] - Using Mplayer on Openmoko smartphones&lt;br /&gt;
* [http://katastrophos.net/andre/blog/software/quasar-media-player/ Quasar] - a mplayer frontend for X11&lt;br /&gt;
&lt;br /&gt;
More about video applications&lt;br /&gt;
&lt;br /&gt;
* [[List of Video Applications]]&lt;br /&gt;
&lt;br /&gt;
== An automatic list of application-related wiki pages ==&lt;br /&gt;
&lt;br /&gt;
The pages linked above are all maintained manually. We also maintain an automatic categorization system by tagging wiki pages. Here is the list of application-related pages in this wiki. Normally, every page listed below should be also listed above in the same category. The converse is false: there are applications without a wiki page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1ex&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Applications in this Wiki:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;categorytree mode=pages depth=2 hideroot=on&amp;gt;Applications&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Where to find more applications? ==&lt;br /&gt;
&lt;br /&gt;
At [http://opkg.org opkg.org] !&lt;br /&gt;
&lt;br /&gt;
Not all Openmoko apps are listed on this wiki - there are much more [http://projects.openmoko.org/softwaremap/ projects at the Openmoko GForge] than the wiki can list, not to mention self-hosted applications on their own websites. Actually the phones can run most Linux based Free Software, using for example the [[Debian]] distribution. The [http://handhelds.freshmeat.net/browse/1038/ mobile phones section of Freshmeat] may be a interesting place to look.&lt;br /&gt;
&lt;br /&gt;
More application download related pages:&lt;br /&gt;
&lt;br /&gt;
* [[Community Repository]]&lt;br /&gt;
* [[Users Repositories]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Where to find full distributions ? ==&lt;br /&gt;
&lt;br /&gt;
* [[Download]]: for complete system downloads&lt;br /&gt;
&lt;br /&gt;
== The usual warnings ==&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
* Some of these software are developed by Openmoko Inc. and some are contributed by the community. Any problems with community contributed software should be reported to the individual software developer rather than the Openmoko core team.&lt;br /&gt;
* Most programs listed here are not mature/stable, but only useable/beta.&lt;br /&gt;
* Many programs listed here are not yet packaged for your distribution and integrated in its repositories. Whichever it is.&lt;br /&gt;
* Installing experimental software from the internet is certain to break things. Running it as root is a very insecure thing to do. Kown that you will be burned, have backups, and be ready to apologize to everybody in your phone contact list in case they receive strange SMSs...&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Applications|Applications]]&lt;br /&gt;
[[Category:Basic End User]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Duke_Nukem_3D</id>
		<title>Duke Nukem 3D</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Duke_Nukem_3D"/>
				<updated>2008-09-29T08:27:26Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: homepage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Legendary First Person Shooter. Rafa shared a simple duke nukem 3d port for Neo which can be played using the accelerometer :)&lt;br /&gt;
&lt;br /&gt;
* opkg install http://alasal.be/openmoko/repo/duke3d_0.1.1_armv4t.ipk&lt;br /&gt;
* [http://onlinedev.blogspot.com/2008/09/getting-duke-nukem-3d-on-your-neo.html HOWTO] about the package.&lt;br /&gt;
* Files: http://fz.hobby-site.org/om/duke-nukem-3d/&lt;br /&gt;
* Instructions: http://fz.hobby-site.org/om/duke-nukem-3d/readme-openmoko.txt&lt;br /&gt;
* Instructions schematics: http://fz.hobby-site.org/om/duke-nukem-3d/how-to-play-duke.png&lt;br /&gt;
* Demo: http://www.youtube.com/watch?v=260Kpiqv9_U&lt;br /&gt;
&lt;br /&gt;
Note: Game will not run if you don't have accelerometers working properly (check with 'hexdump /dev/input/event2' and 'hexdump /dev/input/event3'. Also make sure PulseAudio isn't running: '/etc/init.d/pulseaudio stop', otherwise it will cause the following error: some people have reported that it will not run resulting in the error 'Unknown multivoc error' even when PulseAudio is not installed - waiting on a workaround. To use game without sound, edit ~/.duke3d/duke3d.cfg and change FXDevice = 0 to FXDevice = 13 under [Sound Setup]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
{{ApplicationBox|&lt;br /&gt;
  Name=[[Duke Nukem 3D]]|&lt;br /&gt;
  Screenshot=No-screenshot.png|&lt;br /&gt;
  Description=Legendary First Person Shooter.|&lt;br /&gt;
  Homepage=http://maemo.org/downloads/product/OS2008/duke3d/|&lt;br /&gt;
  TestedOn=|&lt;br /&gt;
  PackageName=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Gaming]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Numptyphysics</id>
		<title>Numptyphysics</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Numptyphysics"/>
				<updated>2008-09-29T08:13:05Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This [http://numptyphysics.garage.maemo.org/ really cool game] is available from&lt;br /&gt;
  opkg install --force-depends  http://wwwpub.zih.tu-dresden.de/~mkluge/numptyphysics_0.2_armv4t.ipk &lt;br /&gt;
opkg complains about libsdl and libsdl-image, but I think the program should actually works on 2007.2, and Debian (?). &lt;br /&gt;
&lt;br /&gt;
On Om 2008 you need to do the following:&lt;br /&gt;
&lt;br /&gt;
 opkg install libsdl-1.2-0 libsdl-image-1.2-0&lt;br /&gt;
 opkg install -force-depends http://wwwpub.zih.tu-dresden.de/~mkluge/numptyphysics_0.2_armv4t.ipk&lt;br /&gt;
&lt;br /&gt;
Use with a keyboard on. Keys:&lt;br /&gt;
&lt;br /&gt;
 stylus	draw a new stroke&lt;br /&gt;
 space or enter (d-pad centre)	pause/unpause physics&lt;br /&gt;
 esc (back arrow)	undo last stroke&lt;br /&gt;
 q	quit&lt;br /&gt;
 r or up	reset level to initial state&lt;br /&gt;
 n or right	skip to next level&lt;br /&gt;
 p or left	go to previous level&lt;br /&gt;
 e or fullscreen	edit mode&lt;br /&gt;
&lt;br /&gt;
Hints:&lt;br /&gt;
&lt;br /&gt;
Each stroke is like a rigid piece of wire with a mass proportional to its length. A closed stroke is just a wire bent into a shape, it has no substance apart from its perimeter.&lt;br /&gt;
&lt;br /&gt;
The ends of a strokes can (and will) join onto other strokes when drawn near enough to another stroke. These joints are pivots so you can use this to build levers, pendulums and other mechanical wonders.&lt;br /&gt;
&lt;br /&gt;
Jointed strokes don't collide with each other. Join both ends to make a rigid structure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
{{ApplicationBox|&lt;br /&gt;
  Name=[[Numptyphysics]]|&lt;br /&gt;
  Screenshot=No-screenshot.png|&lt;br /&gt;
  Description=Numpty Physics is a drawing puzzle game.|&lt;br /&gt;
  Homepage=http://numptyphysics.garage.maemo.org|&lt;br /&gt;
  TestedOn=FSO|&lt;br /&gt;
  PackageName=&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Gaming]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/U-Boot</id>
		<title>U-Boot</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/U-Boot"/>
				<updated>2008-08-30T09:47:40Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: GTA02 define has to come before -i, -f, -o options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages|Bootloader}}&lt;br /&gt;
&lt;br /&gt;
{{Bootloader}}&lt;br /&gt;
[[Image:GTA01-U-Boot.JPG|thumb|300px|u-boot menu on Neo1973]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|u-boot splash screen on Neo1973]]&lt;br /&gt;
&lt;br /&gt;
The bootloader used on the smartphones is called '''U-Boot'''. It takes care of device functionality until Openmoko is booted. This includes [[USB DFU]] for [[flashing Openmoko]], a splash screen, a boot menu, a console for [[bootloader commands]], configuration via [[bootloader environment]], and loading a [[kernel]]. &lt;br /&gt;
&lt;br /&gt;
There are various [[bootloader versions]] available.&lt;br /&gt;
&lt;br /&gt;
== Booting into U-boot ==&lt;br /&gt;
&lt;br /&gt;
* Make sure that your phone has had the battery and USB cable removed for at least 30 seconds.&lt;br /&gt;
* Hold in the AUX button on power-up to access the boot menu.&lt;br /&gt;
* Connect the Neo (ie not Debug Board) to a Linux host with the USB cable.&lt;br /&gt;
* Set the console to USB.&lt;br /&gt;
* Connect to /dev/ttyACM0 with a terminal program on the Linux host (you might need to chown uucp.uucp /dev/ttyACM0 )&lt;br /&gt;
* Note that the cdc_acm /dev/ttyACM0 access disappears as soon as the Neo boots, and is replaced by the cdc_ether usb0 network access.&lt;br /&gt;
* You're now at the bootloader prompt.&lt;br /&gt;
* Set the bootdelay uboot environment variable to -1 if you want it to always halt at the bootloader on power-up.&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
All versions of the OM smartphone use the [http://u-boot.sourceforge.net/ u-boot] bootloader.&lt;br /&gt;
&lt;br /&gt;
More information on u-boot can be found at &lt;br /&gt;
* http://www.denx.de/wiki/DULG&lt;br /&gt;
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot&lt;br /&gt;
* http://linuxdevices.com/articles/AT5085702347.html&lt;br /&gt;
&lt;br /&gt;
Additions to the vanilla u-boot already implemented include: &lt;br /&gt;
* Support for boot from NAND flash using [[S3C2410 Steppingstone]]&lt;br /&gt;
* Support for S3C2410 NAND flash&lt;br /&gt;
* Support for downloading programs via S3C2410 USB Device Controller&lt;br /&gt;
* Support to display bootup logo / status on S3C2410 Framebuffer&lt;br /&gt;
&lt;br /&gt;
However, u-boot still doesn't support many of the features that GTA01 needs, such as&lt;br /&gt;
* Support for reading kernel/initrd from SD/Transflash&lt;br /&gt;
&lt;br /&gt;
[[User:HaraldWelte|HaraldWelte]] is working on those issues, and in fact most of them have already been implemented.&lt;br /&gt;
&lt;br /&gt;
== Bootloader source code ==&lt;br /&gt;
&lt;br /&gt;
The current bootloader source can be found at http://git.openmoko.org/?p=u-boot.git;a=shortlog;h=stable . &lt;br /&gt;
&lt;br /&gt;
To get u-boot by subversion:&lt;br /&gt;
&lt;br /&gt;
 svn co https://svn.openmoko.org/ openmoko/u-boot&lt;br /&gt;
&lt;br /&gt;
To build u-boot:&lt;br /&gt;
* Clone the git tree and check out the stable branch&lt;br /&gt;
* Set the CROSS_COMPILE environment variable to specify the prefix to your toolchain binaries&lt;br /&gt;
* Run &amp;quot;make gta02v5_config&amp;quot; (or gta01bv4_config, or whatever hardware revision you have)&lt;br /&gt;
* Run &amp;quot;make u-boot.udfu&amp;quot;. This will give you an image which you can install with dfu-util, or which you can upload into memory via JTAG (with a debug board)&lt;br /&gt;
&lt;br /&gt;
== Bootloader binary ==&lt;br /&gt;
&lt;br /&gt;
The latest bootloader binary builds can be found under http://buildhost.openmoko.org/daily/ in the subdirectory [device]/200808/[date]/.&lt;br /&gt;
&lt;br /&gt;
All versions of the GTA02 (Neo Freerunner) that have been sold to the public are version 5 hardware so look for a file with &amp;quot;gta02&amp;quot; and &amp;quot;v5&amp;quot; in the name, for example&lt;br /&gt;
uboot-gta02v5-latest.bin&lt;br /&gt;
&lt;br /&gt;
The file should be written to the NAND flash address 0x00000000 (size 0x30000) (the first [[partition]]).&lt;br /&gt;
&lt;br /&gt;
== Bootloader development ==&lt;br /&gt;
&lt;br /&gt;
=== QT2410 ===&lt;br /&gt;
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.&lt;br /&gt;
&lt;br /&gt;
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the &amp;quot;if 0&amp;quot; in Line 32 into a &amp;quot;if 1&amp;quot;, then recompile with &amp;quot;make&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The resulting &amp;quot;u-boot.bin&amp;quot; is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.&lt;br /&gt;
&lt;br /&gt;
=== Neo 1973 ===&lt;br /&gt;
&lt;br /&gt;
Doing bootloader development on the [[Neo 1973]] is a bit more tricky.  first, we don't have any NOR flash.  Second, there is no other way to boot _but_ from NAND.  Therefore, we also don't have a USB downloader like the QT2410.&lt;br /&gt;
&lt;br /&gt;
The main problem is:  The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM.   That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this&lt;br /&gt;
&lt;br /&gt;
=== Neo FreeRunner ===&lt;br /&gt;
{{main|Neo_FreeRunner_Memory_Mapping}}&lt;br /&gt;
&lt;br /&gt;
==== Using JTAG to boot from RAM ====&lt;br /&gt;
&lt;br /&gt;
So how can we boot from RAM? We use JTAG / OpenOCD to&lt;br /&gt;
&lt;br /&gt;
* Reset and halt the cpu at PC=0&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target halted in ARM state due to debug request, current mode: Supervisor&lt;br /&gt;
cpsr: 0x400000d3 pc: 0x00000000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; load_binary /space/misc/gta01/u-boot.git/board/gta01/lowlevel_foo.bin 0            &lt;br /&gt;
downloaded 332 byte in 0s 21899us&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; bp 0x33f80000 4 hw&lt;br /&gt;
breakpoint added at address 0x33f80000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run the code up to the break point&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; resume&lt;br /&gt;
Target 0 resumed&lt;br /&gt;
&amp;gt; Target 0 halted&lt;br /&gt;
target halted in ARM state due to breakpoint, current mode: Supervisor&lt;br /&gt;
cpsr: 0x600000d3 pc: 0x33f80000&lt;br /&gt;
MMU: disabled, D-Cache: disabled, I-Cache: enabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Download the u-boot RAM image to 0x33f80000&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000&lt;br /&gt;
downloaded 135692 byte in 6s 567264us&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Resume processing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; resume&lt;br /&gt;
Target 0 resumed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)&lt;br /&gt;
&lt;br /&gt;
DRAM:  128 MB&lt;br /&gt;
NAND:  64 MiB&lt;br /&gt;
*** Warning - bad CRC or NAND, using default environment&lt;br /&gt;
&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
Hit any key to stop autoboot:  0 &lt;br /&gt;
GTA01Bv2 # &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating bootable images ==&lt;br /&gt;
&lt;br /&gt;
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''.  In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin&lt;br /&gt;
gzip -9 linux.bin&lt;br /&gt;
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n &amp;quot;Kernel Image QT2410&amp;quot; -d linux.bin.gz uImage&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot menu ==&lt;br /&gt;
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]&lt;br /&gt;
&lt;br /&gt;
As of the Phase-0 release, our u-boot version now features an on-screen boot menu. The items are defined by [[bootloader environment#menu|menu entries in the environment]].&lt;br /&gt;
&lt;br /&gt;
=== Accessing the boot menu ===&lt;br /&gt;
&lt;br /&gt;
You can access the boot menu by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.&lt;br /&gt;
&lt;br /&gt;
=== Using the boot menu ===&lt;br /&gt;
&lt;br /&gt;
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items.  Use the ''POWER'' button to select one item. &lt;br /&gt;
&lt;br /&gt;
== Bootloader prompt ==&lt;br /&gt;
&lt;br /&gt;
=== Accessing the bootloader prompt ===&lt;br /&gt;
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).&lt;br /&gt;
Whether the serial port or usb is used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.&lt;br /&gt;
&lt;br /&gt;
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.&lt;br /&gt;
&lt;br /&gt;
The bootloader is currently configured to wait for three seconds.  If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.&lt;br /&gt;
&lt;br /&gt;
==== Using usbtty from Linux ====&lt;br /&gt;
&lt;br /&gt;
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttyACM0. If not, enable the CONFIG_USB_ACM (Device Drivers -&amp;gt; USB support -&amp;gt; USB Modem (CDC ACM) support). (Instructions for MacOS users are [[MacOS_X#USB_Serial|here]])&lt;br /&gt;
&lt;br /&gt;
Use your favourite terminal emulator (minicom, cu, zc, screen ...) to access it like any other serial port. If you don't have a favorite, try just: (cu is in the taylor-uucp package, use &amp;quot;apt-get install cu&amp;quot; if it is not yet installed)&lt;br /&gt;
 cu -l /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
You might need to &lt;br /&gt;
 chown uucp.uucp /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
to get the necessary rights (even as root).&lt;br /&gt;
&lt;br /&gt;
A nice alternative for cu is Werner Almesberger's [[NeoCon|neocon]].&lt;br /&gt;
&lt;br /&gt;
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:&lt;br /&gt;
&lt;br /&gt;
 # lsusb -d 1457:5119&lt;br /&gt;
 Bus 005 Device 079: ID 1457:5119  &lt;br /&gt;
&lt;br /&gt;
Second, let's see some more details about the available endpoints and configurations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lsusb -v -d 1457:5119&lt;br /&gt;
Bus 005 Device 079: ID 1457:5119  &lt;br /&gt;
Device Descriptor:&lt;br /&gt;
  bLength                18&lt;br /&gt;
  bDescriptorType         1&lt;br /&gt;
  bcdUSB               1.10&lt;br /&gt;
  bDeviceClass            2 Communications&lt;br /&gt;
  bDeviceSubClass         0 &lt;br /&gt;
  bDeviceProtocol         0 &lt;br /&gt;
  bMaxPacketSize0        16&lt;br /&gt;
  idVendor           0x1457 &lt;br /&gt;
  idProduct          0x5119 &lt;br /&gt;
  bcdDevice            0.00&lt;br /&gt;
  iManufacturer           1 Openmoko, Inc&lt;br /&gt;
  iProduct                2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3&lt;br /&gt;
  iSerial                 3 0000000&lt;br /&gt;
  bNumConfigurations      1&lt;br /&gt;
  Configuration Descriptor:&lt;br /&gt;
    bLength                 9&lt;br /&gt;
    bDescriptorType         2&lt;br /&gt;
    wTotalLength           85&lt;br /&gt;
    bNumInterfaces          3&lt;br /&gt;
    bConfigurationValue     1&lt;br /&gt;
    iConfiguration          4 TTY via USB&lt;br /&gt;
    bmAttributes         0xc0&lt;br /&gt;
      Self Powered&lt;br /&gt;
    MaxPower                0mA&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        0&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           1&lt;br /&gt;
      bInterfaceClass         2 Communications&lt;br /&gt;
      bInterfaceSubClass      2 Abstract (modem)&lt;br /&gt;
      bInterfaceProtocol      1 AT-commands (v.25ter)&lt;br /&gt;
      iInterface              6 Control Interface&lt;br /&gt;
      CDC Header:&lt;br /&gt;
        bcdCDC               0.6e&lt;br /&gt;
      CDC Call Management:&lt;br /&gt;
        bmCapabilities       0x00&lt;br /&gt;
        bDataInterface          1&lt;br /&gt;
      CDC ACM:&lt;br /&gt;
        bmCapabilities       0x00&lt;br /&gt;
      CDC Union:&lt;br /&gt;
        bMasterInterface        0&lt;br /&gt;
        bSlaveInterface         1 &lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
        bmAttributes            3&lt;br /&gt;
          Transfer Type            Interrupt&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
        bInterval             255&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        1&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           2&lt;br /&gt;
      bInterfaceClass        10 CDC Data&lt;br /&gt;
      bInterfaceSubClass      0 Unused&lt;br /&gt;
      bInterfaceProtocol      0 &lt;br /&gt;
      iInterface              5 Bulk Data Interface&lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x02  EP 2 OUT&lt;br /&gt;
        bmAttributes            2&lt;br /&gt;
          Transfer Type            Bulk&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
        bInterval             255&lt;br /&gt;
      Endpoint Descriptor:&lt;br /&gt;
        bLength                 7&lt;br /&gt;
        bDescriptorType         5&lt;br /&gt;
        bEndpointAddress     0x83  EP 3 IN&lt;br /&gt;
        bmAttributes            2&lt;br /&gt;
          Transfer Type            Bulk&lt;br /&gt;
          Synch Type               None&lt;br /&gt;
          Usage Type               Data&lt;br /&gt;
        wMaxPacketSize     0x0010  1x 16 bytes&lt;br /&gt;
        bInterval             255&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        2&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           0&lt;br /&gt;
      bInterfaceClass       254 Application Specific Interface&lt;br /&gt;
      bInterfaceSubClass      1 Device Firmware Update&lt;br /&gt;
      bInterfaceProtocol      1 &lt;br /&gt;
      iInterface              7 USB Device Firmware Upgrade&lt;br /&gt;
Device Status:     0x0001&lt;br /&gt;
  Self Powered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, you can access it using your favourite terminal program.&lt;br /&gt;
&lt;br /&gt;
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to change the [[bootloader environment#console|console entries in the environment]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GTA01Bv2 # setenv stderr usbtty&lt;br /&gt;
GTA01Bv2 # setenv stdout usbtty&lt;br /&gt;
GTA01Bv2 # setenv stdin usbtty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Typical u-boot prompt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)&lt;br /&gt;
&lt;br /&gt;
DRAM:  128 MB&lt;br /&gt;
NAND:  64 MiB&lt;br /&gt;
Found Environment offset in OOB..&lt;br /&gt;
Video: 640x480x8 31kHz 59Hz&lt;br /&gt;
USB:   S3C2410 USB Deviced&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
Hit any key to stop autoboot:  0 &lt;br /&gt;
GTA01Bv3 #&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Commands on the bootloader prompt ===&lt;br /&gt;
&lt;br /&gt;
:''See [[bootloader commands]].''&lt;br /&gt;
&lt;br /&gt;
=== What if I borked my bootloader environment and don't get a prompt anymore? ===&lt;br /&gt;
Found a solution here:&lt;br /&gt;
[[http://markmail.org/message/gqypwiohdet6x4am?q=almesberger+partition&amp;amp;page=1&amp;amp;refer=xbamkzwwsaobv7wa]]&lt;br /&gt;
&lt;br /&gt;
It works the following way:&lt;br /&gt;
* Get the devirginator:&lt;br /&gt;
 svn co http://svn.openmoko.org/trunk/src/host/devirginator&lt;br /&gt;
 cd devirginator&lt;br /&gt;
* Read the u-boot environment from the device:&lt;br /&gt;
 dfu-util -a u-boot_env -R -U env.in&lt;br /&gt;
* Create a file that contains everything you want to change in your u-boot environment or get it by issuing the following command:&lt;br /&gt;
 wget http://svn.openmoko.org/trunk/src/host/devirginator/environment.in&lt;br /&gt;
* Now let devirginator generate a new u-boot_env partition for us, - that contains the partition table from our u-boot_env, - and all changes we wanted to make; Note that the -D GTA02 is needed for the neo Freerunner only, and has to come before the other options.&lt;br /&gt;
 ./envedit.pl -D GTA02 -i env.in -f environment.in -o env.out&lt;br /&gt;
* On my box the partition layout didn't seem to match the idea of envedit.pl, so it issued 2 warnings:&lt;br /&gt;
 warning: environment is 262144 bytes, expected 16384&lt;br /&gt;
 CRC error: expected 0xc33e35fc, got 0x93097bfb&lt;br /&gt;
* In this case jut add a additional argument to the command line - that has to be the 1st argument, though, and that contains the size information we got from the warning:&lt;br /&gt;
 ./envedit.pl -s 262144 -D GTA02 -i env.in -f environment.in  -o env.out&lt;br /&gt;
* Now the perl script should produce no more output anything but write a new u-boot_env partition that we can upload to the device by:&lt;br /&gt;
 dfu-util -a u-boot_env -R -D env.out&lt;br /&gt;
&lt;br /&gt;
== Device Firmware Upgrade ==&lt;br /&gt;
&lt;br /&gt;
Our version of u-boot also implements [[USB DFU]]. This can be useful to&lt;br /&gt;
load files and kernel for quick testing.&lt;br /&gt;
&lt;br /&gt;
To find out whether your version of u-boot supports this, use the output of&lt;br /&gt;
 $ lsusb -v -d 1457:5119&lt;br /&gt;
while the phone is in u-boot mode.&lt;br /&gt;
&lt;br /&gt;
If it supports DFU, you should see the following snippet towards the end of the output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Interface Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         4&lt;br /&gt;
      bInterfaceNumber        2&lt;br /&gt;
      bAlternateSetting       0&lt;br /&gt;
      bNumEndpoints           0&lt;br /&gt;
      bInterfaceClass       254 Application Specific Interface&lt;br /&gt;
      bInterfaceSubClass      1 Device Firmware Update&lt;br /&gt;
      bInterfaceProtocol      1 &lt;br /&gt;
      iInterface              0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For information on how to do firmware upgrades, please see [[dfu-util]]. For neo 1973 you may see [[Flashing_Openmoko#Actually_flashing_things_into_the_device]], and for the FreeRunner : [[Flashing the Neo FreeRunner]].&lt;br /&gt;
&lt;br /&gt;
=== Booting files over DFU ===&lt;br /&gt;
&lt;br /&gt;
To load a file at memory address 0x32000000:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dfu-util -a 0 -D fileToLoad -R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, send 'bootm 0x32000000' to u-boot or 'bootelf 0x32000000' if&lt;br /&gt;
its an elf file.&lt;br /&gt;
&lt;br /&gt;
Simple python script that can boot an ELF image - avoiding a ACM bug that breaks on large packets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
cmd1 = &amp;quot;neo backlight off\n&amp;quot;&lt;br /&gt;
cmd2 = &amp;quot;bootelf 0x32000000\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
def output(tty, str):&lt;br /&gt;
    for x in str:&lt;br /&gt;
        tty.write(x)&lt;br /&gt;
        tty.flush()&lt;br /&gt;
&lt;br /&gt;
if len(sys.argv) == 2:&lt;br /&gt;
    print &amp;quot;Loading %s...&amp;quot; % sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
    loadfile = &amp;quot;dfu-util -a 0 -D %s -R&amp;quot; % sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
    os.system(loadfile)&lt;br /&gt;
&lt;br /&gt;
    time.sleep(3)&lt;br /&gt;
&lt;br /&gt;
    tty = open(&amp;quot;/dev/ttyACM0&amp;quot;, &amp;quot;a&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    output(tty, cmd1)&lt;br /&gt;
    output(tty, cmd2)&lt;br /&gt;
&lt;br /&gt;
    tty.close()&lt;br /&gt;
else:&lt;br /&gt;
    print &amp;quot;Usage: %s elffile&amp;quot; % sys.argv[0]&lt;br /&gt;
    print &amp;quot;&amp;quot;&lt;br /&gt;
    sys.exit(2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== USB connectivity problems ===&lt;br /&gt;
&lt;br /&gt;
I once got errors like this (in dmesg or /var/log/messages) on the host side while connecting the neo in u-boot:&lt;br /&gt;
&lt;br /&gt;
 usb 2-1: device descriptor read/64, error -110&lt;br /&gt;
 usb usb2: Controller not stopped yet!&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 hub 4-0:1.0: port 1 disabled by hub (EMI?), re-enabling...&lt;br /&gt;
 usb 4-1: USB disconnect, address 2&lt;br /&gt;
&lt;br /&gt;
A possible solution is given below. Please note that if you have a usb keyboard or mouse then the command might cause trouble. &lt;br /&gt;
&lt;br /&gt;
 rmmod uhci_hcd ; modprobe uhci_hcd&lt;br /&gt;
&lt;br /&gt;
Another option is to plug the FR into a different USB port on the host, preferably one on the Motherboard not the hub.&lt;br /&gt;
&lt;br /&gt;
Disconnecting the Neo's USB while powering up may prevent this problem in the future.&lt;br /&gt;
&lt;br /&gt;
== Related pages ==&lt;br /&gt;
&lt;br /&gt;
See [[Flashing the Neo 1973]] and [[Flashing the Neo Freerunner]] for instructions on using dfu-util to install a new bootloader in your phone.&lt;br /&gt;
&lt;br /&gt;
[[Category:System Developers]]&lt;br /&gt;
[[Category:Flashing Openmoko]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Server:WebProxy</id>
		<title>Server:WebProxy</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Server:WebProxy"/>
				<updated>2008-04-08T09:09:57Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: reassembly proxy/client proxy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{wishlist}}&lt;br /&gt;
This is a brief page describing a web proxy optimised for use on devices with a reasonable amount of persistant storage, and very limited bandwidth.&lt;br /&gt;
&lt;br /&gt;
Once, each page linked to a subpage of contents, which remained static, and could be easily refreshed if it changed based on dates in the HTTP headers.&lt;br /&gt;
&lt;br /&gt;
Now, this is the case in the minority of popular sites.&lt;br /&gt;
Most sites now have a substantial fraction of pages with some non-static contents.&lt;br /&gt;
&lt;br /&gt;
As an example of this, for example consider http://www.ebay.com/index.html.&lt;br /&gt;
&lt;br /&gt;
Over a 15 minute period, the size was constant at around 66K, and it was different most times it was loaded.&lt;br /&gt;
&lt;br /&gt;
Simply compressing this page using advanced compression techniques provides a useful compression - taking the page to 15K.&lt;br /&gt;
&lt;br /&gt;
A very simple test, using diff and gzip however, revealed that the variation between pages is quite small.&lt;br /&gt;
&lt;br /&gt;
This means that if the user clicks 'reload', if the proxy simply compresses the page, the user needs to download 15K.&lt;br /&gt;
&lt;br /&gt;
If, however, the user-agent and the proxy act in concert, this can be reduced to under 0.5K. (split on &amp;quot;&amp;lt;&amp;quot;, count the compressed differences).&lt;br /&gt;
&lt;br /&gt;
This is done by the user-agent caching the pages it downloads, then informing the proxy of which version of the page it has.&lt;br /&gt;
&lt;br /&gt;
The proxy then simply sends the compressed differences between the  previous and current version.&lt;br /&gt;
&lt;br /&gt;
''improvement: it would be better NOT to modify the client, but instead have a 'reassembly proxy' on the client, so that all http clients/user agents benefit without hacks. The reassembly proxy could then inject a cookie to keep track of page versions.''&lt;br /&gt;
&lt;br /&gt;
Other optimisations:&lt;br /&gt;
* Comparing pages, and ensuring that  any page has in fact changed before downloading, as many servers misreport pages changed when they have not.&lt;br /&gt;
* Convert all jpegs to progressive, and initially only download the first 'scan' of the image, which is 1/8th the size or so. Allow the user to download the remainder of the file for full resolution by clicking on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Amsterdam</id>
		<title>Openmoko Local Groups: Amsterdam</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Amsterdam"/>
				<updated>2008-02-29T12:05:46Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Possible Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Possible Participants ===&lt;br /&gt;
{|border=1&lt;br /&gt;
!Name&lt;br /&gt;
!Skills&lt;br /&gt;
!Level of Interest&lt;br /&gt;
!Location&lt;br /&gt;
!Other&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Ericsmith|Eric Smith]]&lt;br /&gt;
|Perl, Linux, VoIP&lt;br /&gt;
|&lt;br /&gt;
|Amsterdam&lt;br /&gt;
|Share Ideas, VoIP, GPS, SyncML&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Sander|Sander van Grieken]]&lt;br /&gt;
|C/C++, Java, Python, Qt&lt;br /&gt;
|&lt;br /&gt;
|Amsterdam&lt;br /&gt;
|VoIP, Wifi, PIM&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Amsterdam</id>
		<title>Openmoko Local Groups: Amsterdam</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Openmoko_Local_Groups:_Amsterdam"/>
				<updated>2008-02-29T12:04:05Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Possible Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Possible Participants ===&lt;br /&gt;
{|border=1&lt;br /&gt;
!Name&lt;br /&gt;
!Skills&lt;br /&gt;
!Level of Interest&lt;br /&gt;
!Location&lt;br /&gt;
!Other&lt;br /&gt;
|-&lt;br /&gt;
|[[User:Ericsmith|Eric Smith]]&lt;br /&gt;
|Perl, Linux, VoIP&lt;br /&gt;
|&lt;br /&gt;
|Amsterdam&lt;br /&gt;
|Share Ideas, VoIP, GPS, SyncML&lt;br /&gt;
|-&lt;br /&gt;
|[[User:SanderVanGrieken|Sander van Grieken]]&lt;br /&gt;
|C/C++, Java, Python, Qt&lt;br /&gt;
|&lt;br /&gt;
|Amsterdam&lt;br /&gt;
|VoIP, Wifi, PIM&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Qtopia_on_Neo1973</id>
		<title>Qtopia on Neo1973</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Qtopia_on_Neo1973"/>
				<updated>2008-02-28T10:17:32Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Qtopia Qtopia] is a complete mobile phone and PDA platform which can be built for many devices and is dual-licensed under the GPL and a proprietary license, but since version 3.4.0, everything needed to use Qtopia on the Neo1973 is licensed under the GPL.&lt;br /&gt;
{|align=right&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
On 27 November 2007, Lorn Potter of Trolltech released the [http://www.qtopia.net/modules/mydownloads/visit.php?lid=50 latest flash image for the FIC Neo 1973] containing the Qtopia 4.3.1 snapshot of that day (GPL version). This introduces the new Cruxus mediaengine, which has a few plugins already, which include libmad, tremor (ogg) and timidity, for .wav, .mp3, ogg and .mid file support.&lt;br /&gt;
&lt;br /&gt;
For installing it, follow the instructions on [[#Flashing Qtopia images|flashing Qtopia images]] below.&lt;br /&gt;
&lt;br /&gt;
Bug: The dialer might not ask for a PIN (even if your SIM card needs it) on first boot after flashing to Qtopia.&amp;lt;br&amp;gt;&lt;br /&gt;
Workaround: Somehow, completely powering down the Neo seems to cure this issue. You do can do it in two ways:&lt;br /&gt;
# Remove the USB cable and the Battery for a moment to remove all power from the Neo, or&lt;br /&gt;
# Remove the USB cable, press the power button for a second, select &amp;quot;Shutdown device&amp;quot; (Note: &amp;quot;Restart Device&amp;quot; does not help - you need to power it down completely!)&lt;br /&gt;
&lt;br /&gt;
If your SIM card does not require a PIN, you can skip the above possibly, but otherwise you won't be able to use GSM networks at all!&lt;br /&gt;
&lt;br /&gt;
'''After this power-cycle of the Neo, the Qtopia dialer should ask for the PIN if it's needed, and you should be able to make and receive calls, each side should hear each other and you should be able to send and receive SMS, and use Contacts for Calls and SMS!!!'''.&lt;br /&gt;
&lt;br /&gt;
The Call, SMS and contact interface is quite intuitive and should be usable by non-expert users from that point on. Also the rest of Qtopia looks very polished.&lt;br /&gt;
&lt;br /&gt;
For the latest information on this snapshot read the thread following its [http://lists.openmoko.org/pipermail/community/2007-November/011836.html announcement].&lt;br /&gt;
&lt;br /&gt;
=== Suspend issues ===&lt;br /&gt;
The area of battery time and/or suspend still needs improvement. By default, Suspend is disabled in Qtopia because at the moment, you are not able to receive a phone call or an SMS when the Neo is suspended. At the moment (with suspend not enabled, which is the default), Qtopia lasts about 3-5 hours, depending on the amount of use.&lt;br /&gt;
&lt;br /&gt;
The current maximum standby time seems to be around 7 hours - if there is no use of the phone and the phone is not getting any touches and just sitting on the desk with Bluetooth disabled and getting no touches so that the display is off, just being ready to receive calls and SMS.&lt;br /&gt;
&lt;br /&gt;
Note that if the Neo [[Neo1973_Battery_Charger#Neo1973_emergency_charging | runs out of battery]], simply connecting USB is not sufficient at that point, the battery has too little voltage to allow the Neo to turn on and enable 500mA charging current. At this point, the Neo is just dead as a brick and charges very slowly with 100mA charging current for about 4 to 6 hours until the battery is recharged enough to allow turning on the Neo and charge with 500mA charging current.&lt;br /&gt;
&lt;br /&gt;
Current status regarding suspend: Suspending and resuming works, when you remove console=ttySAC0,115200 from bootargs_base (see this [http://blog.rot13.org/2007/09/openmoko_as_a_phone.html howto]), it even wakes up with the GSM part working, but it does not make Qtopia wake up on incoming calls or SMS, so you are not getting notified if you turn on suspend.&lt;br /&gt;
After pressing the AUX button, the Neo should wake up from suspend though and should inform you of missed calls and received SMS.&lt;br /&gt;
&lt;br /&gt;
This bug seems to be [http://labs.trolltech.com/blogs/2007/12/04/neo-neuros-and-other-things/  half-workedarounded], but the fix is not included in the most recent (as of 2007-12-16) official Qtopia image yet. There is an unofficial image from Lorn at http://llornkcor.com/neo/qtopia-4.3-snapshot-12192309-neo-flash.tgz that you can try out that includes his fix.&lt;br /&gt;
&lt;br /&gt;
== Flashing Qtopia images ==&lt;br /&gt;
These are instructions for flashing the latest release of Qtopia (27112007). This seems to be the best working&lt;br /&gt;
image yet, eg. voice _and_ SMS seems to work.&lt;br /&gt;
&lt;br /&gt;
The link to the archive file, Qtopia flash image for FIC Neo 1973,&lt;br /&gt;
is mentioned below  &lt;br /&gt;
&lt;br /&gt;
http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50 [http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50]&lt;br /&gt;
&lt;br /&gt;
Get that and save it on your computer. It should be:&lt;br /&gt;
&amp;quot;qtopia-4.3.1-snapshot-1127.tgz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Unpack it with:&lt;br /&gt;
&lt;br /&gt;
tar zxvf qtopia-4.3.1-snapshot-1127.tgz&lt;br /&gt;
&lt;br /&gt;
This should make you have the following two files, ie. a kernel file and&lt;br /&gt;
a rootfs file:&lt;br /&gt;
&lt;br /&gt;
-rw-r--r-- 1 plr   1000 31956148 2007-11-27 06:55&lt;br /&gt;
qtopia-rootfs.2-11270550.jffs2&lt;br /&gt;
&lt;br /&gt;
-rw-r--r-- 1 plr   1000  1538620 2007-11-10 20:57&lt;br /&gt;
uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin&lt;br /&gt;
&lt;br /&gt;
In case you already do not have a dfu-util utility, you will need to download it. The following version has been tried out and seemed to work.&lt;br /&gt;
&lt;br /&gt;
http://buildhost.automated.it/OM2007.2/dfu-util [http://buildhost.automated.it/OM2007.2/dfu-util]&lt;br /&gt;
&lt;br /&gt;
Before moving forward please make sure of the following&lt;br /&gt;
&lt;br /&gt;
1. You have the necessary permissions in your system (i.e. root access)&lt;br /&gt;
&lt;br /&gt;
2. dfu-util is executable&lt;br /&gt;
&lt;br /&gt;
3. Your Neo is in uboot mode&lt;br /&gt;
&lt;br /&gt;
4. And a USB cable is connected between your computer and the Neo&lt;br /&gt;
&lt;br /&gt;
5. Realize that the following is low-level stuff and doing something&lt;br /&gt;
wrong may brick your Neo&lt;br /&gt;
&lt;br /&gt;
execute the following from a command line:&lt;br /&gt;
&lt;br /&gt;
    cu -l /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Which should get you the following:&lt;br /&gt;
&lt;br /&gt;
   Connected.&lt;br /&gt;
   In:    usbtty&lt;br /&gt;
   Out:   usbtty&lt;br /&gt;
   Err:   usbtty&lt;br /&gt;
   GTA01Bv4 # DEVICE_CONFIGURED: 1&lt;br /&gt;
   Enabling automatic fast charge&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;Enter&amp;gt; and you should get:&lt;br /&gt;
&lt;br /&gt;
   GTA01Bv4 #&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{warning|Before flashing the rootfs image, be sure to erase the rootfs using [[nand erase]]. Otherwise, the Neo may hang somewhere after on boot. Before you hit enter on one of the following commands, make sure that you are *not* issuing a plain &amp;quot;nand erase&amp;quot; command - always make sure you tell it which partition to erase. If you forget this you'll brick the Neo and you'll need a debug board to recover it.}}&lt;br /&gt;
&lt;br /&gt;
At that prompt type:&lt;br /&gt;
&lt;br /&gt;
   nand erase rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the &amp;lt;Enter&amp;gt; key, which should get you:&lt;br /&gt;
&lt;br /&gt;
   NAND erase: device 0 offset 0x2e4000, size 0x3d1c000&lt;br /&gt;
   OK&lt;br /&gt;
   GTA01Bv4 #&lt;br /&gt;
&lt;br /&gt;
At that prompt don't press anything else, but:&lt;br /&gt;
&lt;br /&gt;
~.&lt;br /&gt;
&lt;br /&gt;
and the &amp;lt;Enter&amp;gt; key, which should disconnect you from the bootloader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, from the computer prompt, execute the following:&lt;br /&gt;
&lt;br /&gt;
   ./dfu-util  -a kernel -R -D uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin&lt;br /&gt;
&lt;br /&gt;
which should get you the following, and it should only take a few&lt;br /&gt;
seconds to finish:&lt;br /&gt;
&lt;br /&gt;
dfu-util - (C) 2007 by OpenMoko Inc.&lt;br /&gt;
This program is Free Software and has ABSOLUTELY NO WARRANTY&lt;br /&gt;
&lt;br /&gt;
   Opening USB Device 0x0000:0x0000...&lt;br /&gt;
   Claiming USB DFU Runtime Interface...&lt;br /&gt;
   Determining device status: state = appIDLE, status = 0&lt;br /&gt;
   Device really in Runtime Mode, send DFU detach request...&lt;br /&gt;
   Resetting USB...&lt;br /&gt;
   Opening USB Device...&lt;br /&gt;
   Found Runtime: [0x1457:0x5119] devnum=3, cfg=0, intf=0, alt=3, name=&amp;quot;kernel&amp;quot;&lt;br /&gt;
   Claiming USB DFU Interface...&lt;br /&gt;
   Setting Alternate Setting ...&lt;br /&gt;
   Determining device status: state = dfuIDLE, status = 0&lt;br /&gt;
   dfuIDLE, continuing&lt;br /&gt;
   Transfer Size = 0x1000&lt;br /&gt;
   bytes_per_hash=30772&lt;br /&gt;
   Starting download: [##################################################]&lt;br /&gt;
   finished!&lt;br /&gt;
   state(2) = dfuIDLE, status(0) = No error condition is present&lt;br /&gt;
   Done!&lt;br /&gt;
   Resetting USB to switch back to runtime mode&lt;br /&gt;
&lt;br /&gt;
After that, execute the following:&lt;br /&gt;
&lt;br /&gt;
    ./dfu-util -a rootfs -R -D qtopia-rootfs.2-11270550.jffs2&lt;br /&gt;
&lt;br /&gt;
which should get you the following, and it should take between 5-10min&lt;br /&gt;
to finish:&lt;br /&gt;
&lt;br /&gt;
dfu-util - (C) 2007 by OpenMoko Inc.&lt;br /&gt;
This program is Free Software and has ABSOLUTELY NO WARRANTY&lt;br /&gt;
&lt;br /&gt;
  Opening USB Device 0x0000:0x0000...&lt;br /&gt;
  Claiming USB DFU Runtime Interface...&lt;br /&gt;
  Determining device status: state = appIDLE, status = 0&lt;br /&gt;
  Device really in Runtime Mode, send DFU detach request...&lt;br /&gt;
  Resetting USB...&lt;br /&gt;
  Opening USB Device...&lt;br /&gt;
  Found Runtime: [0x1457:0x5119] devnum=5, cfg=0, intf=0, alt=5, name=&amp;quot;rootfs&amp;quot;&lt;br /&gt;
  Claiming USB DFU Interface...&lt;br /&gt;
  Setting Alternate Setting ...&lt;br /&gt;
  Determining device status: state = dfuIDLE, status = 0&lt;br /&gt;
  dfuIDLE, continuing&lt;br /&gt;
  Transfer Size = 0x1000&lt;br /&gt;
  bytes_per_hash=639122&lt;br /&gt;
  Starting download: [##################################################]&lt;br /&gt;
  finished!&lt;br /&gt;
  state(2) = dfuIDLE, status(0) = No error condition is present&lt;br /&gt;
  Done!&lt;br /&gt;
  Resetting USB to switch back to runtime mode&lt;br /&gt;
&lt;br /&gt;
In both cases, some text on your Neo should appear, indicating that the&lt;br /&gt;
kernel or the rootfs are being downloaded.&lt;br /&gt;
&lt;br /&gt;
After this, the Neo should be able to boot, and depending on how you&lt;br /&gt;
have your boot menu set up, choose &amp;quot;Boot&amp;quot; or perhaps &amp;quot;Boot from NAND&amp;quot;.&lt;br /&gt;
The method described above in any case puts the software on the NAND&lt;br /&gt;
flash, and not on an SD card, if you have that installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lasted official Qtopia flash images are found at: http://www.qtopia.net/modules/mydownloads/ (Scroll down on this page to find them)&lt;br /&gt;
&lt;br /&gt;
Unofficial Qtopia images can be found in the ScaredyCat and Chooseopen [[repositories]].&lt;br /&gt;
&lt;br /&gt;
For more details on the the process of flashing the Neo, see [[Flashing openmoko]].&lt;br /&gt;
&lt;br /&gt;
== Dual-booting between Qtopia and X ==&lt;br /&gt;
&lt;br /&gt;
Both examples described here require you to reformat your MicroSD card to ext3, so this is the first step for both:&lt;br /&gt;
&lt;br /&gt;
{{warning|The following step will reformat your MircoSD card with the ext3 filesystem. We need it because we need support for symbolic or/and static links, which other filesystems like FAT do not support directly. After reformatting, no data on the card will be accessible to you anymore, so create good backups of anything which you need before starting!}}&lt;br /&gt;
&lt;br /&gt;
Then ssh to your neo and reformat your MicroSD card with:&lt;br /&gt;
 umount /dev/mmcblk0p1&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1&lt;br /&gt;
 mount /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
=== Installing Qtopia into an openmoko rootfs ===&lt;br /&gt;
&lt;br /&gt;
On [http://www.qtopia.net/modules/devices/openmoko.php], click &amp;quot;Developer root filesystem&amp;quot;. Then extract opt/Qtopia and the qpe init script and copy both to the mmc card of your neo:&lt;br /&gt;
&lt;br /&gt;
 tar xzf ficgta01-qtopia-developer-rootfs.tgz opt/Qtopia etc/init.d/qpe&lt;br /&gt;
 mv opt/Qtopia etc/init.d/qpe . &amp;amp;&amp;amp; rm -r opt etc&lt;br /&gt;
 tar czf Qtopia.tar.gz Qtopia qpe&lt;br /&gt;
 scp Qtopia.tar.gz root@192.168.0.202:/media/card/&lt;br /&gt;
&lt;br /&gt;
Log in to your Neo and unpack the archive and install it:&lt;br /&gt;
&lt;br /&gt;
 cd /media/card&lt;br /&gt;
 tar xzf Qtopia.tar.gz&lt;br /&gt;
 mkdir -p /opt&lt;br /&gt;
 ln -s /media/card/Qtopia /opt/Qtopia&lt;br /&gt;
 mv qpe /etc/init.d&lt;br /&gt;
&lt;br /&gt;
Now kill the X server and gsmd and start Qtopia (this can take some time):&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/xserver-nodm stop&lt;br /&gt;
 /etc/init.d/gsmd stop&lt;br /&gt;
 /etc/init.d/qpe start&lt;br /&gt;
&lt;br /&gt;
Now, in theory, it should be possible to could create a new entry in the [[uboot]] boot menu which adds a new boot argument to the kernel, say &amp;quot;qtopia=1&amp;quot; and you could could write a script which checks that boot parameter by checking if &amp;quot;$qtopia&amp;quot; is set to &amp;quot;1&amp;quot; or by checking /proc/cmdline and then boot Qtopia instead of X.&lt;br /&gt;
&lt;br /&gt;
=== Installing Qtopia on the SD card ===&lt;br /&gt;
&lt;br /&gt;
* format your SD card with ext3 and mount it (see above)&lt;br /&gt;
* unpack rootfs from qtopia-4.3.0-preview-neo-flash.tgz to SD card (see above)&lt;br /&gt;
* copy the uImage-2.6.22.5-moko11-r2-fic-gta01.bin kernel to the boot/ on SD card and rename it to uImage&lt;br /&gt;
* put a 'Boot from SD' menu item in uboot menu as explained here: [[Booting_from_SD#Step_3:_Add_uboot_boot_entry]]&lt;br /&gt;
&lt;br /&gt;
== Build Qtopia from source ==&lt;br /&gt;
If you want to build qtopia for yourself you can download the [ftp://ftp.trolltech.com/qtopia/tech-preview/ technical preview] or [ftp://ftp.trolltech.com/qtopia/snapshots/ snapshots]&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
Most things seem to work out of the box, however you might need to use the following command to get audio (but not with the official flash image available from Trolltech):&lt;br /&gt;
 alsactl -f /etc/gsmhandset.state restore&lt;br /&gt;
Or put this command in /etc/init.d/qpe line 64&lt;br /&gt;
&lt;br /&gt;
Do not switch themes.  Only the default theme is usable.  For example, once you switch themes, the lock feature continues to work, but only if you unlock using the smallest # keypad in the world.&lt;br /&gt;
&lt;br /&gt;
Suspend support is very flaky.  The neo often shuts off from a suspend state.  It will not wake from suspend for an incoming call or text message (someone try setting an alarm and report results here).  To turn suspend off (this will of course use the batteries very quickly), hit the down arrow next to the suspend setting in the power management until it says &amp;quot;Off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When using the &amp;quot;Predictive keyboard,&amp;quot; do a quick flick up or down over the keyboard to access numbers/symbols/capitals. In snapshot builds, you can select virtual keyboard by tapping on the little arrow icon to the left of the battery status icon.&lt;br /&gt;
&lt;br /&gt;
In summary, Qtopia on the Neo1973 is much closer to being ready than OpenMoko as of this writing.  However, sound and suspend support prevent it from being at all useful as a cell phone (as a landline that doesn't ring but instead vibrates, it works ok).&lt;br /&gt;
&lt;br /&gt;
The [http://www.qtopia.net/modules/newbb_plus/viewtopic.php?topic_id=473&amp;amp;forum=4 Qtopia forum area on the FIC GTA01] might be helpful, but it is preferred that you update this section with issues and fixes you find.&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Qtopia001.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia002.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia003.png|thumb|center|240px]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Qtopia004.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia005.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia006.png|thumb|center|240px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Videos ==&lt;br /&gt;
&lt;br /&gt;
 http://www.youtube.com/watch?v=YW5q8SpY7t4&lt;br /&gt;
 http://www.youtube.com/watch?v=iOG_mtSEMgs&lt;br /&gt;
&lt;br /&gt;
For full size videos, 346 MiB:&lt;br /&gt;
&lt;br /&gt;
 http://linuxtracker.org/download.php?id=4613&amp;amp;name=qt_on_neo1973_videos.torrent&lt;br /&gt;
&lt;br /&gt;
{{Languages|Qtopia_on_Neo1973}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Qtopia_on_Neo1973</id>
		<title>Qtopia on Neo1973</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Qtopia_on_Neo1973"/>
				<updated>2008-02-28T10:13:36Z</updated>
		
		<summary type="html">&lt;p&gt;Sander: /* Suspend issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://en.wikipedia.org/wiki/Qtopia Qtopia] is a complete mobile phone and PDA platform which can be built for many devices and is dual-licensed under the GPL and a proprietary license, but since version 3.4.0, everything needed to use Qtopia on the Neo1973 is licensed under the GPL.&lt;br /&gt;
{|align=right&lt;br /&gt;
|__TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Current status ==&lt;br /&gt;
On 27 November 2007, Lorn Potter of Trolltech released the [http://www.qtopia.net/modules/mydownloads/visit.php?lid=50 latest flash image for the FIC Neo 1973] containing the Qtopia 4.3.1 snapshot of that day (GPL version). This introduces the new Cruxus mediaengine, which has a few plugins already, which include libmad, tremor (ogg) and timidity, for .wav, .mp3, ogg and .mid file support.&lt;br /&gt;
&lt;br /&gt;
For installing it, follow the instructions on [[#Flashing Qtopia images|flashing Qtopia images]] below.&lt;br /&gt;
&lt;br /&gt;
Bug: The dialer might not ask for a PIN (even if your SIM card needs it) on first boot after flashing to Qtopia.&amp;lt;br&amp;gt;&lt;br /&gt;
Workaround: Somehow, completely powering down the Neo seems to cure this issue. You do can do it in two ways:&lt;br /&gt;
# Remove the USB cable and the Battery for a moment to remove all power from the Neo, or&lt;br /&gt;
# Remove the USB cable, press the power button for a second, select &amp;quot;Shutdown device&amp;quot; (Note: &amp;quot;Restart Device&amp;quot; does not help - you need to power it down completely!)&lt;br /&gt;
&lt;br /&gt;
If your SIM card does not require a PIN, you can skip the above possibly, but otherwise you won't be able to use GSM networks at all!&lt;br /&gt;
&lt;br /&gt;
'''After this power-cycle of the Neo, the Qtopia dialer should ask for the PIN if it's needed, and you should be able to make and receive calls, each side should hear each other and you should be able to send and receive SMS, and use Contacts for Calls and SMS!!!'''.&lt;br /&gt;
&lt;br /&gt;
The Call, SMS and contact interface is quite intuitive and should be usable by non-expert users from that point on. Also the rest of Qtopia looks very polished.&lt;br /&gt;
&lt;br /&gt;
For the latest information on this snapshot read the thread following its [http://lists.openmoko.org/pipermail/community/2007-November/011836.html announcement].&lt;br /&gt;
&lt;br /&gt;
=== Suspend issues ===&lt;br /&gt;
The area of battery time and/or suspend still needs improvement. By default, Suspend is disabled in Qtopia because at the moment, you are not able to receive a phone call or an SMS when the Neo is suspended. At the moment (with suspend not enabled, which is the default), Qtopia lasts about 3-5 hours, depending on the amount of use.&lt;br /&gt;
&lt;br /&gt;
The current maximum standby time seems to be around 7 hours - if there is no use of the phone and the phone is not getting any touches and just sitting on the desk with Bluetooth disabled and getting no touches so that the display is off, just being ready to receive calls and SMS.&lt;br /&gt;
&lt;br /&gt;
Note that if the Neo [[Neo1973_Battery_Charger#Neo1973_emergency_charging | runs out of battery]], simply connecting USB is not sufficient at that point, the battery has too little voltage to allow the Neo to turn on and enable 500mA charging current. At this point, the Neo is just dead as a brick and charges very slowly with 100mA charging current for about 4 to 6 hours until the battery is recharged enough to allow turning on the Neo and charge with 500mA charging current.&lt;br /&gt;
&lt;br /&gt;
Current status regarding suspend: Suspending and resuming works, when you remove console=ttySAC0,115200 from bootargs_base (see this [http://blog.rot13.org/2007/09/openmoko_as_a_phone.html howto]), it even wakes up with the GSM part working, but it does not make Qtopia wake up on incoming calls or SMS, so you are not getting notified if you turn on suspend.&lt;br /&gt;
After pressing the AUX button, the Neo should wake up from suspend though and should inform you of missed calls and received SMS.&lt;br /&gt;
&lt;br /&gt;
This bug seems to be [http://labs.trolltech.com/blogs/2007/12/04/neo-neuros-and-other-things/  half-workedarounded], but the fix is not included in the most recent (as of 2007-12-16) official Qtopia image yet. There is an unofficial image from Lorn at http://llornkcor.com/neo/qtopia-4.3-snapshot-12192309-neo-flash.tgz that you can try out that includes his fix.&lt;br /&gt;
&lt;br /&gt;
== Flashing Qtopia images ==&lt;br /&gt;
These are instructions for flashing the latest release of Qtopia (27112007). This seems to be the best working&lt;br /&gt;
image yet, eg. voice _and_ SMS seems to work.&lt;br /&gt;
&lt;br /&gt;
The link to the archive file, Qtopia flash image for FIC Neo 1973,&lt;br /&gt;
is mentioned below  &lt;br /&gt;
&lt;br /&gt;
http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50 [http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50]&lt;br /&gt;
&lt;br /&gt;
Get that and save it on your computer. It should be:&lt;br /&gt;
&amp;quot;qtopia-4.3.1-snapshot-1127.tgz&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Unpack it with:&lt;br /&gt;
&lt;br /&gt;
tar zxvf qtopia-4.3.1-snapshot-1127.tgz&lt;br /&gt;
&lt;br /&gt;
This should make you have the following two files, ie. a kernel file and&lt;br /&gt;
a rootfs file:&lt;br /&gt;
&lt;br /&gt;
-rw-r--r-- 1 plr   1000 31956148 2007-11-27 06:55&lt;br /&gt;
qtopia-rootfs.2-11270550.jffs2&lt;br /&gt;
&lt;br /&gt;
-rw-r--r-- 1 plr   1000  1538620 2007-11-10 20:57&lt;br /&gt;
uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin&lt;br /&gt;
&lt;br /&gt;
In case you already do not have a dfu-util utility, you will need to download it. The following version has been tried out and seemed to work.&lt;br /&gt;
&lt;br /&gt;
http://buildhost.automated.it/OM2007.2/dfu-util [http://buildhost.automated.it/OM2007.2/dfu-util]&lt;br /&gt;
&lt;br /&gt;
Before moving forward please make sure of the following&lt;br /&gt;
&lt;br /&gt;
1. You have the necessary permissions in your system (i.e. root access)&lt;br /&gt;
&lt;br /&gt;
2. dfu-util is executable&lt;br /&gt;
&lt;br /&gt;
3. Your Neo is in uboot mode&lt;br /&gt;
&lt;br /&gt;
4. And a USB cable is connected between your computer and the Neo&lt;br /&gt;
&lt;br /&gt;
5. Realize that the following is low-level stuff and doing something&lt;br /&gt;
wrong may brick your Neo&lt;br /&gt;
&lt;br /&gt;
execute the following from a command line:&lt;br /&gt;
&lt;br /&gt;
    cu -l /dev/ttyACM0&lt;br /&gt;
&lt;br /&gt;
Which should get you the following:&lt;br /&gt;
&lt;br /&gt;
   Connected.&lt;br /&gt;
   In:    usbtty&lt;br /&gt;
   Out:   usbtty&lt;br /&gt;
   Err:   usbtty&lt;br /&gt;
   GTA01Bv4 # DEVICE_CONFIGURED: 1&lt;br /&gt;
   Enabling automatic fast charge&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;Enter&amp;gt; and you should get:&lt;br /&gt;
&lt;br /&gt;
   GTA01Bv4 #&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{warning|Before flashing the rootfs image, be sure to erase the rootfs using [[nand erase]]. Otherwise, the Neo may hang somewhere after on boot. Before you hit enter on one of the following commands, make sure that you are *not* issuing a plain &amp;quot;nand erase&amp;quot; command - always make sure you tell it which partition to erase. If you forget this you'll brick the Neo and you'll need a debug board to recover it.}}&lt;br /&gt;
&lt;br /&gt;
At that prompt type:&lt;br /&gt;
&lt;br /&gt;
   nand erase rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the &amp;lt;Enter&amp;gt; key, which should get you:&lt;br /&gt;
&lt;br /&gt;
   NAND erase: device 0 offset 0x2e4000, size 0x3d1c000&lt;br /&gt;
   OK&lt;br /&gt;
   GTA01Bv4 #&lt;br /&gt;
&lt;br /&gt;
At that prompt don't press anything else, but:&lt;br /&gt;
&lt;br /&gt;
~.&lt;br /&gt;
&lt;br /&gt;
and the &amp;lt;Enter&amp;gt; key, which should disconnect you from the bootloader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, from the computer prompt, execute the following:&lt;br /&gt;
&lt;br /&gt;
   ./dfu-util  -a kernel -R -D uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin&lt;br /&gt;
&lt;br /&gt;
which should get you the following, and it should only take a few&lt;br /&gt;
seconds to finish:&lt;br /&gt;
&lt;br /&gt;
dfu-util - (C) 2007 by OpenMoko Inc.&lt;br /&gt;
This program is Free Software and has ABSOLUTELY NO WARRANTY&lt;br /&gt;
&lt;br /&gt;
   Opening USB Device 0x0000:0x0000...&lt;br /&gt;
   Claiming USB DFU Runtime Interface...&lt;br /&gt;
   Determining device status: state = appIDLE, status = 0&lt;br /&gt;
   Device really in Runtime Mode, send DFU detach request...&lt;br /&gt;
   Resetting USB...&lt;br /&gt;
   Opening USB Device...&lt;br /&gt;
   Found Runtime: [0x1457:0x5119] devnum=3, cfg=0, intf=0, alt=3, name=&amp;quot;kernel&amp;quot;&lt;br /&gt;
   Claiming USB DFU Interface...&lt;br /&gt;
   Setting Alternate Setting ...&lt;br /&gt;
   Determining device status: state = dfuIDLE, status = 0&lt;br /&gt;
   dfuIDLE, continuing&lt;br /&gt;
   Transfer Size = 0x1000&lt;br /&gt;
   bytes_per_hash=30772&lt;br /&gt;
   Starting download: [##################################################]&lt;br /&gt;
   finished!&lt;br /&gt;
   state(2) = dfuIDLE, status(0) = No error condition is present&lt;br /&gt;
   Done!&lt;br /&gt;
   Resetting USB to switch back to runtime mode&lt;br /&gt;
&lt;br /&gt;
After that, execute the following:&lt;br /&gt;
&lt;br /&gt;
    ./dfu-util -a rootfs -R -D qtopia-rootfs.2-11270550.jffs2&lt;br /&gt;
&lt;br /&gt;
which should get you the following, and it should take between 5-10min&lt;br /&gt;
to finish:&lt;br /&gt;
&lt;br /&gt;
dfu-util - (C) 2007 by OpenMoko Inc.&lt;br /&gt;
This program is Free Software and has ABSOLUTELY NO WARRANTY&lt;br /&gt;
&lt;br /&gt;
  Opening USB Device 0x0000:0x0000...&lt;br /&gt;
  Claiming USB DFU Runtime Interface...&lt;br /&gt;
  Determining device status: state = appIDLE, status = 0&lt;br /&gt;
  Device really in Runtime Mode, send DFU detach request...&lt;br /&gt;
  Resetting USB...&lt;br /&gt;
  Opening USB Device...&lt;br /&gt;
  Found Runtime: [0x1457:0x5119] devnum=5, cfg=0, intf=0, alt=5, name=&amp;quot;rootfs&amp;quot;&lt;br /&gt;
  Claiming USB DFU Interface...&lt;br /&gt;
  Setting Alternate Setting ...&lt;br /&gt;
  Determining device status: state = dfuIDLE, status = 0&lt;br /&gt;
  dfuIDLE, continuing&lt;br /&gt;
  Transfer Size = 0x1000&lt;br /&gt;
  bytes_per_hash=639122&lt;br /&gt;
  Starting download: [##################################################]&lt;br /&gt;
  finished!&lt;br /&gt;
  state(2) = dfuIDLE, status(0) = No error condition is present&lt;br /&gt;
  Done!&lt;br /&gt;
  Resetting USB to switch back to runtime mode&lt;br /&gt;
&lt;br /&gt;
In both cases, some text on your Neo should appear, indicating that the&lt;br /&gt;
kernel or the rootfs are being downloaded.&lt;br /&gt;
&lt;br /&gt;
After this, the Neo should be able to boot, and depending on how you&lt;br /&gt;
have your boot menu set up, choose &amp;quot;Boot&amp;quot; or perhaps &amp;quot;Boot from NAND&amp;quot;.&lt;br /&gt;
The method described above in any case puts the software on the NAND&lt;br /&gt;
flash, and not on an SD card, if you have that installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lasted official Qtopia flash images are found at: http://www.qtopia.net/modules/mydownloads/ (Scroll down on this page to find them)&lt;br /&gt;
&lt;br /&gt;
Unofficial Qtopia images can be found in the ScaredyCat and Chooseopen [[repositories]].&lt;br /&gt;
&lt;br /&gt;
For more details on the the process of flashing the Neo, see [[Flashing openmoko]].&lt;br /&gt;
&lt;br /&gt;
== Dual-booting between Qtopia and X ==&lt;br /&gt;
&lt;br /&gt;
Both examples described here require you to reformat your MicroSD card to ext3, so this is the first step for both:&lt;br /&gt;
&lt;br /&gt;
{{warning|The following step will reformat your MircoSD card with the ext3 filesystem. We need it because we need support for symbolic or/and static links, which other filesystems like FAT do not support directly. After reformatting, no data on the card will be accessible to you anymore, so create good backups of anything which you need before starting!}}&lt;br /&gt;
&lt;br /&gt;
Then ssh to your neo and reformat your MicroSD card with:&lt;br /&gt;
 umount /dev/mmcblk0p1&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1&lt;br /&gt;
 mount /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
=== Installing Qtopia into an openmoko rootfs ===&lt;br /&gt;
&lt;br /&gt;
On [http://www.qtopia.net/modules/devices/openmoko.php], click &amp;quot;Developer root filesystem&amp;quot;. Then extract opt/Qtopia and the qpe init script and copy both to the mmc card of your neo:&lt;br /&gt;
&lt;br /&gt;
 tar xzf ficgta01-qtopia-developer-rootfs.tgz opt/Qtopia etc/init.d/qpe&lt;br /&gt;
 mv opt/Qtopia etc/init.d/qpe . &amp;amp;&amp;amp; rm -r opt etc&lt;br /&gt;
 tar czf Qtopia.tar.gz Qtopia qpe&lt;br /&gt;
 scp Qtopia.tar.gz root@192.168.0.202:/media/card/&lt;br /&gt;
&lt;br /&gt;
Log in to your Neo and unpack the archive and install it:&lt;br /&gt;
&lt;br /&gt;
 cd /media/card&lt;br /&gt;
 tar xzf Qtopia.tar.gz&lt;br /&gt;
 mkdir -p /opt&lt;br /&gt;
 ln -s /media/card/Qtopia /opt/Qtopia&lt;br /&gt;
 mv qpe /etc/init.d&lt;br /&gt;
&lt;br /&gt;
Now kill the X server and gsmd and start Qtopia (this can take some time):&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/xserver-nodm stop&lt;br /&gt;
 /etc/init.d/gsmd stop&lt;br /&gt;
 /etc/init.d/qpe start&lt;br /&gt;
&lt;br /&gt;
Now, in theory, it should be possible to could create a new entry in the [[uboot]] boot menu which adds a new boot argument to the kernel, say &amp;quot;qtopia=1&amp;quot; and you could could write a script which checks that boot parameter by checking if &amp;quot;$qtopia&amp;quot; is set to &amp;quot;1&amp;quot; or by checking /proc/cmdline and then boot Qtopia instead of X.&lt;br /&gt;
&lt;br /&gt;
=== Installing Qtopia on the SD card ===&lt;br /&gt;
&lt;br /&gt;
* format your SD card with ext3 and mount it (see above)&lt;br /&gt;
* unpack rootfs from qtopia-4.3.0-preview-neo-flash.tgz to SD card (see above)&lt;br /&gt;
* copy the uImage-2.6.22.5-moko11-r2-fic-gta01.bin kernel to the boot/ on SD card and rename it to uImage&lt;br /&gt;
* put a 'Boot from SD' menu item in uboot menu as explained here: [[Booting_from_SD#Step_3:_Add_uboot_boot_entry]]&lt;br /&gt;
&lt;br /&gt;
== Build Qtopia from source ==&lt;br /&gt;
If you want to build qtopia for yourself you can download the [ftp://ftp.trolltech.com/qtopia/tech-preview/ technical preview] or [ftp://ftp.trolltech.com/qtopia/snapshots/ snapshots]&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
Most things seem to work out of the box, however you might need to use the following command to get audio (but not with the official flash image available from Trolltech):&lt;br /&gt;
 alsactl -f /etc/gsmhandset.state restore&lt;br /&gt;
Or put this command in /etc/init.d/qpe line 64&lt;br /&gt;
&lt;br /&gt;
Do not switch themes.  Only the default theme is usable.  For example, once you switch themes, the lock feature continues to work, but only if you unlock using the smallest # keypad in the world.&lt;br /&gt;
&lt;br /&gt;
Suspend support is very flaky.  The neo often shuts off from a suspend state.  It will not wake from suspend for an incoming call or text message (someone try setting an alarm and report results here).  To turn suspend off (this will of course use the batteries very quickly), hit the down arrow next to the suspend setting in the power management until it says &amp;quot;Off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When using the &amp;quot;Predictive keyboard,&amp;quot; do a quick flick up or down over the keyboard to access numbers/symbols/capitals. In snapshot builds, you can select virtual keyboard by tapping on the little arrow icon to the left of the battery status icon.&lt;br /&gt;
&lt;br /&gt;
In summary, Qtopia on the Neo1973 is much closer to being ready than OpenMoko as of this writing.  However, sound and suspend support prevent it from being at all useful as a cell phone (as a landline that doesn't ring but instead vibrates, it works ok).&lt;br /&gt;
&lt;br /&gt;
The [http://www.qtopia.net/modules/newbb_plus/viewtopic.php?topic_id=473&amp;amp;forum=4 Qtopia forum area on the FIC GTA01] might be helpful, but it is preferred that you update this section with issues and fixes which you find.&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Qtopia001.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia002.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia003.png|thumb|center|240px]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Qtopia004.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia005.png|thumb|center|240px]]&lt;br /&gt;
|[[Image:Qtopia006.png|thumb|center|240px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Videos ==&lt;br /&gt;
&lt;br /&gt;
 http://www.youtube.com/watch?v=YW5q8SpY7t4&lt;br /&gt;
 http://www.youtube.com/watch?v=iOG_mtSEMgs&lt;br /&gt;
&lt;br /&gt;
For full size videos, 346 MiB:&lt;br /&gt;
&lt;br /&gt;
 http://linuxtracker.org/download.php?id=4613&amp;amp;name=qt_on_neo1973_videos.torrent&lt;br /&gt;
&lt;br /&gt;
{{Languages|Qtopia_on_Neo1973}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Sander</name></author>	</entry>

	</feed>