<?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=AudriusA&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=AudriusA&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Special:Contributions/AudriusA"/>
		<updated>2013-05-18T15:39:45Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.6</generator>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Marketing_Mistakes</id>
		<title>Marketing Mistakes</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Marketing_Mistakes"/>
				<updated>2009-10-03T22:08:47Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* From the view point of developer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The analysis of the marketing of OpenMoko Freerunner reveals the following problems:&lt;br /&gt;
&lt;br /&gt;
== From the view point of the inexperienced customer ==&lt;br /&gt;
&lt;br /&gt;
* Freerunner was shipped to the user as an experimental device and not as working device for everyday use for ''novice users''.&lt;br /&gt;
* the only widely accepted distribution is QT extended distribution, so the OpenMoko should have a pre-installed ''QT extended improved'' distribution.&lt;br /&gt;
* Developers are able to flash the freerunner to any other distrubtion they want to test, ordinary users have problems to do that, so this fact is also indicating that QT extended improved should be the distribution of choice that is pre-installed of the freerunner.&lt;br /&gt;
* the big advantage of the freerunner is the open source concept - using OpenStreetMap in a ''car navigation system'' like navit on the device is really a unique selling position for the freerunner. This implies that the freerunner has a car-navigation system pre-installed e.g. 'navit' or 'roadmap' on the device and the wiki of OpenMoko has working tutorial with which an ordinary user can download and upload a map of his/her choice to the freerunner easily.&lt;br /&gt;
* The wiki was not divided in an area for 'novice users' of the device and 'more advanced users' that have experience with linux systems.&lt;br /&gt;
* this leads to maintainance of the wiki that has no working tutorial with which an ordinary user can:&lt;br /&gt;
** synchronize PIM data (contacts, tasks, ...) of ''kontact, evolution'' ... on a linux box with the QT extended improved distribution (Mac OS, Win OS should be considered too)&lt;br /&gt;
** download maps of choice to a pre-installed car-navigation system on a QT extended improved distribution&lt;br /&gt;
** add new language modules for spanish, italian, ... easily on the device.&lt;br /&gt;
* the freerunner could have two distributions installed at the same time with Qi and removing the SD card starts the second distribution e.g SHR or ship the freerunner with two SD cards so that the user can select the distribution just by exchanging the SD card (e.g. QT or SHR). &lt;br /&gt;
&lt;br /&gt;
'''Summary:''' if the shipped device and tutorials on the wiki are not tailored to novice users the sold numbers of freerunner will remain low, which would be bad, because a wonderful approach of the freerunner and the OpenMoko team should not die, because of these marketng mistakes that can be eliminated!&lt;br /&gt;
&lt;br /&gt;
== From the view point of developer ==&lt;br /&gt;
* The student - developer was considered as a minor customer. The size of this market can be roughly estimated as the number of Neo 1973's sold (these were clearly developer devices) plus likely some more as it is not the only Linux device developers would buy. It seems that this segment was not actually tiny and deserved more attention.&lt;br /&gt;
* Similarly, the market segment of the university teaching projects was not properly taken into consideration, no academic requirements were collected and there were student blogs on a web that the device performed poorly in this area.&lt;br /&gt;
* After making Freerunner available, support for Neo 1973 has been aggressively dropped up till level of refusing to host the images for this device in the official OpenMoko website. Managers likely wanted to force developers to buy Freerunner ASAP but likely created a group of people who just stopped participating in development. The reasons for that are:&lt;br /&gt;
** These devices are not exactly very cheap and not all developers can afford to change them on a yearly basis.&lt;br /&gt;
** Free software folk just universally hate any aggressive manipulation by marketing people.&lt;br /&gt;
* The on screen terminal that was available in the first releases has been dropped later, making pointless any porting of the command line software (that some developers would be using). With all respect to usability, problems should be solved by adding features, not by removing them.&lt;br /&gt;
* Some developers with high reputation in the FOSS world that initially worked for Openmoko have left the development team. This created certain negative aura (not necessarily deserved). It was a responsibility of the marketing section to work on restoring the positive image rather than just choosing the dead silence instead.&lt;br /&gt;
* Splitting very limited efforts between so many distributions shows the total absence of any priority management.&lt;br /&gt;
&lt;br /&gt;
In general, the existing segment of students and other enthusiasts was ignored, rushing into the mass user as into holly grail. The mass user is actually difficult to get: he is far more demanding to the quality of both software and hardware, he wants something really convenient and innovative and, the worst, the software freedom for that every single GNU hacker is ready to dial by typing TTY commands on the touch screen (talking with Morse code afterwards) may matter much less. This is not necessarily a tragedy, this is how Linux started and needed to get stronger before going into masses. It looks that going into masses with Freerunner as it was has just been premature.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Marketing_Mistakes</id>
		<title>Marketing Mistakes</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Marketing_Mistakes"/>
				<updated>2009-10-03T21:52:37Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* From the view point of developer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The analysis of the marketing of OpenMoko Freerunner reveals the following problems:&lt;br /&gt;
&lt;br /&gt;
== From the view point of the inexperienced customer ==&lt;br /&gt;
&lt;br /&gt;
* Freerunner was shipped to the user as an experimental device and not as working device for everyday use for ''novice users''.&lt;br /&gt;
* the only widely accepted distribution is QT extended distribution, so the OpenMoko should have a pre-installed ''QT extended improved'' distribution.&lt;br /&gt;
* Developers are able to flash the freerunner to any other distrubtion they want to test, ordinary users have problems to do that, so this fact is also indicating that QT extended improved should be the distribution of choice that is pre-installed of the freerunner.&lt;br /&gt;
* the big advantage of the freerunner is the open source concept - using OpenStreetMap in a ''car navigation system'' like navit on the device is really a unique selling position for the freerunner. This implies that the freerunner has a car-navigation system pre-installed e.g. 'navit' or 'roadmap' on the device and the wiki of OpenMoko has working tutorial with which an ordinary user can download and upload a map of his/her choice to the freerunner easily.&lt;br /&gt;
* The wiki was not divided in an area for 'novice users' of the device and 'more advanced users' that have experience with linux systems.&lt;br /&gt;
* this leads to maintainance of the wiki that has no working tutorial with which an ordinary user can:&lt;br /&gt;
** synchronize PIM data (contacts, tasks, ...) of ''kontact, evolution'' ... on a linux box with the QT extended improved distribution (Mac OS, Win OS should be considered too)&lt;br /&gt;
** download maps of choice to a pre-installed car-navigation system on a QT extended improved distribution&lt;br /&gt;
** add new language modules for spanish, italian, ... easily on the device.&lt;br /&gt;
* the freerunner could have two distributions installed at the same time with Qi and removing the SD card starts the second distribution e.g SHR or ship the freerunner with two SD cards so that the user can select the distribution just by exchanging the SD card (e.g. QT or SHR). &lt;br /&gt;
&lt;br /&gt;
'''Summary:''' if the shipped device and tutorials on the wiki are not tailored to novice users the sold numbers of freerunner will remain low, which would be bad, because a wonderful approach of the freerunner and the OpenMoko team should not die, because of these marketng mistakes that can be eliminated!&lt;br /&gt;
&lt;br /&gt;
== From the view point of developer ==&lt;br /&gt;
* The student - developer was considered as a minor customer. The size of this market can be roughly estimated as the number of Neo 1973's sold (these were clearly developer devices) plus likely some more as it is not the only Linux device developers would buy. It seems that this segment was not actually tiny and deserved more attention.&lt;br /&gt;
* Similarly, the market segment of the university teaching projects was not properly taken into consideration, no academic requirements were collected and there were student blogs on a web that the device performed poorly in this area.&lt;br /&gt;
* After making Freerunner available, support for Neo 1973 has been aggressively dropped up till level of refusing to host the images for this device in the official OpenMoko website. Managers likely wanted to force developers to buy Freerunner ASAP but likely created a group of people who just stopped participating in development. The reasons for that are:&lt;br /&gt;
** These devices are not exactly very cheap and not all developers can afford to change them on a yearly basis.&lt;br /&gt;
** Free software folk just universally hate any aggressive manipulation by marketing people.&lt;br /&gt;
* The on screen terminal that was available in the first releases has been dropped later, making pointless any porting of the command line software (that some developers would be using). With all respect to usability, problems should be solved by adding features, not by removing them.&lt;br /&gt;
* Some developers with high reputation in the FOSS world that initially worked for Openmoko have left the development team. This created certain negative aura (not necessarily deserved). It was a responsibility of the marketing section to work on restoring the positive image rather than just choosing the dead silence instead.&lt;br /&gt;
* Splitting very limited efforts between so many distributions shows the total absence of any priority management.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Marketing_Mistakes</id>
		<title>Marketing Mistakes</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Marketing_Mistakes"/>
				<updated>2009-10-03T12:38:58Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The analysis of the marketing of OpenMoko Freerunner reveals the following problems:&lt;br /&gt;
&lt;br /&gt;
== From the view point of the inexperienced customer ==&lt;br /&gt;
&lt;br /&gt;
* Freerunner was shipped to the user as an experimental device and not as working device for everyday use for ''novice users''.&lt;br /&gt;
* the only widely accepted distribution is QT extended distribution, so the OpenMoko should have a pre-installed ''QT extended improved'' distribution.&lt;br /&gt;
* Developers are able to flash the freerunner to any other distrubtion they want to test, ordinary users have problems to do that, so this fact is also indicating that QT extended improved should be the distribution of choice that is pre-installed of the freerunner.&lt;br /&gt;
* the big advantage of the freerunner is the open source concept - using OpenStreetMap in a ''car navigation system'' like navit on the device is really a unique selling position for the freerunner. This implies that the freerunner has a car-navigation system pre-installed e.g. 'navit' or 'roadmap' on the device and the wiki of OpenMoko has working tutorial with which an ordinary user can download and upload a map of his/her choice to the freerunner easily.&lt;br /&gt;
* The wiki was not divided in an area for 'novice users' of the device and 'more advanced users' that have experience with linux systems.&lt;br /&gt;
* this leads to maintainance of the wiki that has no working tutorial with which an ordinary user can:&lt;br /&gt;
** synchronize PIM data (contacts, tasks, ...) of ''kontact, evolution'' ... on a linux box with the QT extended improved distribution (Mac OS, Win OS should be considered too)&lt;br /&gt;
** download maps of choice to a pre-installed car-navigation system on a QT extended improved distribution&lt;br /&gt;
** add new language modules for spanish, italian, ... easily on the device.&lt;br /&gt;
* the freerunner could have two distributions installed at the same time with Qi and removing the SD card starts the second distribution e.g SHR or ship the freerunner with two SD cards so that the user can select the distribution just by exchanging the SD card (e.g. QT or SHR). &lt;br /&gt;
&lt;br /&gt;
'''Summary:''' if the shipped device and tutorials on the wiki are not tailored to novice users the sold numbers of freerunner will remain low, which would be bad, because a wonderful approach of the freerunner and the OpenMoko team should not die, because of these marketng mistakes that can be eliminated!&lt;br /&gt;
&lt;br /&gt;
== From the view point of developer ==&lt;br /&gt;
* The student - developer was considered as a minor customer. The size of this market can be roughly estimated as the number of Neo 1973's sold (these were clearly developer devices). It seems that this segment was not actually tiny and deserved more attention.&lt;br /&gt;
* Similarly, the market segment of the university teaching projects was not properly taken into consideration, no academic requirements were collected and there were student blogs on a web that the device performed poorly in this area.&lt;br /&gt;
* After making Freerunner available, support for Neo 1973 has been aggressively dropped up till level of refusing to host the images for this device in the official OpenMoko website. Managers likely wanted to force developers to buy Freerunner ASAP but likely created a group of people who just stopped participating in development. The reasons for that are:&lt;br /&gt;
** These devices are not exactly very cheap and not all developers can afford to change them on a yearly basis.&lt;br /&gt;
** Free software folk just universally hate any aggressive manipulation by marketing people.&lt;br /&gt;
* The on screen terminal that was available in the first releases has been dropped later, making pointless any porting of the command line software (that some developers would be using). With all respect to usability, problems should be solved by adding features, not by removing them.&lt;br /&gt;
* Some developers with high reputation in the FOSS world that initially worked for Openmoko have left the development team. This created certain negative aura (not necessarily deserved). It was a responsibility of the marketing section to work on restoring the positive image rather than just choosing the dead silence instead.&lt;br /&gt;
* Splitting very limited efforts between so many distributions shows the total absence of any priority management.&lt;br /&gt;
&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2009-06-16T15:53:27Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel). This NMEA log is available in the project page]]&lt;br /&gt;
&lt;br /&gt;
{{Application|GPS Sight}}&lt;br /&gt;
&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
GPS Sight is unusual as it reads NMEA pipe directly, not relying on the intermediate library layer like gpsd or gipsy. This allows the developer to have an experience of directly interacting with GPS chip. Direct communication is practical because NMEA is a plain text format the must follow the standard and it is easy to get just by reading from the known location in the filesystem.  &lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. &lt;br /&gt;
&lt;br /&gt;
== Neo 1973 ==&lt;br /&gt;
With Neo, the released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The first version were trying to read from the NMEA pipe in periodic scheduled calls but this results &amp;quot;time travelling effect&amp;quot;. Then 'select' function was involved that improved performance but created big loads on CPU. To reduce the loads, the incremental waiting time was introduced and finally we switched to using GTK built - in channel input library that can schedule call exactly when input from the pipe is available.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most of work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
{{ApplicationBox|&lt;br /&gt;
  Name=[[GPS Sight]]|&lt;br /&gt;
  Description=The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps).|&lt;br /&gt;
  Screenshot=Image-Gpv 0 0 screen shot 2.jpg|&lt;br /&gt;
  Homepage=http://projects.openmoko.org/projects/gpv|&lt;br /&gt;
  TestedOn=Neo 1973, FreeRunner|&lt;br /&gt;
  PackageName=gpssight_0.8.4_freerunner.armv4t.ipk (FreeRunner), gpssight_0.8.4_armv4t.ipk (Neo)&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS Applications]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2009-06-16T06:27:10Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Project organization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel). This NMEA log is available in the project page]]&lt;br /&gt;
&lt;br /&gt;
{{Application|GPS Sight}}&lt;br /&gt;
&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. &lt;br /&gt;
&lt;br /&gt;
== Neo 1973 ==&lt;br /&gt;
With Neo, the released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The first version were trying to read from the NMEA pipe in periodic scheduled calls but this results &amp;quot;time travelling effect&amp;quot;. Then 'select' function was involved that improved performance but created big loads on CPU. To reduce the loads, the incremental waiting time was introduced and finally we switched to using GTK built - in channel input library that can schedule call exactly when input from the pipe is available.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most of work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
{{ApplicationBox|&lt;br /&gt;
  Name=[[GPS Sight]]|&lt;br /&gt;
  Description=The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps).|&lt;br /&gt;
  Screenshot=Image-Gpv 0 0 screen shot 2.jpg|&lt;br /&gt;
  Homepage=http://projects.openmoko.org/projects/gpv|&lt;br /&gt;
  TestedOn=Neo 1973, FreeRunner|&lt;br /&gt;
  PackageName=gpssight_0.8.4_freerunner.armv4t.ipk (FreeRunner), gpssight_0.8.4_armv4t.ipk (Neo)&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS Applications]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2009-02-12T17:52:39Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel). This NMEA log is available in the project page]]&lt;br /&gt;
&lt;br /&gt;
{{Application|GPS Sight}}&lt;br /&gt;
&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. &lt;br /&gt;
&lt;br /&gt;
== Neo 1973 ==&lt;br /&gt;
With Neo, the released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The first version were trying to read from the NMEA pipe in periodic scheduled calls but this results &amp;quot;time travelling effect&amp;quot;. Then 'select' function was involved that improved performance but created big loads on CPU. To reduce the loads, the incremental waiting time was introduced and finally we switched to using GTK built - in channel input library that can schedule call exactly when input from the pipe is available.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most of work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
{{ApplicationBox|&lt;br /&gt;
  Name=[[GPS Sight]]|&lt;br /&gt;
  Description=The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps).|&lt;br /&gt;
  Screenshot=Image-Gpv 0 0 screen shot 2.jpg|&lt;br /&gt;
  Homepage=http://projects.openmoko.org/projects/gpv|&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:GPS Applications]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-31T14:29:28Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The shortest way */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. 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;
The default password is blank.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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 it).&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.254 (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.254&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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
== 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 F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-31T14:25:24Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The shortest way */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device (ssh works on port 22 that must be opened). 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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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 it).&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.254 (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.254&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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
) &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
== 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 F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-06T15:53:33Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The shortest way */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device. 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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-06T15:52:19Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The shortest way */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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;
&amp;lt;!-- The idea is to keep the short way simple - it is for recent distributions and typical network setup. If you think it is necessary to add more, please explain in the talk page why --!&amp;gt;&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):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device. 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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-06T15:45:02Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The shortest way */  rm addroute - never needed this under all distributions tested.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-06T12:13:44Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* sftp */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-06T12:13:24Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: sftp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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 browser the phone filesystem and deploy the test applications. Just enter sftp://root@192.168.0.202 into address bar.&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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-05T18:51:49Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Simple Manual Linux Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= 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 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-05T18:51:18Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* The more advanced way */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= Simple Manual Linux Configuration =&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-12-05T16:17:47Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Simple Manual Linux Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
= Simple Manual Linux Configuration =&lt;br /&gt;
=== The shortest way ===&lt;br /&gt;
This simple way has been tested with many Linux distributions 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.&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 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;
The default password is blank.&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&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;
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;
&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. 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;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;
su `whoami` -c &amp;quot;scp /etc/resolv.conf root@192.168.0.202:/etc/resolv.conf&amp;quot;&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;
= 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 full masquerading in the kernel and USB networking options enabled.  For default kernels in many Linux distributions, this will already be the case.  If not, you will need to enable:&lt;br /&gt;
&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Both USB networking options are available in the&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters''&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
''Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters -&amp;gt; Multipurpose USB Networking Framework''.&lt;br /&gt;
&lt;br /&gt;
For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
Masquerading options (tested on Linux 2.6.26.3) are found in:&lt;br /&gt;
&lt;br /&gt;
''Networking ---&amp;gt;&lt;br /&gt;
Networking options ---&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
To see the other options, 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;
= 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;
= 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;
/usr/local/etc/devd/cdce.conf as:&lt;br /&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;
&lt;br /&gt;
and /usr/local/etc/devd/cdce.sh as:&lt;br /&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;
&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;
&lt;br /&gt;
== Debian, Ubuntu and others ==&lt;br /&gt;
&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;
network 192.168.0.0&lt;br /&gt;
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&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;
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 Frerunner is plugged in.  The script uses the ip command to set the mac address of the usb network interface. 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;
&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;
(&lt;br /&gt;
busNum=$( printf %.2d $( expr match &amp;quot;$1&amp;quot; &amp;quot;usb\([0-9]*\)&amp;quot;) )&lt;br /&gt;
&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;
&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
=== 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. Network manager likes to latch onto the network device and add a default route through 192.168.0.202, breaking your network connection. Network manager also says you can't edit or remove this connection from its list. I'm going back to making the connection manually.&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;
&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;
=== 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;
&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;
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;
&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;
ADDRESS0=192.168.0.200&lt;br /&gt;
NETMASK0=255.255.255.0&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 FC8 &amp;amp; FC5 ===&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0:&lt;br /&gt;
&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
=== 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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
&lt;br /&gt;
. /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
cd /etc/sysconfig/network-scripts&lt;br /&gt;
. ./network-functions&lt;br /&gt;
&lt;br /&gt;
[ -f ../network ] &amp;amp;&amp;amp; . ../network&lt;br /&gt;
&lt;br /&gt;
CONFIG=${1}&lt;br /&gt;
&lt;br /&gt;
need_config ${CONFIG}&lt;br /&gt;
&lt;br /&gt;
source_config&lt;br /&gt;
&lt;br /&gt;
NETBITS=`ipcalc -p ${IPADDR} ${NETMASK} | awk -F'=' '{print $2;}'`&lt;br /&gt;
&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;
&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;
=== Option C - tested on F9 ===&lt;br /&gt;
(worked on FC8 too, can this be called &amp;quot;tested&amp;quot;?)&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;
== 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;
# 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;
&lt;br /&gt;
Create a new init script:&lt;br /&gt;
&lt;br /&gt;
cd /etc/init.d&lt;br /&gt;
ln -s net.lo net.usb0&lt;br /&gt;
&lt;br /&gt;
=== Manual Configuration ===&lt;br /&gt;
&lt;br /&gt;
Put iptables into use:&lt;br /&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;
&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;
&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;
&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 :&lt;br /&gt;
&lt;br /&gt;
 ssh root@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:&lt;br /&gt;
&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;
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;
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;
ps auxwwwwe | grep -m 1 DBUS_SESSION_BUS_ADDRESS&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;
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;
==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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:USB]]&lt;br /&gt;
[[Category:Implemented]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Talk:USB_Networking</id>
		<title>Talk:USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Talk:USB_Networking"/>
				<updated>2008-12-05T16:08:35Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Simple alternative manual method to connect the device */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Driver options in kernel config =&lt;br /&gt;
Hi, I didn't want to change it in case I was wrong, but I believe that the options to configure your&lt;br /&gt;
desktop as a host are not in &amp;quot;USB Support&amp;quot; as the article says:&lt;br /&gt;
&amp;quot;Both options are available in the Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters. For more info see the usbnet driver homepage.&amp;quot;&lt;br /&gt;
Aren't the options in &amp;lt;pre&amp;gt;Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters&amp;lt;/pre&amp;gt;&lt;br /&gt;
Can someone confirm this? I don't want to send people in the wrong direction, but that is the way it is in my system. Thanks. [[User:Mmanjos|Mmanjos]] 15:36, 4 November 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
= Thoughts on USB networking in the final product =&lt;br /&gt;
&lt;br /&gt;
There was some discussion on the #openmoko IRC channel on how to approach the USB networking automatic setup eventually in the final product.&lt;br /&gt;
&lt;br /&gt;
The Neo's IP will probably need to remain static, and chosen, as it is now, from some local address space. I would personally suggest to change to using an address higher in the 192.168.0.0 space, say, 192.168.19.73 (ehhehe) to reduce chance of conflicts. (Or use link-local space?)&lt;br /&gt;
* I don't think the 192.168.0.0 space is very problematic if network is configured as 192.168.0.192/26 instead of 192.168.0.0/24, as explained in the Debian example I've just enhanced in the page. [[User:OlivierBerger|OlivierBerger]] 07:35, 25 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
Anyway, for the casual user, and even comfort-seeking geeks, OpenMoko will need to provide DHCP service. It will probably be also a good idea to run a DNS proxy, since that way the host doesn't need to care about changing DNS servers, and the caching is a good idea anyway for high latency GPRS. I'd suggest dnsmasq, which is simple and can handle both tasks. I assume the Neo will do IP masquerading for the USB host when it's acting as its default gateway.&lt;br /&gt;
&lt;br /&gt;
Now, the DHCP server should obviously serve up a local address to the USB host when connected (assuming here most hosts will use DHCP by default to configure the USB network device, which I think is a valid assumption, and if some don't, we can't help things automagically anyway).&lt;br /&gt;
&lt;br /&gt;
What's more complicated is when to give a default gateway and a DNS server address. You don't want to do it all the time, that would screw with simple use cases (detailed more below).&lt;br /&gt;
&lt;br /&gt;
== Suggested policies ==&lt;br /&gt;
&lt;br /&gt;
At this point I suggest, based on the aforementioned IRC discussion, the following policy:&lt;br /&gt;
&lt;br /&gt;
1) If the device is plugged into a host, and the device is not on-line with GPRS, do not go on-line, and only give a private address (no default route/dns) to host.&lt;br /&gt;
&lt;br /&gt;
2) If the phone is told to go on-line with GPRS (or, in the future, other mobile protocols) and it's presently hooked up to a USB host with only a local network connection, query the user if they want to use the Internet also from the computer. If yes, run the interface down, then up again, thus triggering the host to make a new DHCP query. Now serve up default gateway and dns information too.&lt;br /&gt;
&lt;br /&gt;
3) If the phone is told to go off-line while routing a network connection to a USB host, cycle the interface again and only serve up a local address. Possibly ask if the user really wants to disconnect considering the tether.&lt;br /&gt;
&lt;br /&gt;
4) If the phone is presently on-line with GPRS, and it's plugged into a host, initialize with only the local network connection, query the user (with a dialog or less obtrusively with a suitable panel button or panel GPRS menu changing appearance) whether they want to use the connection from the computer too. If yes, cycle interface, serve up default gateway and dns. Remove the query if usb disconnected.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
The rationale for not serving up a default route too eagerly is that this device charges from USB, people will probably sync it via USB, and they don't want any hassle doing that. Use cases to demonstrate:&lt;br /&gt;
&lt;br /&gt;
1) John wants to sync addressbooks between his home desktop and the Neo. He uses USBnet for this, because where he lives, GPRS is crazy expensive, and besides, he doesn't want to have internet-visible servers on the desktop. He hooks the Neo up, and only wants local data transfer capabilities. What he doesn't want is to lose access to his broadband, so serving up default gateway and DNS would make him angry.&lt;br /&gt;
&lt;br /&gt;
2) Shirley has CommunitasticoMoko installed on her Neo, and thus is on-line via GPRS pretty much constantly. (Yes, Shirley lives in some more GPRS-friendly area.) Shirley wants to load up new music from her desktop to the phone, so she hooks the Neo up. Even though GPRS is on-line for CommunitasticoMoko, she doesn't want the desktop to suddenly lose her home broadband access. She gets asked (in the more or less obtrusive ways above) if she'd like to provide Internet access to the host. She doesn't care about the question, just transfers the files, unhooks, and is on the go. The query disappears, not bothering her anymore.&lt;br /&gt;
&lt;br /&gt;
3) Shirley's CommunitasticoMoko buddy Roxanne hooks the Neo up to her laptop. As she is also on-line via GPRS, she gets the query. She first thinks to only sync up the address books of her laptop and the Neo, but while doing that, she decides to go surfing for a bit too. Up till now, she's had a local network between the devices, but as she acknowledges to the Neo that yes, she wants on-line, the laptop will get a default gateway and a DNS server, and surfing she goes.&lt;br /&gt;
&lt;br /&gt;
4) Matt just wants to charge his Neo up. He couldn't care less about any networking, let alone the Neo interfering with his existing network connections. He hooks the Neo up, and the local network is initialized. That's of little consequence to Matt, but he gets the phone charged.&lt;br /&gt;
&lt;br /&gt;
5) Tom is charging his Neo via his laptop at home, when his home broadband is cut off by a road crew. He has reasonable GPRS pricing, so he wants it up as a backup. He tells the Neo to go on-line, whereupon he is asked, since the Neo is already plugged in, if he wants to share the connection to his laptop. And yes he does. The Neo cycles the interface, and the laptop gets an Internet connection.&lt;br /&gt;
&lt;br /&gt;
== Open questions == &lt;br /&gt;
&lt;br /&gt;
How to deal with Bluetooth and WiFi routing (for GTA02) in conjuction? Probably you'd not want to serve up default gateway per default if you're BT tethered, however, user might want to have one device BT tethered and another USB tethered. So perhaps best to leave the option open to share the connection via USB even if BT tethering is active, though especially in this case the option shouldn't be obtrusive; it'd probably be a rare use case.&lt;br /&gt;
&lt;br /&gt;
=== Additional use cases ===&lt;br /&gt;
&lt;br /&gt;
There is another use cases I'd  like to suggest for consideration:&lt;br /&gt;
&lt;br /&gt;
* Bertrand (who has a good broadband connection at home) lives in Expensive GPRS Country and has no Bluetooth / WLAN. He wants to plug his phone into his computer and run ipkg updates via his broadband connection. His PC is serving as a DHCP server and/or bridges all traffic through its interfaces (with STP preventing loops).&lt;br /&gt;
&lt;br /&gt;
Suggested policy:&lt;br /&gt;
* Before the phone assigns itself a local address, it asks for a DHCP address. If that fails, a link local address according to RFC 3927 is assigned.&lt;br /&gt;
&lt;br /&gt;
= Operation on Gentoo =&lt;br /&gt;
&lt;br /&gt;
One way of doing routing and NAT was recently added to the Wiki.  I followed the lead of the other examples and did it this way:&lt;br /&gt;
&lt;br /&gt;
  # Neo1973&lt;br /&gt;
  config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
  postup() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &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;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
  predown() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &lt;br /&gt;
            iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
            echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
If the intent is to have the NATing and routing turn on and off as the neo is plugged and unplugged, this is probably an approach that is more like that than the other way.&lt;br /&gt;
&lt;br /&gt;
== Dealing with NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager (the default for [http://www.sabayonlinux.org/ sabayon]) bypasses /etc/conf.d/net.usb0 by default. You need to modify /etc/conf.d/rc (or /etc/rc.conf on OpenRC) from&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.*&amp;quot;&lt;br /&gt;
to somehing like&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.eth* !net.wlan*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(see http://gentoo-wiki.com/HOWTO_NetworkManager)&lt;br /&gt;
&lt;br /&gt;
= Rewrite =&lt;br /&gt;
&lt;br /&gt;
I have rewritten this page for accuracy and clarity.  I took out redundant stuff, and tried to make it much clearer based upon my networking experience and discussions with users having problems in the #openmoko IRC channel.  I tried to avoid and remove first person comments (although made some myself).  &lt;br /&gt;
&lt;br /&gt;
The first section is very deliberate, since the ordering of this page was illogical, having gathered many random comments.  This allows user to step through the parts and make sure each is right before moving on.  There are further explanations that could be added - instead of a subnet, an explicit device route could be added for the .202 host, over USB. which avoids most routing problems (unless your desktop is also .202).  I hope though even without that, this covers most scenarios.  I intend to rewrite some of the other pages in the same way.&lt;br /&gt;
&lt;br /&gt;
= Changing flow =&lt;br /&gt;
&lt;br /&gt;
Miohtama, I'm not entirely happy about your unjustified reordering.  The page was structured in order to carefully explain to new users how to make it work, and for it be a very precise guide for helping those on IRC having problems - users I deal with.  I don't believe that your changes really facilitate that.  Putting stuff together because it seems to might superficially seem like a good idea, but it's not always.&lt;br /&gt;
&lt;br /&gt;
== Overlapping subnets ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please don't keep adding assertions that overlapping subnets don't work, or that assumptions are being made that they are different.  It does work, with a sufficiently small subnet for the FR (as the examples show).  Adding comments about insisting that users change their LAN subnets is unnecessary, and makes it that much harder for users - where this page was originally.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Talk:USB_Networking</id>
		<title>Talk:USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Talk:USB_Networking"/>
				<updated>2008-12-05T16:04:47Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Simple alternative manual method to connect the device */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Driver options in kernel config =&lt;br /&gt;
Hi, I didn't want to change it in case I was wrong, but I believe that the options to configure your&lt;br /&gt;
desktop as a host are not in &amp;quot;USB Support&amp;quot; as the article says:&lt;br /&gt;
&amp;quot;Both options are available in the Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters. For more info see the usbnet driver homepage.&amp;quot;&lt;br /&gt;
Aren't the options in &amp;lt;pre&amp;gt;Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters&amp;lt;/pre&amp;gt;&lt;br /&gt;
Can someone confirm this? I don't want to send people in the wrong direction, but that is the way it is in my system. Thanks. [[User:Mmanjos|Mmanjos]] 15:36, 4 November 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
= Thoughts on USB networking in the final product =&lt;br /&gt;
&lt;br /&gt;
There was some discussion on the #openmoko IRC channel on how to approach the USB networking automatic setup eventually in the final product.&lt;br /&gt;
&lt;br /&gt;
The Neo's IP will probably need to remain static, and chosen, as it is now, from some local address space. I would personally suggest to change to using an address higher in the 192.168.0.0 space, say, 192.168.19.73 (ehhehe) to reduce chance of conflicts. (Or use link-local space?)&lt;br /&gt;
* I don't think the 192.168.0.0 space is very problematic if network is configured as 192.168.0.192/26 instead of 192.168.0.0/24, as explained in the Debian example I've just enhanced in the page. [[User:OlivierBerger|OlivierBerger]] 07:35, 25 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
Anyway, for the casual user, and even comfort-seeking geeks, OpenMoko will need to provide DHCP service. It will probably be also a good idea to run a DNS proxy, since that way the host doesn't need to care about changing DNS servers, and the caching is a good idea anyway for high latency GPRS. I'd suggest dnsmasq, which is simple and can handle both tasks. I assume the Neo will do IP masquerading for the USB host when it's acting as its default gateway.&lt;br /&gt;
&lt;br /&gt;
Now, the DHCP server should obviously serve up a local address to the USB host when connected (assuming here most hosts will use DHCP by default to configure the USB network device, which I think is a valid assumption, and if some don't, we can't help things automagically anyway).&lt;br /&gt;
&lt;br /&gt;
What's more complicated is when to give a default gateway and a DNS server address. You don't want to do it all the time, that would screw with simple use cases (detailed more below).&lt;br /&gt;
&lt;br /&gt;
== Suggested policies ==&lt;br /&gt;
&lt;br /&gt;
At this point I suggest, based on the aforementioned IRC discussion, the following policy:&lt;br /&gt;
&lt;br /&gt;
1) If the device is plugged into a host, and the device is not on-line with GPRS, do not go on-line, and only give a private address (no default route/dns) to host.&lt;br /&gt;
&lt;br /&gt;
2) If the phone is told to go on-line with GPRS (or, in the future, other mobile protocols) and it's presently hooked up to a USB host with only a local network connection, query the user if they want to use the Internet also from the computer. If yes, run the interface down, then up again, thus triggering the host to make a new DHCP query. Now serve up default gateway and dns information too.&lt;br /&gt;
&lt;br /&gt;
3) If the phone is told to go off-line while routing a network connection to a USB host, cycle the interface again and only serve up a local address. Possibly ask if the user really wants to disconnect considering the tether.&lt;br /&gt;
&lt;br /&gt;
4) If the phone is presently on-line with GPRS, and it's plugged into a host, initialize with only the local network connection, query the user (with a dialog or less obtrusively with a suitable panel button or panel GPRS menu changing appearance) whether they want to use the connection from the computer too. If yes, cycle interface, serve up default gateway and dns. Remove the query if usb disconnected.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
The rationale for not serving up a default route too eagerly is that this device charges from USB, people will probably sync it via USB, and they don't want any hassle doing that. Use cases to demonstrate:&lt;br /&gt;
&lt;br /&gt;
1) John wants to sync addressbooks between his home desktop and the Neo. He uses USBnet for this, because where he lives, GPRS is crazy expensive, and besides, he doesn't want to have internet-visible servers on the desktop. He hooks the Neo up, and only wants local data transfer capabilities. What he doesn't want is to lose access to his broadband, so serving up default gateway and DNS would make him angry.&lt;br /&gt;
&lt;br /&gt;
2) Shirley has CommunitasticoMoko installed on her Neo, and thus is on-line via GPRS pretty much constantly. (Yes, Shirley lives in some more GPRS-friendly area.) Shirley wants to load up new music from her desktop to the phone, so she hooks the Neo up. Even though GPRS is on-line for CommunitasticoMoko, she doesn't want the desktop to suddenly lose her home broadband access. She gets asked (in the more or less obtrusive ways above) if she'd like to provide Internet access to the host. She doesn't care about the question, just transfers the files, unhooks, and is on the go. The query disappears, not bothering her anymore.&lt;br /&gt;
&lt;br /&gt;
3) Shirley's CommunitasticoMoko buddy Roxanne hooks the Neo up to her laptop. As she is also on-line via GPRS, she gets the query. She first thinks to only sync up the address books of her laptop and the Neo, but while doing that, she decides to go surfing for a bit too. Up till now, she's had a local network between the devices, but as she acknowledges to the Neo that yes, she wants on-line, the laptop will get a default gateway and a DNS server, and surfing she goes.&lt;br /&gt;
&lt;br /&gt;
4) Matt just wants to charge his Neo up. He couldn't care less about any networking, let alone the Neo interfering with his existing network connections. He hooks the Neo up, and the local network is initialized. That's of little consequence to Matt, but he gets the phone charged.&lt;br /&gt;
&lt;br /&gt;
5) Tom is charging his Neo via his laptop at home, when his home broadband is cut off by a road crew. He has reasonable GPRS pricing, so he wants it up as a backup. He tells the Neo to go on-line, whereupon he is asked, since the Neo is already plugged in, if he wants to share the connection to his laptop. And yes he does. The Neo cycles the interface, and the laptop gets an Internet connection.&lt;br /&gt;
&lt;br /&gt;
== Open questions == &lt;br /&gt;
&lt;br /&gt;
How to deal with Bluetooth and WiFi routing (for GTA02) in conjuction? Probably you'd not want to serve up default gateway per default if you're BT tethered, however, user might want to have one device BT tethered and another USB tethered. So perhaps best to leave the option open to share the connection via USB even if BT tethering is active, though especially in this case the option shouldn't be obtrusive; it'd probably be a rare use case.&lt;br /&gt;
&lt;br /&gt;
=== Additional use cases ===&lt;br /&gt;
&lt;br /&gt;
There is another use cases I'd  like to suggest for consideration:&lt;br /&gt;
&lt;br /&gt;
* Bertrand (who has a good broadband connection at home) lives in Expensive GPRS Country and has no Bluetooth / WLAN. He wants to plug his phone into his computer and run ipkg updates via his broadband connection. His PC is serving as a DHCP server and/or bridges all traffic through its interfaces (with STP preventing loops).&lt;br /&gt;
&lt;br /&gt;
Suggested policy:&lt;br /&gt;
* Before the phone assigns itself a local address, it asks for a DHCP address. If that fails, a link local address according to RFC 3927 is assigned.&lt;br /&gt;
&lt;br /&gt;
= Operation on Gentoo =&lt;br /&gt;
&lt;br /&gt;
One way of doing routing and NAT was recently added to the Wiki.  I followed the lead of the other examples and did it this way:&lt;br /&gt;
&lt;br /&gt;
  # Neo1973&lt;br /&gt;
  config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
  postup() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &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;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
  predown() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &lt;br /&gt;
            iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
            echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
If the intent is to have the NATing and routing turn on and off as the neo is plugged and unplugged, this is probably an approach that is more like that than the other way.&lt;br /&gt;
&lt;br /&gt;
== Dealing with NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager (the default for [http://www.sabayonlinux.org/ sabayon]) bypasses /etc/conf.d/net.usb0 by default. You need to modify /etc/conf.d/rc (or /etc/rc.conf on OpenRC) from&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.*&amp;quot;&lt;br /&gt;
to somehing like&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.eth* !net.wlan*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(see http://gentoo-wiki.com/HOWTO_NetworkManager)&lt;br /&gt;
&lt;br /&gt;
= Rewrite =&lt;br /&gt;
&lt;br /&gt;
I have rewritten this page for accuracy and clarity.  I took out redundant stuff, and tried to make it much clearer based upon my networking experience and discussions with users having problems in the #openmoko IRC channel.  I tried to avoid and remove first person comments (although made some myself).  &lt;br /&gt;
&lt;br /&gt;
The first section is very deliberate, since the ordering of this page was illogical, having gathered many random comments.  This allows user to step through the parts and make sure each is right before moving on.  There are further explanations that could be added - instead of a subnet, an explicit device route could be added for the .202 host, over USB. which avoids most routing problems (unless your desktop is also .202).  I hope though even without that, this covers most scenarios.  I intend to rewrite some of the other pages in the same way.&lt;br /&gt;
&lt;br /&gt;
= Changing flow =&lt;br /&gt;
&lt;br /&gt;
Miohtama, I'm not entirely happy about your unjustified reordering.  The page was structured in order to carefully explain to new users how to make it work, and for it be a very precise guide for helping those on IRC having problems - users I deal with.  I don't believe that your changes really facilitate that.  Putting stuff together because it seems to might superficially seem like a good idea, but it's not always.&lt;br /&gt;
&lt;br /&gt;
== Overlapping subnets ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please don't keep adding assertions that overlapping subnets don't work, or that assumptions are being made that they are different.  It does work, with a sufficiently small subnet for the FR (as the examples show).  Adding comments about insisting that users change their LAN subnets is unnecessary, and makes it that much harder for users - where this page was originally.&lt;br /&gt;
&lt;br /&gt;
= Simple alternative manual method to connect the device =&lt;br /&gt;
The following alternative method has been described in this page for a long time, but recently it was replaced by to my opinion far more complex and sophisticated instructions. I have never had any problems with the previous method but at the same time these new updated instructions seem not working at all under my desktop. Hence I decided to move the old sequence of operations from the history into the talk page:&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 log in to the Neo&lt;br /&gt;
 # ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Talk:USB_Networking</id>
		<title>Talk:USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Talk:USB_Networking"/>
				<updated>2008-12-05T16:04:00Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Simple alternative manual method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Driver options in kernel config =&lt;br /&gt;
Hi, I didn't want to change it in case I was wrong, but I believe that the options to configure your&lt;br /&gt;
desktop as a host are not in &amp;quot;USB Support&amp;quot; as the article says:&lt;br /&gt;
&amp;quot;Both options are available in the Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters. For more info see the usbnet driver homepage.&amp;quot;&lt;br /&gt;
Aren't the options in &amp;lt;pre&amp;gt;Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters&amp;lt;/pre&amp;gt;&lt;br /&gt;
Can someone confirm this? I don't want to send people in the wrong direction, but that is the way it is in my system. Thanks. [[User:Mmanjos|Mmanjos]] 15:36, 4 November 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
= Thoughts on USB networking in the final product =&lt;br /&gt;
&lt;br /&gt;
There was some discussion on the #openmoko IRC channel on how to approach the USB networking automatic setup eventually in the final product.&lt;br /&gt;
&lt;br /&gt;
The Neo's IP will probably need to remain static, and chosen, as it is now, from some local address space. I would personally suggest to change to using an address higher in the 192.168.0.0 space, say, 192.168.19.73 (ehhehe) to reduce chance of conflicts. (Or use link-local space?)&lt;br /&gt;
* I don't think the 192.168.0.0 space is very problematic if network is configured as 192.168.0.192/26 instead of 192.168.0.0/24, as explained in the Debian example I've just enhanced in the page. [[User:OlivierBerger|OlivierBerger]] 07:35, 25 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
Anyway, for the casual user, and even comfort-seeking geeks, OpenMoko will need to provide DHCP service. It will probably be also a good idea to run a DNS proxy, since that way the host doesn't need to care about changing DNS servers, and the caching is a good idea anyway for high latency GPRS. I'd suggest dnsmasq, which is simple and can handle both tasks. I assume the Neo will do IP masquerading for the USB host when it's acting as its default gateway.&lt;br /&gt;
&lt;br /&gt;
Now, the DHCP server should obviously serve up a local address to the USB host when connected (assuming here most hosts will use DHCP by default to configure the USB network device, which I think is a valid assumption, and if some don't, we can't help things automagically anyway).&lt;br /&gt;
&lt;br /&gt;
What's more complicated is when to give a default gateway and a DNS server address. You don't want to do it all the time, that would screw with simple use cases (detailed more below).&lt;br /&gt;
&lt;br /&gt;
== Suggested policies ==&lt;br /&gt;
&lt;br /&gt;
At this point I suggest, based on the aforementioned IRC discussion, the following policy:&lt;br /&gt;
&lt;br /&gt;
1) If the device is plugged into a host, and the device is not on-line with GPRS, do not go on-line, and only give a private address (no default route/dns) to host.&lt;br /&gt;
&lt;br /&gt;
2) If the phone is told to go on-line with GPRS (or, in the future, other mobile protocols) and it's presently hooked up to a USB host with only a local network connection, query the user if they want to use the Internet also from the computer. If yes, run the interface down, then up again, thus triggering the host to make a new DHCP query. Now serve up default gateway and dns information too.&lt;br /&gt;
&lt;br /&gt;
3) If the phone is told to go off-line while routing a network connection to a USB host, cycle the interface again and only serve up a local address. Possibly ask if the user really wants to disconnect considering the tether.&lt;br /&gt;
&lt;br /&gt;
4) If the phone is presently on-line with GPRS, and it's plugged into a host, initialize with only the local network connection, query the user (with a dialog or less obtrusively with a suitable panel button or panel GPRS menu changing appearance) whether they want to use the connection from the computer too. If yes, cycle interface, serve up default gateway and dns. Remove the query if usb disconnected.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
The rationale for not serving up a default route too eagerly is that this device charges from USB, people will probably sync it via USB, and they don't want any hassle doing that. Use cases to demonstrate:&lt;br /&gt;
&lt;br /&gt;
1) John wants to sync addressbooks between his home desktop and the Neo. He uses USBnet for this, because where he lives, GPRS is crazy expensive, and besides, he doesn't want to have internet-visible servers on the desktop. He hooks the Neo up, and only wants local data transfer capabilities. What he doesn't want is to lose access to his broadband, so serving up default gateway and DNS would make him angry.&lt;br /&gt;
&lt;br /&gt;
2) Shirley has CommunitasticoMoko installed on her Neo, and thus is on-line via GPRS pretty much constantly. (Yes, Shirley lives in some more GPRS-friendly area.) Shirley wants to load up new music from her desktop to the phone, so she hooks the Neo up. Even though GPRS is on-line for CommunitasticoMoko, she doesn't want the desktop to suddenly lose her home broadband access. She gets asked (in the more or less obtrusive ways above) if she'd like to provide Internet access to the host. She doesn't care about the question, just transfers the files, unhooks, and is on the go. The query disappears, not bothering her anymore.&lt;br /&gt;
&lt;br /&gt;
3) Shirley's CommunitasticoMoko buddy Roxanne hooks the Neo up to her laptop. As she is also on-line via GPRS, she gets the query. She first thinks to only sync up the address books of her laptop and the Neo, but while doing that, she decides to go surfing for a bit too. Up till now, she's had a local network between the devices, but as she acknowledges to the Neo that yes, she wants on-line, the laptop will get a default gateway and a DNS server, and surfing she goes.&lt;br /&gt;
&lt;br /&gt;
4) Matt just wants to charge his Neo up. He couldn't care less about any networking, let alone the Neo interfering with his existing network connections. He hooks the Neo up, and the local network is initialized. That's of little consequence to Matt, but he gets the phone charged.&lt;br /&gt;
&lt;br /&gt;
5) Tom is charging his Neo via his laptop at home, when his home broadband is cut off by a road crew. He has reasonable GPRS pricing, so he wants it up as a backup. He tells the Neo to go on-line, whereupon he is asked, since the Neo is already plugged in, if he wants to share the connection to his laptop. And yes he does. The Neo cycles the interface, and the laptop gets an Internet connection.&lt;br /&gt;
&lt;br /&gt;
== Open questions == &lt;br /&gt;
&lt;br /&gt;
How to deal with Bluetooth and WiFi routing (for GTA02) in conjuction? Probably you'd not want to serve up default gateway per default if you're BT tethered, however, user might want to have one device BT tethered and another USB tethered. So perhaps best to leave the option open to share the connection via USB even if BT tethering is active, though especially in this case the option shouldn't be obtrusive; it'd probably be a rare use case.&lt;br /&gt;
&lt;br /&gt;
=== Additional use cases ===&lt;br /&gt;
&lt;br /&gt;
There is another use cases I'd  like to suggest for consideration:&lt;br /&gt;
&lt;br /&gt;
* Bertrand (who has a good broadband connection at home) lives in Expensive GPRS Country and has no Bluetooth / WLAN. He wants to plug his phone into his computer and run ipkg updates via his broadband connection. His PC is serving as a DHCP server and/or bridges all traffic through its interfaces (with STP preventing loops).&lt;br /&gt;
&lt;br /&gt;
Suggested policy:&lt;br /&gt;
* Before the phone assigns itself a local address, it asks for a DHCP address. If that fails, a link local address according to RFC 3927 is assigned.&lt;br /&gt;
&lt;br /&gt;
= Operation on Gentoo =&lt;br /&gt;
&lt;br /&gt;
One way of doing routing and NAT was recently added to the Wiki.  I followed the lead of the other examples and did it this way:&lt;br /&gt;
&lt;br /&gt;
  # Neo1973&lt;br /&gt;
  config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
  postup() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &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;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
  predown() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &lt;br /&gt;
            iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
            echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
If the intent is to have the NATing and routing turn on and off as the neo is plugged and unplugged, this is probably an approach that is more like that than the other way.&lt;br /&gt;
&lt;br /&gt;
== Dealing with NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager (the default for [http://www.sabayonlinux.org/ sabayon]) bypasses /etc/conf.d/net.usb0 by default. You need to modify /etc/conf.d/rc (or /etc/rc.conf on OpenRC) from&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.*&amp;quot;&lt;br /&gt;
to somehing like&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.eth* !net.wlan*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(see http://gentoo-wiki.com/HOWTO_NetworkManager)&lt;br /&gt;
&lt;br /&gt;
= Rewrite =&lt;br /&gt;
&lt;br /&gt;
I have rewritten this page for accuracy and clarity.  I took out redundant stuff, and tried to make it much clearer based upon my networking experience and discussions with users having problems in the #openmoko IRC channel.  I tried to avoid and remove first person comments (although made some myself).  &lt;br /&gt;
&lt;br /&gt;
The first section is very deliberate, since the ordering of this page was illogical, having gathered many random comments.  This allows user to step through the parts and make sure each is right before moving on.  There are further explanations that could be added - instead of a subnet, an explicit device route could be added for the .202 host, over USB. which avoids most routing problems (unless your desktop is also .202).  I hope though even without that, this covers most scenarios.  I intend to rewrite some of the other pages in the same way.&lt;br /&gt;
&lt;br /&gt;
= Changing flow =&lt;br /&gt;
&lt;br /&gt;
Miohtama, I'm not entirely happy about your unjustified reordering.  The page was structured in order to carefully explain to new users how to make it work, and for it be a very precise guide for helping those on IRC having problems - users I deal with.  I don't believe that your changes really facilitate that.  Putting stuff together because it seems to might superficially seem like a good idea, but it's not always.&lt;br /&gt;
&lt;br /&gt;
== Overlapping subnets ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please don't keep adding assertions that overlapping subnets don't work, or that assumptions are being made that they are different.  It does work, with a sufficiently small subnet for the FR (as the examples show).  Adding comments about insisting that users change their LAN subnets is unnecessary, and makes it that much harder for users - where this page was originally.&lt;br /&gt;
&lt;br /&gt;
= Simple alternative manual method to connect the device =&lt;br /&gt;
The following alternative method has been described in this page for a long time, but recently it was replaced by to my opinion far more complex and sophisticated instructions. I have never had any problems with the previous method but at the same time these new updated instructions seem not working at all under my desktop. Hence I decided to take the old sequence of operations, moving them into the talk page:&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 log in to the Neo&lt;br /&gt;
 # ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Talk:USB_Networking</id>
		<title>Talk:USB Networking</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Talk:USB_Networking"/>
				<updated>2008-12-05T16:03:38Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: alternative method&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Driver options in kernel config =&lt;br /&gt;
Hi, I didn't want to change it in case I was wrong, but I believe that the options to configure your&lt;br /&gt;
desktop as a host are not in &amp;quot;USB Support&amp;quot; as the article says:&lt;br /&gt;
&amp;quot;Both options are available in the Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters. For more info see the usbnet driver homepage.&amp;quot;&lt;br /&gt;
Aren't the options in &amp;lt;pre&amp;gt;Device Drivers -&amp;gt; Network Device Support -&amp;gt; USB Network Adapters&amp;lt;/pre&amp;gt;&lt;br /&gt;
Can someone confirm this? I don't want to send people in the wrong direction, but that is the way it is in my system. Thanks. [[User:Mmanjos|Mmanjos]] 15:36, 4 November 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
= Thoughts on USB networking in the final product =&lt;br /&gt;
&lt;br /&gt;
There was some discussion on the #openmoko IRC channel on how to approach the USB networking automatic setup eventually in the final product.&lt;br /&gt;
&lt;br /&gt;
The Neo's IP will probably need to remain static, and chosen, as it is now, from some local address space. I would personally suggest to change to using an address higher in the 192.168.0.0 space, say, 192.168.19.73 (ehhehe) to reduce chance of conflicts. (Or use link-local space?)&lt;br /&gt;
* I don't think the 192.168.0.0 space is very problematic if network is configured as 192.168.0.192/26 instead of 192.168.0.0/24, as explained in the Debian example I've just enhanced in the page. [[User:OlivierBerger|OlivierBerger]] 07:35, 25 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
Anyway, for the casual user, and even comfort-seeking geeks, OpenMoko will need to provide DHCP service. It will probably be also a good idea to run a DNS proxy, since that way the host doesn't need to care about changing DNS servers, and the caching is a good idea anyway for high latency GPRS. I'd suggest dnsmasq, which is simple and can handle both tasks. I assume the Neo will do IP masquerading for the USB host when it's acting as its default gateway.&lt;br /&gt;
&lt;br /&gt;
Now, the DHCP server should obviously serve up a local address to the USB host when connected (assuming here most hosts will use DHCP by default to configure the USB network device, which I think is a valid assumption, and if some don't, we can't help things automagically anyway).&lt;br /&gt;
&lt;br /&gt;
What's more complicated is when to give a default gateway and a DNS server address. You don't want to do it all the time, that would screw with simple use cases (detailed more below).&lt;br /&gt;
&lt;br /&gt;
== Suggested policies ==&lt;br /&gt;
&lt;br /&gt;
At this point I suggest, based on the aforementioned IRC discussion, the following policy:&lt;br /&gt;
&lt;br /&gt;
1) If the device is plugged into a host, and the device is not on-line with GPRS, do not go on-line, and only give a private address (no default route/dns) to host.&lt;br /&gt;
&lt;br /&gt;
2) If the phone is told to go on-line with GPRS (or, in the future, other mobile protocols) and it's presently hooked up to a USB host with only a local network connection, query the user if they want to use the Internet also from the computer. If yes, run the interface down, then up again, thus triggering the host to make a new DHCP query. Now serve up default gateway and dns information too.&lt;br /&gt;
&lt;br /&gt;
3) If the phone is told to go off-line while routing a network connection to a USB host, cycle the interface again and only serve up a local address. Possibly ask if the user really wants to disconnect considering the tether.&lt;br /&gt;
&lt;br /&gt;
4) If the phone is presently on-line with GPRS, and it's plugged into a host, initialize with only the local network connection, query the user (with a dialog or less obtrusively with a suitable panel button or panel GPRS menu changing appearance) whether they want to use the connection from the computer too. If yes, cycle interface, serve up default gateway and dns. Remove the query if usb disconnected.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
The rationale for not serving up a default route too eagerly is that this device charges from USB, people will probably sync it via USB, and they don't want any hassle doing that. Use cases to demonstrate:&lt;br /&gt;
&lt;br /&gt;
1) John wants to sync addressbooks between his home desktop and the Neo. He uses USBnet for this, because where he lives, GPRS is crazy expensive, and besides, he doesn't want to have internet-visible servers on the desktop. He hooks the Neo up, and only wants local data transfer capabilities. What he doesn't want is to lose access to his broadband, so serving up default gateway and DNS would make him angry.&lt;br /&gt;
&lt;br /&gt;
2) Shirley has CommunitasticoMoko installed on her Neo, and thus is on-line via GPRS pretty much constantly. (Yes, Shirley lives in some more GPRS-friendly area.) Shirley wants to load up new music from her desktop to the phone, so she hooks the Neo up. Even though GPRS is on-line for CommunitasticoMoko, she doesn't want the desktop to suddenly lose her home broadband access. She gets asked (in the more or less obtrusive ways above) if she'd like to provide Internet access to the host. She doesn't care about the question, just transfers the files, unhooks, and is on the go. The query disappears, not bothering her anymore.&lt;br /&gt;
&lt;br /&gt;
3) Shirley's CommunitasticoMoko buddy Roxanne hooks the Neo up to her laptop. As she is also on-line via GPRS, she gets the query. She first thinks to only sync up the address books of her laptop and the Neo, but while doing that, she decides to go surfing for a bit too. Up till now, she's had a local network between the devices, but as she acknowledges to the Neo that yes, she wants on-line, the laptop will get a default gateway and a DNS server, and surfing she goes.&lt;br /&gt;
&lt;br /&gt;
4) Matt just wants to charge his Neo up. He couldn't care less about any networking, let alone the Neo interfering with his existing network connections. He hooks the Neo up, and the local network is initialized. That's of little consequence to Matt, but he gets the phone charged.&lt;br /&gt;
&lt;br /&gt;
5) Tom is charging his Neo via his laptop at home, when his home broadband is cut off by a road crew. He has reasonable GPRS pricing, so he wants it up as a backup. He tells the Neo to go on-line, whereupon he is asked, since the Neo is already plugged in, if he wants to share the connection to his laptop. And yes he does. The Neo cycles the interface, and the laptop gets an Internet connection.&lt;br /&gt;
&lt;br /&gt;
== Open questions == &lt;br /&gt;
&lt;br /&gt;
How to deal with Bluetooth and WiFi routing (for GTA02) in conjuction? Probably you'd not want to serve up default gateway per default if you're BT tethered, however, user might want to have one device BT tethered and another USB tethered. So perhaps best to leave the option open to share the connection via USB even if BT tethering is active, though especially in this case the option shouldn't be obtrusive; it'd probably be a rare use case.&lt;br /&gt;
&lt;br /&gt;
=== Additional use cases ===&lt;br /&gt;
&lt;br /&gt;
There is another use cases I'd  like to suggest for consideration:&lt;br /&gt;
&lt;br /&gt;
* Bertrand (who has a good broadband connection at home) lives in Expensive GPRS Country and has no Bluetooth / WLAN. He wants to plug his phone into his computer and run ipkg updates via his broadband connection. His PC is serving as a DHCP server and/or bridges all traffic through its interfaces (with STP preventing loops).&lt;br /&gt;
&lt;br /&gt;
Suggested policy:&lt;br /&gt;
* Before the phone assigns itself a local address, it asks for a DHCP address. If that fails, a link local address according to RFC 3927 is assigned.&lt;br /&gt;
&lt;br /&gt;
= Operation on Gentoo =&lt;br /&gt;
&lt;br /&gt;
One way of doing routing and NAT was recently added to the Wiki.  I followed the lead of the other examples and did it this way:&lt;br /&gt;
&lt;br /&gt;
  # Neo1973&lt;br /&gt;
  config_usb0=( &amp;quot;192.168.0.200 netmask 255.255.255.0&amp;quot; )&lt;br /&gt;
  postup() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &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;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
  predown() {&lt;br /&gt;
    case &amp;quot;${IFVAR}&amp;quot; in &lt;br /&gt;
        &amp;quot;usb0&amp;quot;) &lt;br /&gt;
            iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
            echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
            return 0;;&lt;br /&gt;
    esac&lt;br /&gt;
    return 0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
If the intent is to have the NATing and routing turn on and off as the neo is plugged and unplugged, this is probably an approach that is more like that than the other way.&lt;br /&gt;
&lt;br /&gt;
== Dealing with NetworkManager ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager (the default for [http://www.sabayonlinux.org/ sabayon]) bypasses /etc/conf.d/net.usb0 by default. You need to modify /etc/conf.d/rc (or /etc/rc.conf on OpenRC) from&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.*&amp;quot;&lt;br /&gt;
to somehing like&lt;br /&gt;
 RC_PLUG_SERVICES=&amp;quot;!net.eth* !net.wlan*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(see http://gentoo-wiki.com/HOWTO_NetworkManager)&lt;br /&gt;
&lt;br /&gt;
= Rewrite =&lt;br /&gt;
&lt;br /&gt;
I have rewritten this page for accuracy and clarity.  I took out redundant stuff, and tried to make it much clearer based upon my networking experience and discussions with users having problems in the #openmoko IRC channel.  I tried to avoid and remove first person comments (although made some myself).  &lt;br /&gt;
&lt;br /&gt;
The first section is very deliberate, since the ordering of this page was illogical, having gathered many random comments.  This allows user to step through the parts and make sure each is right before moving on.  There are further explanations that could be added - instead of a subnet, an explicit device route could be added for the .202 host, over USB. which avoids most routing problems (unless your desktop is also .202).  I hope though even without that, this covers most scenarios.  I intend to rewrite some of the other pages in the same way.&lt;br /&gt;
&lt;br /&gt;
= Changing flow =&lt;br /&gt;
&lt;br /&gt;
Miohtama, I'm not entirely happy about your unjustified reordering.  The page was structured in order to carefully explain to new users how to make it work, and for it be a very precise guide for helping those on IRC having problems - users I deal with.  I don't believe that your changes really facilitate that.  Putting stuff together because it seems to might superficially seem like a good idea, but it's not always.&lt;br /&gt;
&lt;br /&gt;
== Overlapping subnets ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please don't keep adding assertions that overlapping subnets don't work, or that assumptions are being made that they are different.  It does work, with a sufficiently small subnet for the FR (as the examples show).  Adding comments about insisting that users change their LAN subnets is unnecessary, and makes it that much harder for users - where this page was originally.&lt;br /&gt;
&lt;br /&gt;
== Simple alternative manual method ==&lt;br /&gt;
The following alternative method has been described in this page for a long time, but recently it was replaced by to my opinion far more complex and sophisticated instructions. I have never had any problems with the previous method but at the same time these new updated instructions seem not working at all under my desktop. Hence I decided to take the old sequence of operations, moving them into the talk page:&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 log in to the Neo&lt;br /&gt;
 # ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
&lt;br /&gt;
Do not forget to adjust your firewall so that you can connect to the device.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Gpsd</id>
		<title>Gpsd</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Gpsd"/>
				<updated>2008-07-13T09:04:55Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Q: Can I get NMEA data from the GPS? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is GPS ==&lt;br /&gt;
&lt;br /&gt;
The Global Positioning System (GPS) is a a satellite positioning system, using a constellation of 31 satellites.&lt;br /&gt;
&lt;br /&gt;
GPS uses these as &amp;quot;man-made stars&amp;quot; to calculate positions to within a meter. With some forms of GPS. measurements accurate to  better than a centimeter can be made.&lt;br /&gt;
&lt;br /&gt;
With advancing technology, receivers have shrunk from several dozen ICs and hundreds of other components, to one, and a handfull. &lt;br /&gt;
&lt;br /&gt;
This has drastically reduced costs.&lt;br /&gt;
&lt;br /&gt;
The reducing cost has enabled it to be easily integrated in phones, laptops, cameras, as well as more traditional apparatus such as farming equipment, navigation systems and construction equipment.&lt;br /&gt;
&lt;br /&gt;
(Another helpful overview [http://www.colorado.edu/geography/gcraft/notes/gps/gps_f.html Global Positioning System Overview])&lt;br /&gt;
&lt;br /&gt;
== [[Hardware:AGPS|AGPS]] ==&lt;br /&gt;
is described on a [[Hardware:AGPS|page of its own]].&lt;br /&gt;
&lt;br /&gt;
== PMB 2520 Hammerhead ==&lt;br /&gt;
The PMB 2520 Hammerhead is a one-chip solution for GPS that is produced by Infineon Technologies in cooperation with Global Locate. It allows the usage of assistance data by supporting A-GPS standards. &lt;br /&gt;
&lt;br /&gt;
(all infomation is coming from the datasheet of PMB 2520)&lt;br /&gt;
[http://www.infineon.com/upload/Document/cmc_upload/documents/011/4061/pmb2520-pb-200505.pdf short datasheet]&lt;br /&gt;
=== Modules of the Hammerhead===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead consists of the following modules:&lt;br /&gt;
*RF front-end with on-chip, high gain and low noise, LNA, I/Q mixers, on-chip polyphase complex IF filter, digitally controlled AGC, and 3-bits ADC for the I and Q paths.&lt;br /&gt;
*Sigma-Delta RF PLL with on-chip PCO and on-chip loop filter.&lt;br /&gt;
*Embedded PLL and NCO for baseband clock generation.&lt;br /&gt;
*Multiple channels digital mixers and parallel correlator engines to enable real time correlation of the PRN code for up to 14 satellites.&lt;br /&gt;
*Post processor including peak detection logic&lt;br /&gt;
*SRAM for storing correlation results&lt;br /&gt;
&lt;br /&gt;
=== Host Interface ===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead integrates 3 serial interfaces:&lt;br /&gt;
*UART&lt;br /&gt;
*I2C&lt;br /&gt;
*SPI&lt;br /&gt;
&lt;br /&gt;
The UART in the Hammerhead is a full-duplex UART interface. It is fixed in 8N1(8 data bits, no parity, 1 stop bit) mode. On the GTA01, the host processor connect with the Hammerhead through the UART. In all models of Neo1973, this is connected to a serial port.&lt;br /&gt;
&lt;br /&gt;
=== Host software Architecture ===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead driver software will be delivered as a binary, which can be interfaced to [http://gpsd.davisnetworks.com/bin/view/Main/GpsdHome gpsd] as it outputs NMEA information, as many serial GPSs do.&lt;br /&gt;
&lt;br /&gt;
The gps driver is [[Gllin|now available]]. (There were some problems in the past getting a license to distribute the binary. [http://lists.openmoko.org/pipermail/community/2007-July/008466.html])&lt;br /&gt;
&lt;br /&gt;
The gpsd libraries provide the following infomation to the high level software:&lt;br /&gt;
*Position data&lt;br /&gt;
*Library status&lt;br /&gt;
*Time-out and Packet Available&lt;br /&gt;
&lt;br /&gt;
The high level software sends the following messages to the plugin:&lt;br /&gt;
*Assistance data&lt;br /&gt;
*Positioning Commands&lt;br /&gt;
*Configuration Commands&lt;br /&gt;
&lt;br /&gt;
Gpsd communicates with the system at the following part:&lt;br /&gt;
*Communications Drivers&lt;br /&gt;
*System Timer&lt;br /&gt;
*NV storage&lt;br /&gt;
*Log buffer&lt;br /&gt;
&lt;br /&gt;
== GPS on GTA01 ==&lt;br /&gt;
&lt;br /&gt;
At the GTA01, the host processor is a S3C2410.&lt;br /&gt;
&lt;br /&gt;
=== Hammerhead on the GTA01 ===&lt;br /&gt;
&lt;br /&gt;
On the GTA01, the Hammerhead are configured that connected with the host processor through the UART. The UART of data output/input is connected to the UART 1 of the SC2410. The UART of the hardware flow control is connected to the UART 2 of the SC2410.&lt;br /&gt;
&lt;br /&gt;
== GPS on GTA02 ==&lt;br /&gt;
&lt;br /&gt;
To get gpsd working on the Neo Freerunner you have to edit /etc/default/gpsd, change GPS_DEV=&amp;quot;/dev/ttyS3&amp;quot; to GPS_DEV=&amp;quot;/dev/ttySAC1&amp;quot;. that's it&lt;br /&gt;
&lt;br /&gt;
== Q &amp;amp; A ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Q: Can gpsd support Differential GPS.====&lt;br /&gt;
*While the neo does not have any means of receiving [http://en.wikipedia.org/wiki/Differential_GPS DGPS] or WAAS/SCCM directly, it can be streamed from an internet server. &lt;br /&gt;
*It may be possible to generate a global ionospheric model from stationary (charging?) neos that have GPS signal and cheap internet connections. This would enable very precise positions to be generated&lt;br /&gt;
*This could generate positions accurate to well under a metre, compared to (probably) 2-3m without.&lt;br /&gt;
*The gpsd plugin is the place that these corrections would need to be done, as they need to be performed on a per-satellite basis, before generating the position.&lt;br /&gt;
*This is separate from AGPS - AGPS gives information on current satellite position, or computes your position for you. DGPS is a local minute by minute 'ionospheric weather' for your region.&lt;br /&gt;
&lt;br /&gt;
See also [[Server:A-GPS]].&lt;br /&gt;
&lt;br /&gt;
====Q: Can someone upload somewhere an strace of the interaction between gpsd, and the hammerhead chip?====&lt;br /&gt;
*Ideally this would be requesting a GPS position every second, starting from 'cold', with no AGPS data, for at least half an hour, in an area where the reciever can see the sky.&lt;br /&gt;
*To aid in reverse engineering efforts.&lt;br /&gt;
*A reverse-engineering page has been created: [[Hammerhead/Protocol]]&lt;br /&gt;
&lt;br /&gt;
====Q: Can I get NMEA data from the GPS?====&lt;br /&gt;
&lt;br /&gt;
A: &lt;br /&gt;
* The gpsd program 'gpspipe', with the -r switch will output NMEA data with the current position information. The right way to do it is to use libgpsd in your program if possible.&lt;br /&gt;
* [[Gllin]] writes its NMEA data to the pipe by default, see [[getting GPS console output with gllin]] for more.&lt;br /&gt;
* On FreeRunner, you can also read directly from the GPS chip by reading the file (communication pipe) from /dev/ttySAC1.&lt;br /&gt;
&lt;br /&gt;
{{Languages|Gpsd}}&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-07-13T07:43:16Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel). This NMEA log is available in the project page]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The first version were trying to read from the NMEA pipe in periodic scheduled calls but this results &amp;quot;time travelling effect&amp;quot;. Then 'select' function was involved that improved performance but created big loads on CPU. To reduce the loads, the incremental waiting time was introduced and finally we switched to using GTK built - in channel input library that can schedule call exactly when input from the pipe is available.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most of work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-07-13T07:34:39Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* About mediating libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most of work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-07-13T07:33:32Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* GPS Sight as library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== About mediating libraries ==&lt;br /&gt;
Recently the talks started to appear that the &amp;quot;true&amp;quot; way to access GPS data is through some intermediate library rather than directly from the hardware. GPS Sight currently does not rely on any &amp;quot;standard&amp;quot; library. It has been written in times when the only &amp;quot;supporting software&amp;quot; available was the Linux cat command (cat /tmp/nmeaNP). Differently, we have spent a lot of time tuning our pipe reader that has big requirements for real time high precision positioning that Sight does. If you just read from it periodially, you get the &amp;quot;time travelling effect&amp;quot; when the coordinates shown are the coordinates from the past. If you spend too much in lopp waiting till the pipe is ready, this uses CPU power and drains the battery faster. If you check seldom, this makes the output unusable for some applications like tracking the player moving in the footbal field. The reader is where the most work has been spent and the most interesting contributions were received from various people. Our reader currently uses GTK channel support together with GTK timer functions - so it is packed with calls to default libraries already. And the simple GUI on top allows to test immediately how does performance is affected by changes in the algorithm. We expect to contribute that code to the standard GPS access library after it matures and gets many hours of direct testing by multiple users.&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Wishlist_-_Hardware_-_Novel_Devices</id>
		<title>Wishlist - Hardware - Novel Devices</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Wishlist_-_Hardware_-_Novel_Devices"/>
				<updated>2008-07-12T17:56:48Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Solar Panels */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details hardware some would like in future OpenMoko devices that are very different from the [[Neo1973]]. DVD/media players, cameras, ...&lt;br /&gt;
&lt;br /&gt;
=== Hard Drive ===&lt;br /&gt;
Providing a hard drive, will allow storing music, movies, etc. Add USB storage device capability to use the device as an external hard drive.&lt;br /&gt;
&lt;br /&gt;
=== OpenMoko-branded modem card ===&lt;br /&gt;
&lt;br /&gt;
A 3G modem card for use with other computing hardware, in particular PCs. Probably an internal expansion card such as an ExpressCard or Compact Flash card, with an alternative external (USB) unit for computers without internal slots. (In fact, a PCI-factor internal card for desktop computers might be reasonable too; see below.)&lt;br /&gt;
&lt;br /&gt;
There are already CardBus and external USB 3G modems available. In hardware terms, OpenMoko's modem could well be a simple rebranding of one of these existing products. But, at least in some areas, the 3G modem products available to end-users tend to be tied to a particular telco and bundled with that telco's software. They also have a mysterious tendency not to actually allow voice calls over the modem, even when the modem hardware appears to be quite capable of it. An OpenMoko modem that simply provided open drivers, no lock to a particular telco, good support for various operating systems, and simple support for voice and video calls over the modem, all out of the box, would already have some fairly unique selling points. (Since video conferencing is now taking off on personal computers, hardware that allows your desktop computer to make video calls to 3G mobile phones might well have a market, which is one reason why a PCI-factor card might not be so crazy.)&lt;br /&gt;
&lt;br /&gt;
But more than that, any software or services that OpenMoko develops to overcome the tricky problems of juggling and integrating different Internet and phone connections and different email, IM, VoIP and telephone-number identities on Internet-enabled phones would be available to users of the OpenMoko modem too. That would be a powerful selling point for the modem if and when OpenMoko has compelling solutions to these problems. In fact, the increased integration with PCs would make all OpenMoko devices more attractive. (&amp;quot;Whenever I'm logged in to my laptop all my calls go there, even when I'm not in range of WiFi.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Since [[FIC]] already has well-established relationships in the PC world, it could presumably make good use of those connections in selling the modems.&lt;br /&gt;
&lt;br /&gt;
* Obviously the OpenMoko modem faces much the same problems with getting reasonably open access to 3G hardware that are delaying 3G for the [[Neo1973]] series &lt;br /&gt;
&lt;br /&gt;
* Naturally a 3G Neo1973 or other OpenMoko phone would (or should) be able to provide many of the same advantages when acting as a modem for a PC. But there will still be a place for dedicated modems, if only because yoking a full mobile phone to your computer isn't always the best solution &lt;br /&gt;
&lt;br /&gt;
* Just like full phones, modems would benefit from support for multiple SIMs (see [[Wish_List_-_Hardware#Ability_to_use_multiple_SIMs.2Fnetworks]]) if they're going to be used for (non-VoIP) voice&lt;br /&gt;
&lt;br /&gt;
* Bonus points if the hardware provides a POTS landline connection and the software can juggle it along with 3G and Internet connections...&lt;br /&gt;
&lt;br /&gt;
=== PCMCIA slot ===&lt;br /&gt;
Extensibility would be nice. Standard pcmcia would be great for allowing wireless too. And pcmcia cards tend to be very low power.&lt;br /&gt;
*1. can be used for a spare battery (is this possible?)&lt;br /&gt;
*3. i can use my [http://www.echoaudio.com/Products/CardBus/IndigoIO/index.php Echo Audio Indigo I/O]&lt;br /&gt;
*2. can be used for different cards around&lt;br /&gt;
&lt;br /&gt;
This is certain not to happen in a production phone, it's simply far too large, and requires complex support in hardware, which does not exist in most system on a chip devices as are used in phones. &lt;br /&gt;
Even for the [[Expansion_Back]] it would be too large. --[[User:Speedevil|Speedevil]] 06:05, 28 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
== Cameras &amp;amp; Imaging ==&lt;br /&gt;
==== See [[Wish_List_-_Hardware#Camera]] for additional/updated info on camera suggestions ====&lt;br /&gt;
=== Interchangeable Camera Lenses ===&lt;br /&gt;
&lt;br /&gt;
A camera phone with a [http://en.wikipedia.org/wiki/Lens_mount lens mount] would allow swappable camera lenses and filters.  Camera phones are usually stuck with tiny fixed lenses that don't allow focusing.  Imaging being able to swap out the default lens with one that provides a better focus... or even a zoom!  &lt;br /&gt;
&lt;br /&gt;
The C-Mount or [http://en.wikipedia.org/wiki/T-mount T-Mount] would be a good choice.  Both are standard lens mount with many supporting lenses.  Minolta, Canon, Nikon, Olympus, &amp;amp; most other lens manufacturers also have [http://www.bhphotovideo.com/c/shop/300/Lens_Adapters_Mounts.html mount adapters] for their proprietary lenses. Then share lenses between your camera &amp;amp; cell phone.  The mount hole would need to be about 1 inch in diameter and go about 1/4 inch into the camera-phone (with the focal plane array chip at the bottom of this hole).&lt;br /&gt;
&lt;br /&gt;
CS-Mount would actually be better than a c mount because it requires 12.52mm from surface to imaging chip, instead of the 17.52mm required for c mounts.&lt;br /&gt;
&lt;br /&gt;
 '''Added bonus If you work somewhere that doesn't allow cameras:'''&lt;br /&gt;
 The lens could be removed and a blank insert could be screwed in.&lt;br /&gt;
 The camera capability would be physically disabled!&lt;br /&gt;
&lt;br /&gt;
[[Image:Neo1973-ExpCamCS.png]] &amp;lt;br /&amp;gt;&lt;br /&gt;
concept image from [[Hardware:Neo1973:Alternate_Cases:Camera]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Business Card Reader ===&lt;br /&gt;
This is probably technically difficult if not impossible, maybe you could do it with the embedded camera hardware &amp;amp; software&lt;br /&gt;
&lt;br /&gt;
I want to be able to place a business card face down on the the screen, and have the device automatically read the card and enter the info in the contacts.&lt;br /&gt;
* There is no simple way of reading something placed on the screen, for the basic reason that the screen is in the way.&lt;br /&gt;
* Of course you could always just take a picture of the card with a camera-phone.  Then store it as it is or image recognition software could do character recognition &amp;amp; extract the information.&lt;br /&gt;
&lt;br /&gt;
=== Solar Panels ===&lt;br /&gt;
My old pocket calculator had solar panels, why not my phone?&lt;br /&gt;
See also: [[Expansion_Back#Ideas which require slight modifications of the phone.]]&lt;br /&gt;
&lt;br /&gt;
Here is my Solar Panel Mod for the Neo1973(GTA01) &lt;br /&gt;
[[Image:http://i98.photobucket.com/albums/l274/subfunction/PIC-0007.jpg]]  --KrisAbsinthe&lt;br /&gt;
&lt;br /&gt;
May be not so bad idea when you are somewhere in mountains and cannot easily charge the battery. This may at least prolong the battery life. [[User:AudriusA|AudriusA]] 17:56, 12 July 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Fuel Cell ===&lt;br /&gt;
Some people want to put them in laptops &amp;amp; fuel cells are the way of the future.&lt;br /&gt;
&lt;br /&gt;
===TV Out===&lt;br /&gt;
With help of mouse and keyboard, a TV output may be very useful.&lt;br /&gt;
Or to watch photos taken with a digital camera on holidays.&lt;br /&gt;
Or for showing a slide presentation off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Larger Screen ===&lt;br /&gt;
&lt;br /&gt;
A model with a larger screen would be of use to many, especially with multi-touch. Higher resolution is probably less important than size until the DPI drops below 150 or so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Tiny Video Projector - &amp;quot;Beamer&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
At the [http://www.sid.org/conf/sid2007/sid2007.html DisplayWeek2007] several embeded video projectors for phones were presented. &lt;br /&gt;
 Those projecting devices are not much bigger than a cell phone. A LED-laser projects a sharp image at variable distance&lt;br /&gt;
Could such a device be connected by bluetooth?&lt;br /&gt;
 [http://www.explay.co.il/ Explay] uses two a red and a green laser-LED as well as a conventional blue LED in its &amp;quot;oio&amp;quot;.&lt;br /&gt;
 Blue laser-LED are to expensive for customer products. The light passes a transmissive WVGA-LCD(640x480) and goes on &lt;br /&gt;
 to the screen. Its frequency is 60Hz and the projecting distance can be varied from 20cm(8inch) to 2m(80inch) with &lt;br /&gt;
 a sharp picture. It consumes about 5W and its light power is about 6 lumen. As the sharpness does not depend on&lt;br /&gt;
 distance, one can project the image on screens that are not plane. Like someones t-shirt.&lt;br /&gt;
&lt;br /&gt;
 [http://www.microvision.com/ Microvistions] PicoProjektor however uses soley laser-LEDs. It is also 60Hz though 800x600px or 800x640.&lt;br /&gt;
&lt;br /&gt;
 Potential problems might become the approval of a laser class 3 device.&lt;br /&gt;
&lt;br /&gt;
 Final prices could be about $300.&lt;br /&gt;
Taken from: http://www.heise.de/newsticker/meldung/90141 (german)&lt;br /&gt;
&lt;br /&gt;
===HMD===&lt;br /&gt;
Possibility to use something like [http://www.aeinnovations.com/projects/ver0/ Eyeglass Mounted Display].&lt;br /&gt;
&lt;br /&gt;
Or a HUD for use in a car windscreen. Needs a small projector attached to the phone. The phone is placed in front of the steering wheel on the console and displays information projected against the windscreen.&lt;br /&gt;
&lt;br /&gt;
===Multi I/O adapter===&lt;br /&gt;
*VGA, standard Jack (line in &amp;amp; out), standard USB&lt;br /&gt;
&lt;br /&gt;
===Credit Card Swiper/Reader===&lt;br /&gt;
*A credit card swipe function on the device, so that business operators can use the device to accept payments. In some markets a 'chip+pin' card reader may be an alternative. Existing devices are very expensive. Transaction information is sent over the internet, transaction &amp;quot;hub&amp;quot; services like 1stData could receive the data and reply with email receipts to the merchant, who could then forward the receipt to customer's email, or print a receipt on a bluetooth printer.&lt;br /&gt;
&lt;br /&gt;
===Modular hardware design / interchangeable components===&lt;br /&gt;
It would be great to have several interchangeable components on the 'bus' of the device. Imagine opening the case and being able to add GPS to an empty internal bay or swap an Accelerometer for 3G support.  &lt;br /&gt;
Similar to the PCI hardware model of desktop PCs -- let savvy users swap and upgrade internal components by intentionally designing swappable components on some standardized bus.&lt;br /&gt;
&lt;br /&gt;
 Unfortunately, this is a big problem for compact devices.&lt;br /&gt;
 To take the above examples. An accelerometer module may be 5mm*5mm*2mm. &lt;br /&gt;
 A 3G module 50mm*30mm*10mm, a GSM module 30mm*40mm*5mm and a GPS module 20mm*15mm*5mm. &lt;br /&gt;
 Apart from the wasted space problems, this means also that each module has to be custom-built for FIC. &lt;br /&gt;
 Then there is a second part - you have to have connectors and some way to clamp the module in place.&lt;br /&gt;
 &lt;br /&gt;
 This adds yet more weight and volume.&lt;br /&gt;
 --[[User:Speedevil|Speedevil]] 12:03, 29 June 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
==Unsorted==&lt;br /&gt;
&lt;br /&gt;
===Virtual laser keyboard===&lt;br /&gt;
see...&lt;br /&gt;
http://www.virtual-laser-keyboard.com/?an=google&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Different Shapes &amp;amp; Styles ==&lt;br /&gt;
==== See [[Wish_List_-_Hardware#Casing]] for case suggestions &amp;amp; case mods ==== &lt;br /&gt;
The current shape is great and many people love it (and I myself plan on getting one).  Still, different strokes for different folks &amp;amp; we're allowed to muse about other options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dump the '''''egg-shaped''''' case design and go '''''rectangular''''' for more screen space===&lt;br /&gt;
*I'm all for devices that look great and have great features - aside from that I really like the current design. Thus I'd like to comment that the design change request is probably not the majority's opinion. [[User:Abraxa|Abraxa]] 00:00, 18 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
There will be many OpenMoko devices, of different designs. --[[User:Speedevil|Speedevil]] 06:19, 28 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Clamshell===&lt;br /&gt;
Nuff said&lt;br /&gt;
&lt;br /&gt;
===Twisting top===&lt;br /&gt;
Perfect for a multi-directional camera phone (for easier self photos &amp;amp; video conferencing)&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:Kg920phone.jpg]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alcohol Sensor===&lt;br /&gt;
Alcohol sensor adjacent to microphone.  It doesn't have to be accurate, just has to detect any amount of alcohol on the speaker's breath.  I understand this is a very narrow market, but alcohol is on every parent's mind.&lt;br /&gt;
&lt;br /&gt;
I think those who drive cars might profit from this feature too. --[[User:Cedel|cedel]] 16:02, 20 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
:Although this is a good idea, you have to be very careful about liability here. If it gives a false positive (i.e. you're not over the limit), and you have an accident, the OpenMoko team might be liable.&lt;br /&gt;
&lt;br /&gt;
::I guess the good alcohol sensor is very expensive, cheap very often give false outcome. However, they more often produce negative (no alcohol) while there is. And there's still the thing about guilt OpenMoko team would bear. --[[User:Tolein|tolein]] 18:01, 1 October 2007 (GMT+1)&lt;br /&gt;
&lt;br /&gt;
===Bottle opener===&lt;br /&gt;
* including a bottle opener is very hard, but could be useful.&lt;br /&gt;
* [http://www.bokonzept.de/php/images/462.jpg example]&lt;br /&gt;
* It definitely is useful. A metal reinforced corner might be enough. While it is possible to open bottles with most cell phones, they don't look too good after opening a few cases.&lt;br /&gt;
* Every multi-tool has to have a cork screw&lt;br /&gt;
&lt;br /&gt;
==Stackable Back Expansion plates==&lt;br /&gt;
A reference specification for creating add-on devices. The phone has a back where other backs can be added and removed as the user desires depending on the function needed at the time supplied by each back expansion device. &lt;br /&gt;
A USB 2.0 port which can use all usb devices such as a USB Storage or a Printer Etc.&lt;br /&gt;
:Great idea, however it would require some other port, not USB. It should be thin, so it wouldn't take much space &amp;quot;inside&amp;quot; phone, and also should let you spin the add-on device, so it should be circular. --[[User:Tolein|tolein]] 18:02, 1 October 2007 (GMT+1)&lt;br /&gt;
&lt;br /&gt;
[[Category:User]]&lt;br /&gt;
[[Category:Ideas| ]]&lt;br /&gt;
[[Category:Hardware ideas]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-28T16:53:39Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (includes 3 intermediate stations and tunnel)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-28T16:52:35Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
[[Image:Gpssight train.jpg|thumb|right|Speed changes in the moving train (the straight black line is a tunnel)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File:Gpssight_train.jpg</id>
		<title>File:Gpssight train.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File:Gpssight_train.jpg"/>
				<updated>2008-06-28T16:51:12Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: Colored GPS trace, recorded in a moving trace, for GPS Sight project.

This picture has been released by its author under GNU GFDL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Colored GPS trace, recorded in a moving trace, for GPS Sight project.&lt;br /&gt;
&lt;br /&gt;
This picture has been released by its author under GNU GFDL&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File:Gpv_0_0_screen_shot.jpg</id>
		<title>File:Gpv 0 0 screen shot.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File:Gpv_0_0_screen_shot.jpg"/>
				<updated>2008-06-28T16:49:50Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GPV 0.0.2 runs on the Neo1973&lt;br /&gt;
&lt;br /&gt;
This picture is released by its author, Audrius Meskauskas, under GNU GFDL.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File:Image-Gpv_0_0_screen_shot_2.jpg</id>
		<title>File:Image-Gpv 0 0 screen shot 2.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File:Image-Gpv_0_0_screen_shot_2.jpg"/>
				<updated>2008-06-28T16:49:05Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GPV trace tab&lt;br /&gt;
This picture is released by its author, Audrius Meskauskas, under GNU GFDL.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-28T16:45:25Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Testing the device */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== GPS Sight as library ==&lt;br /&gt;
GPS Sight maintains global variables with coordinates, speed and altitude, and also global array variables with the history on how these components were changing over time. Hence it has a potential to be a part of some other application that wants to be location - aware. Work is, however, needed to make a serious library from it. If anybody is interested in, can contribute.&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-28T16:38:40Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* FreeRunner */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
&lt;br /&gt;
As FreeRunner is not currently available, it is difficult to test this piece of code. However we have tested by putting a file with NMEA content to /dev/ttySAC1, so the detection and switching works.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-28T16:36:38Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Inside the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== FreeRunner ==&lt;br /&gt;
GPS Sight should automatically detect FreeRunner GPS pipe (/dev/ttySAC1) and use it rather than /tmp/nmeaNP. FreeRunner does not need any GPS driver like gllin as its GPS chip generates standard NMEA directly.&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Gpsd</id>
		<title>Gpsd</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Gpsd"/>
				<updated>2008-06-09T20:05:56Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Q: Can I get NMEA data from the GPS? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is GPS ==&lt;br /&gt;
&lt;br /&gt;
The Global Positioning System (GPS) is a a satellite positioning system, using a constellation of 31 satellites.&lt;br /&gt;
&lt;br /&gt;
GPS uses these as &amp;quot;man-made stars&amp;quot; to calculate positions to within a meter. With some forms of GPS. measurements accurate to  better than a centimeter can be made.&lt;br /&gt;
&lt;br /&gt;
With advancing technology, receivers have shrunk from several dozen ICs and hundreds of other components, to one, and a handfull. &lt;br /&gt;
&lt;br /&gt;
This has drastically reduced costs.&lt;br /&gt;
&lt;br /&gt;
The reducing cost has enabled it to be easily integrated in phones, laptops, cameras, as well as more traditional apparatus such as farming equipment, navigation systems and construction equipment.&lt;br /&gt;
&lt;br /&gt;
(Another helpful overview [http://www.colorado.edu/geography/gcraft/notes/gps/gps_f.html Global Positioning System Overview])&lt;br /&gt;
&lt;br /&gt;
== [[Hardware:AGPS|AGPS]] ==&lt;br /&gt;
is described on a [[Hardware:AGPS|page of its own]].&lt;br /&gt;
&lt;br /&gt;
== PMB 2520 Hammerhead ==&lt;br /&gt;
The PMB 2520 Hammerhead is a one-chip solution for GPS that is produced by Infineon Technologies in cooperation with Global Locate. It allows the usage of assistance data by supporting A-GPS standards. &lt;br /&gt;
&lt;br /&gt;
(all infomation is coming from the datasheet of PMB 2520)&lt;br /&gt;
[http://www.infineon.com/upload/Document/cmc_upload/documents/011/4061/pmb2520-pb-200505.pdf short datasheet]&lt;br /&gt;
=== Modules of the Hammerhead===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead consists of the following modules:&lt;br /&gt;
*RF front-end with on-chip, high gain and low noise, LNA, I/Q mixers, on-chip polyphase complex IF filter, digitally controlled AGC, and 3-bits ADC for the I and Q paths.&lt;br /&gt;
*Sigma-Delta RF PLL with on-chip PCO and on-chip loop filter.&lt;br /&gt;
*Embedded PLL and NCO for baseband clock generation.&lt;br /&gt;
*Multiple channels digital mixers and parallel correlator engines to enable real time correlation of the PRN code for up to 14 satellites.&lt;br /&gt;
*Post processor including peak detection logic&lt;br /&gt;
*SRAM for storing correlation results&lt;br /&gt;
&lt;br /&gt;
=== Host Interface ===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead integrates 3 serial interfaces:&lt;br /&gt;
*UART&lt;br /&gt;
*I2C&lt;br /&gt;
*SPI&lt;br /&gt;
&lt;br /&gt;
The UART in the Hammerhead is a full-duplex UART interface. It is fixed in 8N1(8 data bits, no parity, 1 stop bit) mode. On the GTA01, the host processor connect with the Hammerhead through the UART. In all models of Neo1973, this is connected to a serial port.&lt;br /&gt;
&lt;br /&gt;
=== Host software Architecture ===&lt;br /&gt;
&lt;br /&gt;
The Hammerhead driver software will be delivered as a binary, which can be interfaced to [http://gpsd.davisnetworks.com/bin/view/Main/GpsdHome gpsd] as it outputs NMEA information, as many serial GPSs do.&lt;br /&gt;
&lt;br /&gt;
The gps driver is [[Gllin|now available]]. (There were some problems in the past getting a license to distribute the binary. [http://lists.openmoko.org/pipermail/community/2007-July/008466.html])&lt;br /&gt;
&lt;br /&gt;
The gpsd libraries provide the following infomation to the high level software:&lt;br /&gt;
*Position data&lt;br /&gt;
*Library status&lt;br /&gt;
*Time-out and Packet Available&lt;br /&gt;
&lt;br /&gt;
The high level software sends the following messages to the plugin:&lt;br /&gt;
*Assistance data&lt;br /&gt;
*Positioning Commands&lt;br /&gt;
*Configuration Commands&lt;br /&gt;
&lt;br /&gt;
Gpsd communicates with the system at the following part:&lt;br /&gt;
*Communications Drivers&lt;br /&gt;
*System Timer&lt;br /&gt;
*NV storage&lt;br /&gt;
*Log buffer&lt;br /&gt;
&lt;br /&gt;
== GPS on GTA01 ==&lt;br /&gt;
&lt;br /&gt;
At the GTA01, the host processor is a S3C2410.&lt;br /&gt;
&lt;br /&gt;
=== Hammerhead on the GTA01 ===&lt;br /&gt;
&lt;br /&gt;
On the GTA01, the Hammerhead are configured that connected with the host processor through the UART. The UART of data output/input is connected to the UART 1 of the SC2410. The UART of the hardware flow control is connected to the UART 2 of the SC2410.&lt;br /&gt;
&lt;br /&gt;
== Q &amp;amp; A ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Q: Can gpsd support Differential GPS.====&lt;br /&gt;
*While the neo does not have any means of receiving [http://en.wikipedia.org/wiki/Differential_GPS DGPS] or WAAS/SCCM directly, it can be streamed from an internet server. &lt;br /&gt;
*It may be possible to generate a global ionospheric model from stationary (charging?) neos that have GPS signal and cheap internet connections. This would enable very precise positions to be generated&lt;br /&gt;
*This could generate positions accurate to well under a metre, compared to (probably) 2-3m without.&lt;br /&gt;
*The gpsd plugin is the place that these corrections would need to be done, as they need to be performed on a per-satellite basis, before generating the position.&lt;br /&gt;
*This is separate from AGPS - AGPS gives information on current satellite position, or computes your position for you. DGPS is a local minute by minute 'ionospheric weather' for your region.&lt;br /&gt;
&lt;br /&gt;
See also [[Server:A-GPS]].&lt;br /&gt;
&lt;br /&gt;
====Q: Can someone upload somewhere an strace of the interaction between gpsd, and the hammerhead chip?====&lt;br /&gt;
*Ideally this would be requesting a GPS position every second, starting from 'cold', with no AGPS data, for at least half an hour, in an area where the reciever can see the sky.&lt;br /&gt;
*To aid in reverse engineering efforts.&lt;br /&gt;
*A reverse-engineering page has been created: [[Hammerhead/Protocol]]&lt;br /&gt;
&lt;br /&gt;
====Q: Can I get NMEA data from the GPS?====&lt;br /&gt;
&lt;br /&gt;
A: &lt;br /&gt;
* The gpsd program 'gpspipe', with the -r switch will output NMEA data with the current position information. The right way to do it is to use libgpsd in your program if possible.&lt;br /&gt;
* [[Gllin]] writes its NMEA data to the pipe by default, see [[getting GPS console output with gllin]] for more.&lt;br /&gt;
&lt;br /&gt;
{{Languages|Gpsd}}&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-06-09T06:12:48Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. Since the 0.0.4 release the program obtained two extra tabs where either altitude or velocity are shown in color in the covered path. GPS Sight concentrates on visualizing of the relative positioning data at the moment does not compete with the map based applications.&lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever. GTA2 uses a different pipe, but such adaptation would be a minor fix.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_1973_GPS</id>
		<title>Neo 1973 GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_1973_GPS"/>
				<updated>2008-06-09T06:08:39Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Possible GPS programs */  + gps sight one of the most popular projects in projects.openmoko.org&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Neo1973 device contains an integrated GPS. The particular device&lt;br /&gt;
is marketed as an AGPS, and there is some [[Hardware:AGPS |&lt;br /&gt;
discussion]] available as to what significance that &amp;quot;A&amp;quot; might have.&lt;br /&gt;
&lt;br /&gt;
Note that the GTA02 device contains u-blox ANTARIS 4 solution, you could find more hardware related information before GTA02 hardware page.&lt;br /&gt;
&lt;br /&gt;
Assisted GPS performance requirement also defined in GSM/GPRS 3GPP TS 25.171, CDMA 3GPP2 C.S0036-0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GTA01 GPS driver (gllin) ===&lt;br /&gt;
''Main article - [[gllin]]''&lt;br /&gt;
&lt;br /&gt;
The GPS driver is available here: [http://3rdparty.downloads.openmoko.org/gllin/ http://3rdparty.downloads.openmoko.org/gllin/]. It is a command line tool that after starting writes the positioning data so that they can be read as if they were written to the file.&lt;br /&gt;
&lt;br /&gt;
And here the Mail from Michael Shiloh [http://lists.openmoko.org/pipermail/community/2007-November/011916.html http://lists.openmoko.org/pipermail/community/2007-November/011916.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the very early shipment to 50 Phase 1 developers, a binary-only program for talking to the the GPS was accidentally included &lt;br /&gt;
in /home/root/DM2/gps, (and presumably, the same binary would function on a P0 device).&lt;br /&gt;
This binary is called gllin and it is a oabi binary, i.e. it will only work in the 2007.1 OpenMoko environment. There is now a eabi binary, which works with 2007.2. &lt;br /&gt;
&lt;br /&gt;
There was an effort to write a Free Software&lt;br /&gt;
program that could be used instead of this binary-only program, but this stalled after the decision to change GPS chips in GTA02.&lt;br /&gt;
&lt;br /&gt;
See [[Hammerhead/Protocol]] for details and the latest status.&lt;br /&gt;
&lt;br /&gt;
Some scripts for those with the binary are on [[Manually_using_GPS]]&lt;br /&gt;
&lt;br /&gt;
Please see the important information on [[Gllin]]!&lt;br /&gt;
&lt;br /&gt;
=== GTA02 GPS ===&lt;br /&gt;
&lt;br /&gt;
To turn on the GPS, echo 1 to the file ./devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron&lt;br /&gt;
&lt;br /&gt;
To read from the GPS, simply read /dev/ttySAC1.&lt;br /&gt;
&lt;br /&gt;
cat /dev/ttySAC1 will work fine.&lt;br /&gt;
&lt;br /&gt;
Before getting a fix, the GPS spits out lots of &amp;quot;$GPTXT,01,01,01,NMEA unknown msg*58&amp;quot;, though these stop once a fix is obtained. --[[User:Speedevil|Speedevil]] 11:52, 7 April 2008 (CEST)&lt;br /&gt;
&lt;br /&gt;
In Openmoko projects, you could find a GPS test program that could provide graphical and text dump of GPS information. This project called [http://svn.projects.openmoko.org/svnroot/openmoko-agpsui Openmoko AGPS UI project].&lt;br /&gt;
&lt;br /&gt;
=== Possible GPS programs ===&lt;br /&gt;
&lt;br /&gt;
As people develop more sophisticated GPS applications, please note them here.&lt;br /&gt;
&lt;br /&gt;
Here are some ideas for possibilities:&lt;br /&gt;
&lt;br /&gt;
* Cairo-based mapping&lt;br /&gt;
* Routing&lt;br /&gt;
* [[Openstreetmap]] a map viewer, annotation, and editing system.&lt;br /&gt;
* [http://wiki.openstreetmap.org/index.php/Pyroute Pyroute] is a routing program written in Python by Ojw, and a mobile phone GUI for maps, GPS, and routing.&lt;br /&gt;
* [[GPS-Trail]] a simple trail logger.&lt;br /&gt;
* [[GPS_Navigation#roadmap|roadmap]] mapping system using freely available maps (US census TIGER, DGLib, shapefiles).&lt;br /&gt;
* [[Geocaching]] paper chase for advanced users&lt;br /&gt;
* Set Profile (Mute, etc.) to coordinates (ex. At work)&lt;br /&gt;
* [[qpegps]] qtopia (arm PDA) based map viewer with gps features&lt;br /&gt;
* [[Navit]] a car navigation system with routing engine.&lt;br /&gt;
* [http://www.tangogps.org TangoGPS] works very well, downloads maps on demand and stores them for later use, very efficient. &lt;br /&gt;
* [[QMapControl]] Qtopia based mapping widget. Displays maps and custom data, also other widgets can be bound to coordinates. GPS parser for the gllin output included.&lt;br /&gt;
* [http://lists.openmoko.org/pipermail/community/2007-July/007252.html collection of ideas]&lt;br /&gt;
* [http://www.kflog.org/cumulus/ Cumulus] GPS software for glider pilots (and pilots in general), has a port for Qtopia and pulls (world) maps from the KFLog flight planner project. I think someone has put a project like this on the projects website [http://projects.openmoko.org/projects/openvario/ here].&lt;br /&gt;
* [http://svn.projects.openmoko.org/svnroot/openmoko-agpsui Openmoko AGPS UI project].&lt;br /&gt;
* [[GPS Sight]], a popular OpenMoko project under LGPL.&lt;br /&gt;
&lt;br /&gt;
== Using the Neo's GPS on a Laptop ==&lt;br /&gt;
&lt;br /&gt;
*First be sure you have gllin installed on the Neo.&lt;br /&gt;
*On host type: '''nc -vvn -l -p 5000 &amp;gt; /tmp/nmeaNP'''&lt;br /&gt;
*On the Neo type:   '''nc 192.168.0.200 5000 &amp;lt; /tmp/nmeaNP'''&lt;br /&gt;
*&lt;br /&gt;
*On the host PC install GPSD, your GPS is attached as /tmp/nmeaNP &lt;br /&gt;
*start gpsd on host with: '''gpsd -p /tmp/nmeaNP'''&lt;br /&gt;
*run your application! I used gpsdrive and it works better than my stand-alone GPS. &lt;br /&gt;
*Tested with RoadNav.Works great!&lt;br /&gt;
*&lt;br /&gt;
*With this in mind if you have an unlimited data package you could export this over the internet.&lt;br /&gt;
*the possibilities are limitless.  &lt;br /&gt;
&lt;br /&gt;
== Bluetooth GPS relay ==&lt;br /&gt;
&lt;br /&gt;
To make your neo appear like a regular bluetooth GPS:&lt;br /&gt;
&lt;br /&gt;
*Power up the bluetooth radio&lt;br /&gt;
*Run the gllin script&lt;br /&gt;
*run '''sdptool add SP'''&lt;br /&gt;
*run '''rfcomm watch 0 1 sh -c &amp;quot;cat /tmp/nmeaNP &amp;gt;/dev/rfcomm0&amp;quot; &amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;br /&gt;
&lt;br /&gt;
[[category:Documentation]]&lt;br /&gt;
[[category:Standard]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File_transfer</id>
		<title>File transfer</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File_transfer"/>
				<updated>2008-06-08T11:13:13Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenMoko hardware and software offer several ways to transfer files to and from the system.&lt;br /&gt;
&lt;br /&gt;
== SCP ==&lt;br /&gt;
client (find host pc ip-adress: scp &amp;lt;hostLoginName&amp;gt;@&amp;lt;hostIP&amp;gt;:/file .)&lt;br /&gt;
&lt;br /&gt;
server (on host pc: 'scp &amp;lt;file&amp;gt; root@192.168.0.202:/tmp/')&lt;br /&gt;
&lt;br /&gt;
== TFTP ==&lt;br /&gt;
client ('tftp')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== NFS ==&lt;br /&gt;
client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== HTTP ==&lt;br /&gt;
client (on Neo: 'wget',web browser)&lt;br /&gt;
&lt;br /&gt;
== MicroSD ==&lt;br /&gt;
It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the OpenMoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both OpenMoko and host understand (ext2, for instance). &lt;br /&gt;
&lt;br /&gt;
The problem with this approach is that micro SD is difficult to access in the Neo. Both  battery and even SIM card must be removed to reach it.&lt;br /&gt;
&lt;br /&gt;
== SFTP ==&lt;br /&gt;
SFTP can be an excellent way to transfer files as it is supported by many possible clients on the desktop machine. After USB network is set up, it is possible to try to open sftp connection by entering sftp://192.168.0.202 into the address bar of the browser that supports sftp. &lt;br /&gt;
&lt;br /&gt;
The user name on the local host must match the name of the existing user account on the device, and the user password field must not be empty. &lt;br /&gt;
&lt;br /&gt;
== FTP ==&lt;br /&gt;
FTP is currently considered insecure. There is no any reason to use FTP, SFTP should be used instead.&lt;br /&gt;
&lt;br /&gt;
== Common methods not supported ==&lt;br /&gt;
*Bluetooth (except via other network methods)&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Openmoko]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File_transfer</id>
		<title>File transfer</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File_transfer"/>
				<updated>2008-06-08T11:12:52Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenMoko hardware and software offer several ways to transfer files to and from the system.&lt;br /&gt;
&lt;br /&gt;
''WARNING: This information is based on personal account possibly using an old system (uname -a: Linux fic-gta01 2.6.20.7-moko8 #2 PREEMPT Wed May 2 14:45:45 CST 2007 armv4tl unknown)'' --kinscore&lt;br /&gt;
&lt;br /&gt;
== SCP ==&lt;br /&gt;
client (find host pc ip-adress: scp &amp;lt;hostLoginName&amp;gt;@&amp;lt;hostIP&amp;gt;:/file .)&lt;br /&gt;
&lt;br /&gt;
server (on host pc: 'scp &amp;lt;file&amp;gt; root@192.168.0.202:/tmp/')&lt;br /&gt;
&lt;br /&gt;
== TFTP ==&lt;br /&gt;
client ('tftp')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== NFS ==&lt;br /&gt;
client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== HTTP ==&lt;br /&gt;
client (on Neo: 'wget',web browser)&lt;br /&gt;
&lt;br /&gt;
== MicroSD ==&lt;br /&gt;
It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the OpenMoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both OpenMoko and host understand (ext2, for instance). &lt;br /&gt;
&lt;br /&gt;
The problem with this approach is that micro SD is difficult to access in the Neo. Both  battery and even SIM card must be removed to reach it.&lt;br /&gt;
&lt;br /&gt;
== SFTP ==&lt;br /&gt;
SFTP can be an excellent way to transfer files as it is supported by many possible clients on the desktop machine. After USB network is set up, it is possible to try to open sftp connection by entering sftp://192.168.0.202 into the address bar of the browser that supports sftp. &lt;br /&gt;
&lt;br /&gt;
The user name on the local host must match the name of the existing user account on the device, and the user password field must not be empty. &lt;br /&gt;
&lt;br /&gt;
== FTP ==&lt;br /&gt;
FTP is currently considered insecure. There is no any reason to use FTP, SFTP should be used instead.&lt;br /&gt;
&lt;br /&gt;
== Common methods not supported ==&lt;br /&gt;
*Bluetooth (except via other network methods)&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Openmoko]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File_transfer</id>
		<title>File transfer</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File_transfer"/>
				<updated>2008-06-08T11:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* common methods not supported */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenMoko hardware and software offer several ways to transfer files to and from the system.&lt;br /&gt;
&lt;br /&gt;
''WARNING: This information is based on personal account possibly using an old system (uname -a: Linux fic-gta01 2.6.20.7-moko8 #2 PREEMPT Wed May 2 14:45:45 CST 2007 armv4tl unknown)'' --kinscore&lt;br /&gt;
&lt;br /&gt;
== SCP ==&lt;br /&gt;
client (find host pc ip-adress: scp &amp;lt;hostLoginName&amp;gt;@&amp;lt;hostIP&amp;gt;:/file .)&lt;br /&gt;
&lt;br /&gt;
server (on host pc: 'scp &amp;lt;file&amp;gt; root@192.168.0.202:/tmp/')&lt;br /&gt;
&lt;br /&gt;
== TFTP ==&lt;br /&gt;
client ('tftp')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== NFS ==&lt;br /&gt;
client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== HTTP ==&lt;br /&gt;
client (on Neo: 'wget',web browser)&lt;br /&gt;
&lt;br /&gt;
== MicroSD ==&lt;br /&gt;
It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the OpenMoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both OpenMoko and host understand (ext2, for instance). &lt;br /&gt;
&lt;br /&gt;
The problem with this approach is that micro SD is difficult to access in the Neo. Both  battery and even SIM card must be removed to reach it.&lt;br /&gt;
&lt;br /&gt;
== SFTP ==&lt;br /&gt;
SFTP can be an excellent way to transfer files as it is supported by many possible clients on the desktop machine. After USB network is set up, it is possible to try to open sftp connection by entering sftp://192.168.0.202 into the address bar of the browser that supports sftp. &lt;br /&gt;
&lt;br /&gt;
The user name on the local host must match the name of the existing user account on the device, and the user password field must not be empty. &lt;br /&gt;
== common methods not supported ==&lt;br /&gt;
*FTP&lt;br /&gt;
*SFTP&lt;br /&gt;
*Bluetooth (except via other network methods)&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Openmoko]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/File_transfer</id>
		<title>File transfer</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/File_transfer"/>
				<updated>2008-06-08T11:02:35Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* MicroSD */  nonsens, works&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenMoko hardware and software offer several ways to transfer files to and from the system.&lt;br /&gt;
&lt;br /&gt;
''WARNING: This information is based on personal account possibly using an old system (uname -a: Linux fic-gta01 2.6.20.7-moko8 #2 PREEMPT Wed May 2 14:45:45 CST 2007 armv4tl unknown)'' --kinscore&lt;br /&gt;
&lt;br /&gt;
== SCP ==&lt;br /&gt;
client (find host pc ip-adress: scp &amp;lt;hostLoginName&amp;gt;@&amp;lt;hostIP&amp;gt;:/file .)&lt;br /&gt;
&lt;br /&gt;
server (on host pc: 'scp &amp;lt;file&amp;gt; root@192.168.0.202:/tmp/')&lt;br /&gt;
&lt;br /&gt;
== TFTP ==&lt;br /&gt;
client ('tftp')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== NFS ==&lt;br /&gt;
client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')&lt;br /&gt;
&lt;br /&gt;
server?&lt;br /&gt;
&lt;br /&gt;
== HTTP ==&lt;br /&gt;
client (on Neo: 'wget',web browser)&lt;br /&gt;
&lt;br /&gt;
== MicroSD ==&lt;br /&gt;
It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the OpenMoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both OpenMoko and host understand (ext2, for instance). &lt;br /&gt;
&lt;br /&gt;
The problem with this approach is that micro SD is difficult to access in the Neo. Both  battery and even SIM card must be removed to reach it.&lt;br /&gt;
&lt;br /&gt;
== common methods not supported ==&lt;br /&gt;
*FTP&lt;br /&gt;
*SFTP&lt;br /&gt;
*Bluetooth (except via other network methods)&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Applications]]&lt;br /&gt;
[[Category:Openmoko]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-04-25T06:03:41Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Testing the device */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. &lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. The distance meter also seems operating correctly.&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/GPS_Sight</id>
		<title>GPS Sight</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/GPS_Sight"/>
				<updated>2008-04-25T06:03:08Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Project organization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Gpv 0 0 screen shot.jpg|thumb|right|The summary tab]]&lt;br /&gt;
[[Image:Image-Gpv 0 0 screen shot 2.jpg|thumb|right|The map tab (walking forward and back through the same street)]]&lt;br /&gt;
The GPS Sight is a GTK based project to create a usable GUI tool with the simple output (no maps). It detects GPRMC and GPGGA messages and constantly shows the following data on the screen:&lt;br /&gt;
&lt;br /&gt;
* Location.&lt;br /&gt;
* Speed in kilometers per hour (converts from knots).&lt;br /&gt;
* Altitude&lt;br /&gt;
* Curved distance from the initially marked point (uses advanced IERC 2003 geodetic reference to convert degrees into kilometers).&lt;br /&gt;
* Number of the satellites.&lt;br /&gt;
* Time (UTM, not a local time).&lt;br /&gt;
&lt;br /&gt;
Since the 0.0.2 release the application also has the &amp;quot;map&amp;quot; tab which shows the covered path. The map adjusts its scale automatically. The horizontal and vertical scales of the map are equal. &lt;br /&gt;
&lt;br /&gt;
The source code of this project is available in the project page (http://projects.openmoko.org/projects/gpv/), under LGPL. The project uses GTK framework and C programming language.&lt;br /&gt;
&lt;br /&gt;
The GPS Preview program (gpv) is released either in .ipk file or in the form of the source code. The released installer still needs the [[gllin]] to run, but, if needed, can start it itself. Gllin could be replaced by any other driver that works with agreed pipe (currently /tmp/nmeaNP) and our dream is to drop the dependencies from that proprietary piece of software forever.&lt;br /&gt;
&lt;br /&gt;
== Inside the project ==&lt;br /&gt;
The most interesting part of this project was to keep the external driver thread and GUI thread sufficiently happy together. We cannot just read from the pipe in a loop as this blocks the GUI repainting! Instead, the code schedules the GTK timer, and then it needs to check if any input from the pipe is available - again, without blocking the current thread for too long. This is done using select function which can check the given stream for the availability of input, passing the certain time-out duration. This time-out seems also tricky: if the value or 0.1 s or less is passed on the Neo, function never reports any input present. However too large values block GUI in the input check step. The code now has a kind of adaptation, gradually increasing the duration of this check if there is no input available for a while.&lt;br /&gt;
&lt;br /&gt;
The distance counter tries to track the curved distance, not the &amp;quot;bird flight&amp;quot; distance between two points. It adds the shifts in space, computing the length of the lat/long degrees into meters in accordance to the IERS 2003 goedetic reference - very new and not yet widely used in geography.&lt;br /&gt;
&lt;br /&gt;
It was some work to fullfil the natural requirement to have the equal scaling for the map. The length of the degree of the longitude (in meters) varies dramatically depending on the geographical location. This must be taken into consideration, computing the degree length first. The automatic scaling allows to use the map tab when working with relatively small distances (hundreds of meters of even less).&lt;br /&gt;
&lt;br /&gt;
== Testing the device ==&lt;br /&gt;
The device has been tested outdoors where it shows the correct location and altitude. The speed indicator has been tested on the train, correctly showing the speed of about 100 km/h. &lt;br /&gt;
&lt;br /&gt;
Nobody yet tested, how accurate the distance counter is (please update this information if you ever tried).&lt;br /&gt;
&lt;br /&gt;
== Project organization ==&lt;br /&gt;
The project uses CVS to host the most recent source code and all build environment and sometimes does releases of .ipk binaries and plain gzipped source code. Project also uses [http://projects.openmoko.org/plugins/wiki/index.php?id=108&amp;amp;type=g Wiki page] to describe various technical aspects.&lt;br /&gt;
&lt;br /&gt;
[[Category:GPS]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User_talk:AudriusA</id>
		<title>User talk:AudriusA</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User_talk:AudriusA"/>
				<updated>2008-04-24T19:46:03Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello Audrius&lt;br /&gt;
&lt;br /&gt;
We are trying to get 10 people together for buying the &amp;quot;10 pack&amp;quot; of the new release, the freerunner. Therefore we wanted to ask if you intend to buy another openmoko.&lt;br /&gt;
&lt;br /&gt;
We entered our Info at the Group Sales page: http://wiki.openmoko.org/wiki/GroupSales (Switzerland, Zurich).&lt;br /&gt;
&lt;br /&gt;
Thanks and cu&lt;br /&gt;
Markus&lt;br /&gt;
::Sory, no. I already have one, it is good enough for learning purposes. [[User:AudriusA|AudriusA]] 21:46, 24 April 2008 (CEST)&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Manually_using_Bluetooth</id>
		<title>Manually using Bluetooth</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Manually_using_Bluetooth"/>
				<updated>2008-04-14T19:12:23Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Bluetooth networking with a Linux system */  Removed shell part of the commands (must be discarded before copy pasting anyway) and added the note about bringing bnep up on the phone as well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{InProgress}}&lt;br /&gt;
Bluetooth is one of the core functions of the Neo1973, however it is basically unimplemented on the software side at the moment.&lt;br /&gt;
Hardware problems in the P1 phone mean that the CPU has to be active in order to wake on external bluetooth events, which will reduce the battery life to some 2 days at best in standby.&lt;br /&gt;
&lt;br /&gt;
This page details how to use bluetooth from the command line.&lt;br /&gt;
We have quite a lot of plans about what exactly Bluetooth should be used for.&lt;br /&gt;
&lt;br /&gt;
== Power it up ==&lt;br /&gt;
&lt;br /&gt;
Power up the adapter by clicking on the bluetooth icon in the top bar and selecting power on.&lt;br /&gt;
&lt;br /&gt;
The old way to do it is a shell command (for kernels before 2.6.24):&lt;br /&gt;
&lt;br /&gt;
 root@fic-gta01:~$ echo &amp;quot;1&amp;quot; &amp;gt; /sys/bus/platform/devices/gta01-pm-bt.0/power_on&lt;br /&gt;
&lt;br /&gt;
For kernel 2.6.24 (or later) use&lt;br /&gt;
&lt;br /&gt;
 root@fic-gta01:~$ echo &amp;quot;1&amp;quot; &amp;gt; /sys/bus/platform/devices/neo1973-pm-bt.0/power_on&lt;br /&gt;
&lt;br /&gt;
At the shell, &amp;quot;hciconfig&amp;quot; should print information about the adapter if it powered up properly:&lt;br /&gt;
&lt;br /&gt;
 hciconfig&lt;br /&gt;
&lt;br /&gt;
The devices should show as UP. If not you can use &lt;br /&gt;
&lt;br /&gt;
 hciconfig &amp;lt;device&amp;gt; up&lt;br /&gt;
&lt;br /&gt;
== Bluetooth Functions ==&lt;br /&gt;
&lt;br /&gt;
===Configuring Bluetooth on OpenMoko 2007.2 (August 27 snapshot with kernel 2.6.21.6-moko11) ===&lt;br /&gt;
&lt;br /&gt;
In file /etc/bluetooth/hcid.conf you should change the passkey from BlueZ to something numeric. For testing you may use &amp;quot;0000&amp;quot;. Also, you can set the name to &amp;quot;Neo (%d)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Scanning for bluetooth devices ===&lt;br /&gt;
&lt;br /&gt;
 hcitool scan&lt;br /&gt;
&lt;br /&gt;
This will list the addresses of any discoverable bluetooth devices in the vicinity&lt;br /&gt;
&lt;br /&gt;
=== passkey agent example ===&lt;br /&gt;
&lt;br /&gt;
There should be a passkey agent built into openmoko, but for now you can start up the example passkey agent and set the pin code there. This will allow for new pairings to be made when you attempt a connection.&lt;br /&gt;
&lt;br /&gt;
 passkey-agent --default 0000 &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note: the passkey-agent is not required in OpenMoko 2007.2 with kernel 2.6.21.6 as of at least since August 27 (maybe earlier).&lt;br /&gt;
&lt;br /&gt;
=== HID (Human Input Device) ===&lt;br /&gt;
&lt;br /&gt;
==== Being able to use HID devices ====&lt;br /&gt;
&lt;br /&gt;
Using a bluetooth keyboard with the built-in terminal is a little funky... I can only type into the console using the bt keyboard if the onscreen keyboard is visible. Also, pressing &amp;quot;p&amp;quot; twice on the bt keyboard actually gives you a &amp;quot;q&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We want to be able to use a bluetooth keyboard to type into the various applications of our Neo1973.&lt;br /&gt;
To use a Bluetooth Keyboard type: (11:22:33:44:55:66 is the Address of your BT-Keyboard)&lt;br /&gt;
&lt;br /&gt;
 hidd --connect 11:22:33:44:55:66&lt;br /&gt;
&lt;br /&gt;
and press &amp;quot;Connect&amp;quot; on your BT-KB.  Alternately, if you know that only one BT-Keyboard is within range, you can just:&lt;br /&gt;
&lt;br /&gt;
 hidd --search&lt;br /&gt;
&lt;br /&gt;
to find and connect to any BT-Keyboard.&lt;br /&gt;
&lt;br /&gt;
Tested on:&lt;br /&gt;
* [http://www.logitech.com/index.cfm/products/details/US/EN,CRID=2166,CONTENTID=10717 Logitech Dinovo Edge]&lt;br /&gt;
* [http://www.logitech.com/index.cfm/keyboards/keyboard_mice_combos/devices/164&amp;amp;cl=us,en Logitech Dinovo Media Desktop (keyboard)]&lt;br /&gt;
* [http://www.nokia.es/A4181580 Nokia SU-8W].  Switched on the BT keyboard, scanned for BT address and ran the connect statement above.  Works fine.&lt;br /&gt;
* [http://blog.russnelson.com/chordite Chordite].  This keyboard uses the Broadcom BCM2042 BT keyboard controller along with a custom driver.&lt;br /&gt;
* [http://www.apple.com/keyboard/ Apple's Aluminum Keyboard]. You may have to add 'auth enable; encrypt enable;' to device {} in  hcid.conf. Run the passkey agent the first time. --search works to pair and every time after.&lt;br /&gt;
* [http://www.apple.com/support/keyboard/ Apple's white &amp;quot;Wireless Keyboard (original)&amp;quot;] - details may be the same as above. (tested some time ago)&lt;br /&gt;
* [http://freedominput.com The freedom keyboard] and its many rebranded models (they look like this: [http://rabenfrost.net/openmoko/keyboard.jpg]) need 'modprobe uinput' to circumvent the 'Can't open input device: No such file or directory (2)' error of 'hidd --search'. It works as of february 7th 2008.&lt;br /&gt;
* [http://www.nextag.com/Playstation-3-Logitech-Cordless-564345667/prices-html?nxtg=f8320a24052a-7789F8FE732FF6E3 Logitech Playstation 3 Keyboard] Works well, Mouse pad works.&lt;br /&gt;
&lt;br /&gt;
==== Acting as HID device ====&lt;br /&gt;
&lt;br /&gt;
We want to be able to use the Neo1973 as a HID device, being able to use it as controller for presentations.&lt;br /&gt;
&lt;br /&gt;
=== RFCOMM ===&lt;br /&gt;
&lt;br /&gt;
Here's how to connect to an external Bluetooth GPS and read NMEA data (Tested with a Holux GPSSlim236 and a Nokia LD-3W ).&lt;br /&gt;
&lt;br /&gt;
First, switch on the GPS and identify the BT address:&lt;br /&gt;
&lt;br /&gt;
  hcitool scan&lt;br /&gt;
&lt;br /&gt;
Then, edit /etc/bluetooth/rfcomm.conf, which by default has all settings commented out, to something like this:&lt;br /&gt;
&lt;br /&gt;
  rfcomm0 {&lt;br /&gt;
        # Automatically bind the device at startup&lt;br /&gt;
        bind no;&lt;br /&gt;
        # Bluetooth address of the device&lt;br /&gt;
        device 00:11:22:33:44:55;&lt;br /&gt;
        # RFCOMM channel for the connection (check your GPS docs for details)&lt;br /&gt;
        channel 1;&lt;br /&gt;
        # Description of the connection&lt;br /&gt;
        comment &amp;quot;Bluetooth GPS&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Restart the BT services:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ /etc/init.d/bluetooth stop&lt;br /&gt;
  root@neo:~$ /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
You should now be able to bind the GPS to /dev/rfcomm0, like this:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ rfcomm bind 0&lt;br /&gt;
&lt;br /&gt;
Confirm the connect:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ rfcomm&lt;br /&gt;
  rfcomm0: 00:11:22:33:44:55 channel 1 clean &lt;br /&gt;
&lt;br /&gt;
... and watch the NMEA strings coming from your GPS:&lt;br /&gt;
&lt;br /&gt;
  root@neo:~$ cat /dev/rfcomm0 &lt;br /&gt;
  $GPGGA,111748.000,5907.6964,N,01121.1787,E,1,06,1.2,57.7,M,40.1,M,,0000*6F&lt;br /&gt;
  $GPRMC,111748.000,A,5907.6964,N,01121.1787,E,0.00,94.94,160807,,,A*50&lt;br /&gt;
  $GPVTG,94.94,T,,M,0.00,N,0.0,K,A*3D&lt;br /&gt;
&lt;br /&gt;
If you have nothing better to do, you can now pinpoint my office :-).&lt;br /&gt;
&lt;br /&gt;
=== OBEX ===&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth networking with a Linux system ===&lt;br /&gt;
&lt;br /&gt;
Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone.  BNEP has to be used.&lt;br /&gt;
&lt;br /&gt;
'''On the laptop'''&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth&lt;br /&gt;
 /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
* Start pand as server&lt;br /&gt;
 pand -s&lt;br /&gt;
&lt;br /&gt;
* As soon as pand is started on the phone configure your IP address&lt;br /&gt;
 ip a add 10.0.0.1/24 dev bnep0&lt;br /&gt;
 ip l set bnep0 up&lt;br /&gt;
&lt;br /&gt;
* Configure IP forwarding and masquerading to your liking (see [[USB_Networking]]). You can even set up Udev rules to do this for you once the bnep0 interface appears.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''On the Neo'''&lt;br /&gt;
&lt;br /&gt;
* There is a little script that does the steps below (and retries the pand -c command; I had issues with it not working the first time every time) at [[Bt-net-script]]  You shouldn't need the other steps below if you use the script.&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         00:0E:6D:C0:0l:6A       Sho&lt;br /&gt;
         00:20:E0:5A:FE:C8       BlueZ (0)&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 root@fic-gta01:~$ pand -c 00:20:E0:5A:FE:C8&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address&lt;br /&gt;
 ip a add 10.0.0.2/24 dev bnep0&lt;br /&gt;
 ip r add default via 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
* Sometimes you may need to bring up the bnep0 on the phone as well:&lt;br /&gt;
 ip l set bnep0 up&lt;br /&gt;
* Enjoy&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth networking with a MacOS X system ===&lt;br /&gt;
&lt;br /&gt;
Please refer to [[MacOS_X#Bluetooth_2]]&lt;br /&gt;
&lt;br /&gt;
For using the Neo as a dialup Bluetooth server and the Mac as the client, please see below at [[Manually_using_Bluetooth#PPP_Networking]]&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth networking with a Windows XP system ===&lt;br /&gt;
&lt;br /&gt;
This was tested with a Windows XP SP2 on a IBM Thinkpad T41 with the Widcomm BT stack&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth on Windows XP&lt;br /&gt;
&lt;br /&gt;
* Enable &amp;quot;Network Access&amp;quot; in the Bluetooth configuration&lt;br /&gt;
&lt;br /&gt;
* Scan for the Neo and pair with the Neo (right click, select pair)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the Neo&lt;br /&gt;
&lt;br /&gt;
* Enable PAN support on the Neo by changing Autostart from false to true in /etc/bluetooth/network.service&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         &amp;lt;laptop_bt_address&amp;gt;     Thinkpad&lt;br /&gt;
         ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 pand -c &amp;lt;laptop_bt_address&amp;gt; -r PANU -d NAP -e bnep0 -A -E -S&lt;br /&gt;
(add '-n' to see the pand status messages until you get it right)&lt;br /&gt;
&lt;br /&gt;
For some reason, I was not able to initiate PAN connections from the Neo, I got 'Permission denied (13)' even when I had explicitly allowed the Neo to connect (right click on Neo icon, set properties, on Authorization tab). But initiating 'PAN User' from Windows worked when executing on Neo:&lt;br /&gt;
 pand -l -r PANU -d NAP -e bnep0 -A -E -S&lt;br /&gt;
(add '-n' to see the pand status messages until you get it right)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address. It should work like when connecting to Linux:&lt;br /&gt;
 ip a add 10.0.0.2/24 dev bnep0&lt;br /&gt;
 ip r add default via 10.0.0.1&lt;br /&gt;
If this does not work, the IP stacks may have auto-assigned network addresses to themselves. You can look this up with 'ifconfig' on the Neo and with 'ipconfig' on Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You should now be able to ssh/putty from Windows to your Neo. Enjoy!&lt;br /&gt;
By setting up the Windows Bluetooth connection properly, it should also be possible to share the Internet Connection of the Windows box with the Neo.&lt;br /&gt;
&lt;br /&gt;
=== PPP Networking ===&lt;br /&gt;
&lt;br /&gt;
If you are unable to use the 'BNEP' method described above, you may be able to use [[PPP]] and a DUN (dialup-networking) emulation mode. On the Neo:&lt;br /&gt;
&lt;br /&gt;
* Edit the /etc/default/bluetooth file and set the following options:&lt;br /&gt;
 RFCOMM_ENABLE=true&lt;br /&gt;
 DUND_ENABLE=true&lt;br /&gt;
 DUND_OPTIONS=&amp;quot;--listen --persist call dun&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Create an /etc/ppp/peers/dun file with options like the following:&lt;br /&gt;
 115200&lt;br /&gt;
 192.168.2.202:192.168.2.200&lt;br /&gt;
 passive&lt;br /&gt;
 local&lt;br /&gt;
 noipdefault&lt;br /&gt;
 noauth&lt;br /&gt;
 nodefaultroute&lt;br /&gt;
 &lt;br /&gt;
* Restart bluetooth (/etc/init.d/bluetooth stop ; /etc/init.d/bluetooth start)&lt;br /&gt;
&lt;br /&gt;
To connect from a MacOS 10.3 client:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;quot;Applications/Utilities/Bluetooth Serial Utility&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;New&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Choose a name, then click &amp;quot;Choose Device&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Locate your Neo, then select the &amp;quot;LAN Access Point&amp;quot; service. If your device is not found, or if this service does not show up, then you will need to troubleshoot and fix that before continuing. Bluetooth is designed for short-range communication, so make sure that the devices are physically close to each other. &lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Port type: RS-232&amp;quot; and &amp;quot;Show in Network Preferences&amp;quot;. Click OK.&lt;br /&gt;
&lt;br /&gt;
* Open the Network Preferences page then &amp;quot;Show: Network Port Configurations&amp;quot;. Enable the new device that you defined in the previous step and drag it to the bottom of the device list (so that it will not interfere with your other network connections)&lt;br /&gt;
&lt;br /&gt;
* Choose &amp;quot;Show: &amp;lt;your-device-name&amp;gt;&amp;quot;, then click &amp;quot;Modem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Select &amp;quot;Null Modem 115200&amp;quot; from the list of available devices. Uncheck &amp;quot;Wait for dial tone&amp;quot; and &amp;quot;Enable error correction and compression in modem&amp;quot;. Optionally check &amp;quot;Show modem status in menu bar&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
* Click &amp;quot;Connect&amp;quot;. If everything worked, you will end up with a 'ppp0' device on your Mac with a local address of 192.168.2.200 and you will be able to access your Neo at 192.168.2.202.&lt;br /&gt;
&lt;br /&gt;
=== A2DP quickie ===&lt;br /&gt;
&lt;br /&gt;
It's now possible (if a little hackish) to stream mp3 to a bluetooth headset. It's a known problem that the playback rate changes (pitch varies). Timing issues are also likely the reason for gaps in playback.&lt;br /&gt;
&lt;br /&gt;
If the bluez packages are recent enough, you can use a shortcut. I'll document it here and leave the longer version below (the long version also demonstrates the API used by the GUI to manage headsets)&lt;br /&gt;
&lt;br /&gt;
Create /etc/asound.conf with your bluetooth headset's address filled in:&lt;br /&gt;
&lt;br /&gt;
 pcm.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
  device &amp;quot;xx:xx:xx:xx:xx:xx&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
then play a song&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:- | aplay&lt;br /&gt;
&lt;br /&gt;
or for smoother results...&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:song.wav&lt;br /&gt;
 aplay song.wav&lt;br /&gt;
&lt;br /&gt;
=== A2DP ===&lt;br /&gt;
&lt;br /&gt;
If that doesn't work... all the more hackish... install required packages:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;src/gz python http://www.angstrom-distribution.org/unstable/feed/armv4t/python/&amp;quot; &amp;gt;&amp;gt; /etc/ipkg/angstrom-python.conf &lt;br /&gt;
 echo &amp;quot;src/gz base http://www.angstrom-distribution.org/unstable/feed/armv4t/base/&amp;quot; &amp;gt;&amp;gt; /etc/ipkg/angstrom-base.conf&lt;br /&gt;
 ipkg update ; ipkg install python-core python-xml python-dbus bluez-utils bluez-utils-alsa&lt;br /&gt;
&lt;br /&gt;
Create /etc/asound.conf:&lt;br /&gt;
&lt;br /&gt;
 pcm.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 ctl.!default {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 pcm.bluetooth {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
 ctl.bluetooth {&lt;br /&gt;
  type bluetooth&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Run the passkey agent (see above in this page)&lt;br /&gt;
&lt;br /&gt;
Fill in your bluetooth headset address below and execute the python script (with your headset turned on)&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/python&lt;br /&gt;
 import dbus&lt;br /&gt;
 bus = dbus.SystemBus()&lt;br /&gt;
 manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')&lt;br /&gt;
 conn = manager.ActivateService('audio')&lt;br /&gt;
 audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'), 'org.bluez.audio.Manager')&lt;br /&gt;
 path = audio.CreateDevice('00:0D:3C:44:33:22')&lt;br /&gt;
 audio.ChangeDefaultDevice(path)&lt;br /&gt;
 sink = dbus.Interface(bus.get_object(conn, path), 'org.bluez.audio.Sink')&lt;br /&gt;
 sink.Connect()&lt;br /&gt;
&lt;br /&gt;
FINALLY: play a song&lt;br /&gt;
&lt;br /&gt;
 madplay /media/card/song.mp3 --sample-rate=44100 --output=wave:- | aplay&lt;br /&gt;
&lt;br /&gt;
=== Headset Audio ===&lt;br /&gt;
&lt;br /&gt;
[[Neo1973_Audio_Subsystem]] has detail about alsa settings and a proposal for audio scenario management.&lt;br /&gt;
&lt;br /&gt;
To try this out, follow the instructions in the a2dp section to install software and run the passkey agent.&lt;br /&gt;
&lt;br /&gt;
Remove or disable the stuff you put in asound.conf. When using a voice headset, the application uses the regular system audio device and it gets routed to bluetooth in the codec.&lt;br /&gt;
&lt;br /&gt;
Put the headset in pairing mode. Replace the bluetooth address below with your headset's and run the python script:&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/python&lt;br /&gt;
 import dbus&lt;br /&gt;
 bus = dbus.SystemBus()&lt;br /&gt;
 manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')&lt;br /&gt;
 conn = manager.ActivateService('audio')&lt;br /&gt;
 audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'), 'org.bluez.audio.Manager')&lt;br /&gt;
 path = audio.CreateHeadset('00:0B:2E:39:33:22')&lt;br /&gt;
 audio.ChangeDefaultHeadset(path)&lt;br /&gt;
 headset = dbus.Interface (bus.get_object(conn, path), 'org.bluez.audio.Headset')&lt;br /&gt;
 headset.Connect()&lt;br /&gt;
 headset.Play()&lt;br /&gt;
&lt;br /&gt;
Now place a call and try to route it to bluetooth (after it's in progress):&lt;br /&gt;
&lt;br /&gt;
 alsactl -f /etc/gsmbluetooth.state restore&lt;br /&gt;
&lt;br /&gt;
You may also be able to listen to system audio given the right state file:&lt;br /&gt;
&lt;br /&gt;
 alsactl -f /etc/systembluetooth.state restore&lt;br /&gt;
 madplay song.mp3&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth networking with a Linux system - More secure way ===&lt;br /&gt;
&lt;br /&gt;
''Check this, probably needs some corrections''&lt;br /&gt;
&lt;br /&gt;
Bluetooth should behave just like our usbnet and provide full TCP/IP access to the phone.  BNEP has to be used.&lt;br /&gt;
&lt;br /&gt;
On the laptop&lt;br /&gt;
&lt;br /&gt;
* check these options in /etc/bluetooth/hcid.conf&lt;br /&gt;
 security auto;&lt;br /&gt;
 passkey &amp;quot;your pin&amp;quot;;&lt;br /&gt;
 lm master;&lt;br /&gt;
&lt;br /&gt;
* Start bluetooth&lt;br /&gt;
 # /etc/init.d/bluetooth start&lt;br /&gt;
&lt;br /&gt;
* Start pand as server&lt;br /&gt;
  pand --listen --role NAP --encrypt&lt;br /&gt;
&lt;br /&gt;
* Add in /etc/network/interfaces (see [[USB_Networking]])&lt;br /&gt;
 auto bnep0&lt;br /&gt;
 iface bnep0 inet static&lt;br /&gt;
 address 192.168.1.1&lt;br /&gt;
 netmask 255.255.255.0&lt;br /&gt;
 network 192.168.1.0&lt;br /&gt;
        post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24&lt;br /&gt;
        post-up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        post-up iptables -P FORWARD ACCEPT&lt;br /&gt;
&lt;br /&gt;
On the Neo&lt;br /&gt;
&lt;br /&gt;
* Power on bluetooth (see above)&lt;br /&gt;
&lt;br /&gt;
* Scan for the laptop&lt;br /&gt;
 root@fic-gta01:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
         00:20:E0:5A:FE:C8       laptop&lt;br /&gt;
&lt;br /&gt;
* Set pin&lt;br /&gt;
 root@fic-gta01:~$ passkey-agent 'your pin' 00:20:E0:5A:FE:C8 &amp;amp;&lt;br /&gt;
&lt;br /&gt;
* Connect to the laptop pand&lt;br /&gt;
 root@fic-gta01:~$ pand -c 00:20:E0:5A:FE:C8&lt;br /&gt;
&lt;br /&gt;
* Configure your IP address&lt;br /&gt;
 root@fic-gta01:~$ ifconfig bnep0 192.168.1.2&lt;br /&gt;
 root@fic-gta01:~$ route add default gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
* Enjoy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
http://www.holtmann.org/papers/bluetooth/ols2006_slides.pdf&lt;br /&gt;
http://wiki.bluez.org/wiki/Audio#org.bluez.Audio&lt;br /&gt;
&lt;br /&gt;
{{Languages|Manually_using_Bluetooth}}&lt;br /&gt;
[[Category:Technical  ]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Bluetooth| ]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Gllin</id>
		<title>Gllin</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Gllin"/>
				<updated>2008-04-01T06:46:41Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;gllin is an userpsace driver for a hammerhead [[GPS]] chip. It was distributed on phase1 openmokos.&lt;br /&gt;
&lt;br /&gt;
Thanks to a tremendous amount of hard work by many people, we have ready&lt;br /&gt;
a release of gllin, the GPS drives. Here is how you can get it:&lt;br /&gt;
&lt;br /&gt;
http://3rdparty.downloads.openmoko.org/gllin/&lt;br /&gt;
&lt;br /&gt;
Instructions, how to use the driver, are given at:&lt;br /&gt;
&lt;br /&gt;
http://lists.openmoko.org/pipermail/community/2007-November/011916.html. &lt;br /&gt;
&lt;br /&gt;
The similar instructions are described in more details at [[getting GPS console output with gllin]]. The downloaded .ipk package can be installed and works not just on OpenMoko but also on Qtopia.&lt;br /&gt;
&lt;br /&gt;
== /sys/ path issues with some kernel versions ==&lt;br /&gt;
&lt;br /&gt;
gllin expects to find the gps devices /sys/ interface in the path: &lt;br /&gt;
'''/sys/bus/platform/devices/gta01-pm-gps.0/'''&lt;br /&gt;
&lt;br /&gt;
If your kernel does not create the path mentioned above but only i.e. &lt;br /&gt;
'''/sys/bus/platform/devices/neo1973-pm-gps.0/'''&lt;br /&gt;
you can try the following solution:&lt;br /&gt;
&lt;br /&gt;
As it is not possible to create symlinks in /sys/ or /proc/ and similar kernel virtual&lt;br /&gt;
filesystems a different approach needs to be taken: bind-mounts.&lt;br /&gt;
&lt;br /&gt;
The old path .../gta01-pm-gps.0/ can be made avainable again to gllin by creating a bind mount with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;/sys/bus/platform/devices/neo1973-pm-gps.0 /sys/bus/platform/devices/gta01-pm-gps.0 none bind 0 0&amp;quot; &amp;gt;&amp;gt;/etc/fstab&lt;br /&gt;
mount /sys/bus/platform/devices/neo1973-pm-gps.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other approaches using '''sed''' on gllin or some symlink approach were proposed but &lt;br /&gt;
creating a simple bind mount seems to be the cleanest solution.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spin|Spin]] 22:44, 26 March 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== gllin options ==&lt;br /&gt;
&lt;br /&gt;
The /home/root/gllin/gllin file installed by the new (legitimate!) .ipk package is really just a shell script.  You can modify the options passed to gllin.real by editing that script.  Here are the options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
-help                    Help&lt;br /&gt;
-board &amp;lt;type&amp;gt;            Defines board type    Ex: '-board matchbox'&lt;br /&gt;
                         supported: matchbox, trident&lt;br /&gt;
-com &amp;lt;com port&amp;gt;          GPS com port;         Ex: '-com com6'&lt;br /&gt;
-baud &amp;lt;baud rate&amp;gt;        Set baud rate;        Ex: '-baud 115200'&lt;br /&gt;
-rft &amp;lt;RF type&amp;gt;           Set RF type;          Ex: '-rft RF_LN22OUT'&lt;br /&gt;
-freq &amp;lt;freq plan&amp;gt; | ?    set frequency plan for GPS or show the list of all available plans&lt;br /&gt;
                         Ex: '-freq FRQ_PLAN_OCXO_10000'&lt;br /&gt;
                         Ex: '-freq ?' -- Show all available plans&lt;br /&gt;
-g &amp;lt;URL&amp;gt;                 SUPL Server URL or IP address;&lt;br /&gt;
                         Ex: '-g 216.15.9.46'&lt;br /&gt;
-p &amp;lt;port&amp;gt;                SUPL Server port number;&lt;br /&gt;
                         Ex: '-p 9118'&lt;br /&gt;
-udp &amp;lt;port&amp;gt;              Local UDP port to send NMEA to.&lt;br /&gt;
                         '-udp 6000'      [default]&lt;br /&gt;
-gsm_cell &amp;lt;cell ID&amp;gt;      set GSM Cell ID information&lt;br /&gt;
                         cell ID has the following format: '&amp;lt;MCC&amp;gt;.&amp;lt;MNC&amp;gt;.&amp;lt;LAC&amp;gt;.&amp;lt;CI&amp;gt;'&lt;br /&gt;
                         Where:&lt;br /&gt;
                               MCC - Mobile Country Code&lt;br /&gt;
                               MNC - Mobile Network Code&lt;br /&gt;
                               LAC - Location Area Code&lt;br /&gt;
                               CI  - Cell Identification&lt;br /&gt;
                         Ex: '-gsm_cell 310.170.367.25732'&lt;br /&gt;
-set_assisted_off        disable SET assisted capability&lt;br /&gt;
-set_based_off           disable SET based capability&lt;br /&gt;
-msisdn &amp;lt;MSISDN&amp;gt;         set value for MSISDN (international phone number) as SET id&lt;br /&gt;
                         Ex: '-msisdn 14081234567'&lt;br /&gt;
-nai &amp;lt;nai&amp;gt;               specify Network Access Identifier as SET id&lt;br /&gt;
                         Ex: '-nai 12345@mywebsite.com'&lt;br /&gt;
-periodic &amp;lt;s&amp;gt;            make periodic request every s second (-1 to 64)&lt;br /&gt;
                         -1  single shot: perform one fix, then quit&lt;br /&gt;
                          0       native: perform fixes as fast as possible&lt;br /&gt;
                         &amp;lt;s&amp;gt;       timed: report a position every &amp;lt;s&amp;gt; seconds&lt;br /&gt;
                                          where &amp;lt;s&amp;gt; is 1 to 64&lt;br /&gt;
-recover                 recover GLLIN after signaled exit&lt;br /&gt;
-low [&amp;lt;count&amp;gt;]           low level test.  Default &amp;lt;count&amp;gt; is 1&lt;br /&gt;
-low_debug               Low level debug ON&lt;br /&gt;
+low_debug               Low level debug OFF&lt;br /&gt;
-train &amp;lt;count&amp;gt;           Send train data &amp;lt;count&amp;gt; times&lt;br /&gt;
+pty | -pty              Enable or disable NMEA output to pty &amp;quot;/tmp/nmeaPTY&amp;quot;&lt;br /&gt;
                         Default is off [-pty]&lt;br /&gt;
+np | -np                Enable or disable NMEA output to named pipe &amp;quot;/tmp/nmeaNP&amp;quot;&lt;br /&gt;
                         Default is on [-np]&lt;br /&gt;
+nmea | -nmea            Enable or disable NMEA output to log file&lt;br /&gt;
                         Default is off [-nmea]&lt;br /&gt;
+daemon | -daemon        Become a daemon (or not)&lt;br /&gt;
                         Default is -daemon&lt;br /&gt;
-a2 | -a3 | -a0          Select a GTA01 board revision.  Default is a3&lt;br /&gt;
-batch &amp;lt;st&amp;gt; &amp;lt;n&amp;gt; &amp;lt;fix&amp;gt;    perform batch test of &amp;lt;n&amp;gt; starts of type &amp;lt;st&amp;gt;&lt;br /&gt;
                         &amp;lt;st&amp;gt; is hot, warm, cold, or SNR.&lt;br /&gt;
                         Each start has &amp;lt;fix&amp;gt; fixes.&lt;br /&gt;
-i                       start GLLIN command line&lt;br /&gt;
+pnd                     optimize for PND&lt;br /&gt;
-pnd                     look for low signal strength signals&lt;br /&gt;
+sim                     using simulator so don't use almanac&lt;br /&gt;
-sim                     not using simulator&lt;br /&gt;
SNR                      manufacturing SNR test mode&lt;br /&gt;
hot                      hot start [default]&lt;br /&gt;
warm                     warm start&lt;br /&gt;
cold                     cold start&lt;br /&gt;
-v[n]                    Report GLLIN version string.&lt;br /&gt;
                         n is 1234 to report selected versions.&lt;br /&gt;
 version 1.1.7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using gpsd with gllin ==&lt;br /&gt;
&lt;br /&gt;
ipkg install gpsd&lt;br /&gt;
&lt;br /&gt;
edit /etc/default/gpsd and set the GPS_DEV to /tmp/nmeaNP start gpsd before gllin.&lt;br /&gt;
&lt;br /&gt;
== Some notes: ==&lt;br /&gt;
&lt;br /&gt;
The listed defaults don't seem to be correct.  By default it DOES generate NMEA data in log files.  These log files are on your flash (/home/root/gllin/log/*) and are written to once every second.  Ridiculous!&lt;br /&gt;
&lt;br /&gt;
To stop this, add the option &amp;quot;-nmea&amp;quot; to the second of the two gllin.real commands in the startup script.&lt;br /&gt;
&lt;br /&gt;
But note further that the startup script also spawns a command to 'cat' the output of the /tmp/nmeaNP named pipe to a gzipped file in /home/root.  If you want this to stop, you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
  * cat to /dev/null instead of | gzip &amp;gt;&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
  * add &amp;quot;-np&amp;quot; to the second gllin.real command&lt;br /&gt;
&lt;br /&gt;
You can't just take the 'cat' command out of the script, because with the named pipe activated, gllin will QUIT if it doesn't see anybody taking the output from the pipe.  To keep it going, either open that pipe or turn it off.&lt;br /&gt;
&lt;br /&gt;
You can use this [http://obri.sygroup.ch/gllin gllin initscript] to start and stop gllin.&lt;br /&gt;
&lt;br /&gt;
Another option:&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 echo &amp;quot;Starting gllin...&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 killall cat&lt;br /&gt;
 killall gllin.real&lt;br /&gt;
 &lt;br /&gt;
 mknod /tmp/nmeaNP p&lt;br /&gt;
 cat /tmp/nmeaNP &amp;gt; /dev/null &amp;amp;&lt;br /&gt;
 cd /home/root/gllin&lt;br /&gt;
 lib/ld-linux.so.2 --library-path /home/root/gllin/lib:/home/root/gllin/usr/lib /home/root/gllin/gllin.real -low 5&lt;br /&gt;
 lib/ld-linux.so.2 --library-path /home/root/gllin/lib:/home/root/gllin/usr/lib /home/root/gllin/gllin.real -periodic 1 -nmea&lt;br /&gt;
&lt;br /&gt;
== More Initscripts ==&lt;br /&gt;
&lt;br /&gt;
The gllin package doesn't come with a very good set of initscripts, and gpsd is flexible enough to use gllin or some other source of GPS coordinates.&lt;br /&gt;
&lt;br /&gt;
For gpsd and gllin to run together well, upon boot, the following scripts have worked well for me:&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/gpsd:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# gpsd	This shell script starts and stops gpsd.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 90 40&lt;br /&gt;
# description: Gpsd manages access to a serial- or USB-connected GPS&lt;br /&gt;
# processname: gpsd&lt;br /&gt;
&lt;br /&gt;
# Source function library.&lt;br /&gt;
#. /etc/rc.d/init.d/functions&lt;br /&gt;
&lt;br /&gt;
RETVAL=0&lt;br /&gt;
prog=&amp;quot;gpsd&amp;quot;&lt;br /&gt;
&lt;br /&gt;
test -f /etc/default/${prog} &amp;amp;&amp;amp; . /etc/default/${prog}&lt;br /&gt;
&lt;br /&gt;
start() {&lt;br /&gt;
	# Start daemons.&lt;br /&gt;
	echo -n &amp;quot;Starting ${prog}: &amp;quot;&lt;br /&gt;
	# We don't use the daemon function here because of a known bug&lt;br /&gt;
	# in initlog -- it spuriously returns a nonzero status when &lt;br /&gt;
	# starting daemons that fork themselves.  See&lt;br /&gt;
	# http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130629&lt;br /&gt;
	# for discussion.  Fortunately:&lt;br /&gt;
	#&lt;br /&gt;
	# 1. gpsd startup can't fail, or at least not in the absence of&lt;br /&gt;
	# much larger resource-exhaustion problems that would be very obvious.&lt;br /&gt;
	#&lt;br /&gt;
	# 2. We don't need all the logging crud that daemon/initlog sets&lt;br /&gt;
	# up -- gpsd does its own syslog calls.&lt;br /&gt;
	#&lt;br /&gt;
	&lt;br /&gt;
	if [ -e &amp;quot;${GPS_DEV}&amp;quot; ]&lt;br /&gt;
	then&lt;br /&gt;
	    ${prog} -n ${GPSD_OPTS} ${GPS_DEV}&lt;br /&gt;
	    RETVAL=$?&lt;br /&gt;
	    echo &amp;quot;success&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
	    # User needs to symlink ${GPS_DEV} to the right thing&lt;br /&gt;
	    # Do it automatically if the name contains &amp;quot;NP&amp;quot;&lt;br /&gt;
	    if echo ${GPS_DEV} | grep -q NP&lt;br /&gt;
	    then&lt;br /&gt;
	        mknod ${GPS_DEV} p&lt;br /&gt;
	        ${prog} -n ${GPSD_OPTS} ${GPS_DEV}&lt;br /&gt;
	        RETVAL=$?&lt;br /&gt;
	        echo &amp;quot;success&amp;quot;&lt;br /&gt;
	    else&lt;br /&gt;
	        RETVAL=$?&lt;br /&gt;
	        echo &amp;quot;No ${GPS_DEV} GPS device, aborting gpsd startup. Check /etc/default/${prog}&amp;quot;&lt;br /&gt;
	    fi&lt;br /&gt;
	fi&lt;br /&gt;
	[ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/gpsd&lt;br /&gt;
	return $RETVAL&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stop() {&lt;br /&gt;
	# Stop daemons.&lt;br /&gt;
	echo -n &amp;quot;Shutting down ${prog}: &amp;quot;&lt;br /&gt;
        killall ${prog}&lt;br /&gt;
	RETVAL=$?&lt;br /&gt;
	echo&lt;br /&gt;
	if [ $RETVAL -eq 0 ]&lt;br /&gt;
	then&lt;br /&gt;
	    test -e /var/lock/subsys/gpsd &amp;amp;&amp;amp; rm -f /var/lock/subsys/gpsd;&lt;br /&gt;
	fi&lt;br /&gt;
	return $RETVAL&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# See how we were called.&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
	start&lt;br /&gt;
	;;&lt;br /&gt;
  stop)&lt;br /&gt;
	stop&lt;br /&gt;
	;;&lt;br /&gt;
  restart|reload)&lt;br /&gt;
	stop&lt;br /&gt;
	start&lt;br /&gt;
	RETVAL=$?&lt;br /&gt;
	;;&lt;br /&gt;
  condrestart)&lt;br /&gt;
	if [ -f /var/lock/subsys/gpsd ]; then&lt;br /&gt;
	    stop&lt;br /&gt;
	    start&lt;br /&gt;
	    RETVAL=$?&lt;br /&gt;
	fi&lt;br /&gt;
	;;&lt;br /&gt;
  status)&lt;br /&gt;
#	status gpsd&lt;br /&gt;
#	RETVAL=$?&lt;br /&gt;
	;;&lt;br /&gt;
  *)&lt;br /&gt;
	echo &amp;quot;Usage: $0 {start|stop|restart|condrestart|status}&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit $RETVAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/gllin:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#&lt;br /&gt;
# This shell script starts and stops gllin.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
RETVAL=0&lt;br /&gt;
prog=&amp;quot;gllin&amp;quot;&lt;br /&gt;
GLLIN_PATH=/home/root/gllin&lt;br /&gt;
&lt;br /&gt;
test -f /etc/default/${prog} &amp;amp;&amp;amp; . /etc/default/${prog}&lt;br /&gt;
&lt;br /&gt;
start() {&lt;br /&gt;
	# Make fifo if it doesn't already exist&lt;br /&gt;
	if [ ! -p /tmp/nmeaNP ]&lt;br /&gt;
	then&lt;br /&gt;
	  mknod /tmp/nmeaNP p&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	# Check for gpsd ready (max 5 seconds)&lt;br /&gt;
	echo -n &amp;quot;Waiting for gpsd . . . &amp;quot;&lt;br /&gt;
	sleep 1&lt;br /&gt;
	if [ ! &amp;quot;$(pidof gpsd)&amp;quot; ]&lt;br /&gt;
	then&lt;br /&gt;
	  sleep 4&lt;br /&gt;
	  if [ ! &amp;quot;$(pidof gpsd)&amp;quot; ]&lt;br /&gt;
	  then&lt;br /&gt;
	    RETVAL=1&lt;br /&gt;
	    echo &amp;quot;failure.&amp;quot;&lt;br /&gt;
	    return $RETVAL&lt;br /&gt;
	  fi&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
	# Start daemons.&lt;br /&gt;
	echo -n &amp;quot;starting ${prog}: &amp;quot;&lt;br /&gt;
	cd $GLLIN_PATH&lt;br /&gt;
	sleep 1&lt;br /&gt;
	if [ -e $GLLIN_PATH/${prog}.real ]&lt;br /&gt;
	then&lt;br /&gt;
	  $GLLIN_PATH/lib/ld-linux.so.2 --library-path $GLLIN_PATH/lib $GLLIN_PATH/${prog}.real -low 5 &amp;gt; /dev/null&lt;br /&gt;
	  $GLLIN_PATH/lib/ld-linux.so.2 --library-path $GLLIN_PATH/lib $GLLIN_PATH/${prog}.real -periodic 1 +daemon&lt;br /&gt;
	else&lt;br /&gt;
	  $GLLIN_PATH/lib/ld-linux.so.2 --library-path $GLLIN_PATH/lib $GLLIN_PATH/${prog} -low 5 &amp;gt; /dev/null&lt;br /&gt;
	  $GLLIN_PATH/lib/ld-linux.so.2 --library-path $GLLIN_PATH/lib $GLLIN_PATH/${prog} -periodic 1 +daemon&lt;br /&gt;
	fi&lt;br /&gt;
	echo &amp;quot;success.&amp;quot;&lt;br /&gt;
	RETVAL=$?&lt;br /&gt;
	echo&lt;br /&gt;
	return $RETVAL&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stop() {&lt;br /&gt;
	# Stop daemons.&lt;br /&gt;
	echo -n &amp;quot;Shutting down ${prog}: &amp;quot;&lt;br /&gt;
	pkill ld-linux.so.2	&lt;br /&gt;
    	RETVAL=$?&lt;br /&gt;
	echo &amp;quot;success.&amp;quot;&lt;br /&gt;
	return $RETVAL&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# See how we were called.&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
	start&lt;br /&gt;
	;;&lt;br /&gt;
  stop)&lt;br /&gt;
	stop&lt;br /&gt;
	;;&lt;br /&gt;
  restart|reload)&lt;br /&gt;
	stop&lt;br /&gt;
	start&lt;br /&gt;
	RETVAL=$?&lt;br /&gt;
	;;&lt;br /&gt;
  status)&lt;br /&gt;
#	RETVAL=$?&lt;br /&gt;
	;;&lt;br /&gt;
  *)&lt;br /&gt;
	echo &amp;quot;Usage: $0 {start|stop|restart|condrestart|status}&amp;quot;&lt;br /&gt;
	exit 1&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit $RETVAL&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These scripts allow you (or init, if you have them numbered in rcX.d appropriately) to start gpsd *before* gllin.  This way, gpsd starts listening on /tmp/nmeaNP immediately, and gllin doesn't need to send output to /dev/null in order to stay alive.&lt;br /&gt;
&lt;br /&gt;
This version of the gpsd script will create the named pipe (if the device name includes &amp;quot;NP&amp;quot; in the filename) if it doesn't exist.&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/FAQ</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/FAQ"/>
				<updated>2008-02-16T21:29:32Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Q: I'm a ____ expert, can I join/help OpenMoko? */  +http://projects.openmoko.org/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Frequently Asked Questions... with answers included!&lt;br /&gt;
&lt;br /&gt;
==Introduction== &lt;br /&gt;
&lt;br /&gt;
=== Q: What is OpenMoko? What is the Neo 1973? What is the Neo Freerunner? ===&lt;br /&gt;
A: [[OpenMoko]] is a software platform and the world's first completely open mobile phone software stack.  It is based on Linux and  allows users and enthusiasts great freedom to customise their phone.&lt;br /&gt;
* The [[FIC]] [[Neo1973]] is the first fully supported OpenMoko phone. &lt;br /&gt;
* The FIC [[Neo FreeRunner]] is the second Openmoko phone although it is not released as of yet (Feb08)&lt;br /&gt;
&lt;br /&gt;
=== Q: I'm a ____ expert, can I join/help OpenMoko? ===&lt;br /&gt;
&lt;br /&gt;
We would love to hear from you.&lt;br /&gt;
&lt;br /&gt;
* If you are interested in joining OpenMoko as a software developer, please visit http://www.openmoko.com/contact-index.html and send us an e-mail.  &lt;br /&gt;
* Or register some your project at http://projects.openmoko.org/&lt;br /&gt;
* Or simply join the Openmoko Community - more info here http://wiki.openmoko.org/wiki/OpenMoko:Community_Portal&lt;br /&gt;
&lt;br /&gt;
=== Q: When and where can I buy a [[Neo1973]]? ===&lt;br /&gt;
&lt;br /&gt;
A: The OpenMoko Neo 1973 is now sold out (11 Feb 2008) as you can see at the [https://direct.openmoko.com/ web shop]. You must wait til the Neo FreeRunner is released...&lt;br /&gt;
&lt;br /&gt;
=== Q: When can I buy a [[Neo FreeRunner]]? ===&lt;br /&gt;
&lt;br /&gt;
A: Spring 2008, maybe March.   Watch the [[OpenMoko:Community Portal|Community Portal]] for further updates&lt;br /&gt;
&lt;br /&gt;
=== Q: What are the new features that the Neo Freerunner will have? ===&lt;br /&gt;
&lt;br /&gt;
It will retain many good features from the Neo1973 such as the very high resolution touch screen and integrated GPS unit.&lt;br /&gt;
&lt;br /&gt;
It adds the following features&lt;br /&gt;
* WiFi - 802.11 b/g - for high speed internet&lt;br /&gt;
* Faster processor operating at 400Mhz (up from 266Mhz) - for faster operation&lt;br /&gt;
* * SMedia Glamo3362 Graphics Accelerator - for improved graphical performance&lt;br /&gt;
* 2 3D Accelerometers - the phone applications will know which way the phone is oriented&lt;br /&gt;
* 256MB Flash - larger memory to run bigger applications&lt;br /&gt;
* LED's illuminating the 2 external buttons on the phone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Q: How much? === &lt;br /&gt;
&lt;br /&gt;
A: Neo1973 (Internal code name GTA01B_v04): $300 for Neo Base, $399 for Neo Advanced. Available now. See [[Neo1973]] for what is included.&lt;br /&gt;
&lt;br /&gt;
A: Freerunner (Internal code name GTA02): $450 for Neo Base, $600 for Neo Advanced. See [[Neo1973]] for list of hardware.&lt;br /&gt;
&lt;br /&gt;
=== Q: What can I do with the Neo1973? ===&lt;br /&gt;
&lt;br /&gt;
A: For long answer see [[Developer preview]]&lt;br /&gt;
&lt;br /&gt;
A: The Neo1973 is a Phase 1 phone and aimed at software developers only. It is not suitable for end users, it will have basic functionality as a touchscreen phone. Little else will work, software development will continue till mass market release.    Here are one developer's thoughts about the possibilities [http://blog.syntaxpolice.org/isaac/technology/linuxPhones.html]&lt;br /&gt;
&lt;br /&gt;
Those interested should:&lt;br /&gt;
&lt;br /&gt;
* Know that there will be a device with faster cpu, gsm system etc in the spring of 2008.&lt;br /&gt;
* Have fun hacking devices.&lt;br /&gt;
* Be able to find their way through prototype software and hardware without much documentation.&lt;br /&gt;
* Share the dream of a device powered by free software.&lt;br /&gt;
* Not expect a consumer-level device.&lt;br /&gt;
* Come up with new ideas for exploring the age of mobile computing.&lt;br /&gt;
* Have $300.&lt;br /&gt;
&lt;br /&gt;
Ideally they also:&lt;br /&gt;
&lt;br /&gt;
* Can spot bugs and submit patches.&lt;br /&gt;
* Love to cooperate with a community improving the software.&lt;br /&gt;
&lt;br /&gt;
=== Q: What will I be able to do with the Neo Freerunner? ===&lt;br /&gt;
&lt;br /&gt;
A: The Neo Freerunner is the first phase 2 (mass release) phone from the Openmoko project and is designed for everyday use by end users and continued software development and improvements by the Openmoko team and the Openmoko community.&lt;br /&gt;
&lt;br /&gt;
A: The question is almost what can you NOT do with this phone - eventually there will be a huge range of free software applications allowing both end users and developers to get much more out of this phone than a standard &amp;quot;locked&amp;quot; mobile phone using features like the integrated GPS, bluetooth, wifi and accelerometers.&lt;br /&gt;
&lt;br /&gt;
=== Q: Do I need the Neo 1973 Advanced (or in due course the Neo Freerunner Advanced)? === &lt;br /&gt;
&lt;br /&gt;
End users or power users should buy the &amp;quot;base&amp;quot; unit.&lt;br /&gt;
&lt;br /&gt;
Software developers may wish to buy the &amp;quot;advanced&amp;quot; model.&lt;br /&gt;
&lt;br /&gt;
With Neo 1973 Base or Neo Freerunner Base you can do:&lt;br /&gt;
* Kernel development.&lt;br /&gt;
* Application development.&lt;br /&gt;
* Updating u-boot (equivalent to PC BIOS) using a tested image.&lt;br /&gt;
* Replace a non-booting kernel and/or rootfs using [[Dfu-util]].&lt;br /&gt;
&lt;br /&gt;
With Neo 1973 Advanced or Neo Freerunner Advanced you can additionally do:&lt;br /&gt;
* U-boot development.&lt;br /&gt;
* Use the kernel console.&lt;br /&gt;
* Unbrick your device if you flash a wrong or non-working u-boot image.&lt;br /&gt;
&lt;br /&gt;
=== Q: I have a shipping related question === &lt;br /&gt;
&lt;br /&gt;
For Neo1973&lt;br /&gt;
* See [[SH1_FAQ|Shipment 1 FAQ]].&lt;br /&gt;
&lt;br /&gt;
For FreeRunner&lt;br /&gt;
* Shipping and distribution arrangements will be announced later&lt;br /&gt;
&lt;br /&gt;
=== Q: What does the [[Neo1973]] look like? ===&lt;br /&gt;
&lt;br /&gt;
* See the original launch [[Artwork|artwork]]&lt;br /&gt;
* Collected images from google [[http://images.google.co.uk/images?q=neo+1973&amp;amp;ie=UTF-8&amp;amp;oe=utf-8&amp;amp;rls=com.ubuntu:en-GB:official&amp;amp;client=firefox-a&amp;amp;um=1&amp;amp;sa=N&amp;amp;tab=wi]]&lt;br /&gt;
&lt;br /&gt;
=== Q: What does the [[Neo FreeRunner]] look like? ===&lt;br /&gt;
&lt;br /&gt;
* It uses the same case and dimensions as the Neo1973 (as announced at CES Jan08)&lt;br /&gt;
&lt;br /&gt;
=== Q: What else do I need to know? ===&lt;br /&gt;
&lt;br /&gt;
* Both Neo 1973 and Neo Freerunner are tri-band GSM phones.   &lt;br /&gt;
* The Neo Freerunner is expected to be offered in an 850/1800/1900MHz version for North America and an 900/1800/1900MHz version for the rest of the world.      &lt;br /&gt;
* The Neo1973 is an 900/1800/1900Mhz version only and may not work well in some rural parts of North America.&lt;br /&gt;
&lt;br /&gt;
=== Q: What are the benefits of an &amp;quot;open&amp;quot; phone over a &amp;quot;closed&amp;quot; phone ===&lt;br /&gt;
&lt;br /&gt;
A: In a conventional closed phone, the handset maker and the mobile network operator work together to provide a service to you that best suits their business model.    The capabilities of a modern smartphone equipped with GPS, Wifi and bluetooth are amazing and the result is that many features are &amp;quot;locked down&amp;quot; because they do not suit the network operator.    Up until now it has been difficult to buy a phone on which you have freedom to install sofware which is not controlled by the network operators - [[Openmoko]] changes that!&lt;br /&gt;
&lt;br /&gt;
A: A list of examples of &amp;quot;closed&amp;quot; behaviour has been started here - [[Problems of typical &amp;quot;closed&amp;quot; phones]]&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Q: Can the software do/connect to/... ===&lt;br /&gt;
A: At the moment, the answer is in almost all cases no. The phone is at the moment a small linux box with a touchscreen, a working dialer and some prototype apps. &lt;br /&gt;
Most do not function in any way that would be suitable for users.&lt;br /&gt;
If you want to add a feature or application request, then look over the existing applications and either add one, or add a feature request to the applications page.&lt;br /&gt;
&lt;br /&gt;
===What software is on the phone?===&lt;br /&gt;
At the moment, almost no 'end-user' applications are present and working in a usable state.&lt;br /&gt;
It is possible to make and receive calls in some software revisions, this frequently breaks though.&lt;br /&gt;
&lt;br /&gt;
====What software can be installed on the phone?====&lt;br /&gt;
&lt;br /&gt;
=== Q: Is there description and list of OpenMoko software? ===&lt;br /&gt;
&lt;br /&gt;
A: See [[OpenMoko]] and [[OpenMokoFramework]]&lt;br /&gt;
&lt;br /&gt;
=== Q: Is it completely free software/open source? ===&lt;br /&gt;
&lt;br /&gt;
A: User space [[Gpsd]] will use binary plugin (to be released soon) for [[:Category:Neo1973 Hardware#AGPS|Hammerhead AGPS]] and [[:Category:Neo1973 Hardware#GSM.2FGPRS|GSM modem]] is separate subsystem connected to S3C2410 UART1. Otherwise it is completely free software. See [[MokoMakefile]] and [[Development resources]].&lt;br /&gt;
&lt;br /&gt;
=== Q: How do I install and manage software on OpenMoko? ===&lt;br /&gt;
&lt;br /&gt;
A: ipkg: http://handhelds.org/moin/moin.cgi/Ipkg&lt;br /&gt;
&lt;br /&gt;
=== Q: How can I compile programs for the Neo1973? ===&lt;br /&gt;
&lt;br /&gt;
A: See [[Toolchain]].&lt;br /&gt;
&lt;br /&gt;
=== Q: Is there an emulator available for OpenMoko? ===&lt;br /&gt;
&lt;br /&gt;
For a lot of testing and development work, you don't actually need emulation as you can run OpenMoko on a normal PC too. The emulators also aren't 100% accurate. That being said, there are several emulation options as described in the following.&lt;br /&gt;
&lt;br /&gt;
====QEMU====&lt;br /&gt;
QEMU can now emulate the Neo1973 device. The [[MokoMakefile]] has support for automatically building, flashing, and running [[OpenMoko under QEMU|the Neo1973 emulator]].&lt;br /&gt;
&lt;br /&gt;
“make qemu” will build qemu-neo1973, download the latest official openmoko images, flash the images into the virtual NAND flash, and run the emulator.&lt;br /&gt;
&lt;br /&gt;
====Xoo====&lt;br /&gt;
Another is [http://projects.o-hand.com/xoo Xoo]. Koen says: &amp;quot;Xoo should be enough for most apps people will develop, since most don't need access to the gsm uart directly. If you're hardcore you could use qemu + xoo, but that still doesn't emulate all the hardware quirks (e.g. unaligned access)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Update: Stefan Schmidt has resized the [[Neo1973]] Mock-up and written a small description for xoo. In his words:&lt;br /&gt;
&lt;br /&gt;
It's not really useable at all, as you need a really high screen resolution to fit the whole picture on your screen. And of course the dpi are wrong. Even no buttons because I can't remember where they are at the case.&lt;br /&gt;
&lt;br /&gt;
http://www.datenfreihafen.org/~stefan/OpenMoko/neo1973-xoo-device.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Start with 'xoo --device /path/to/neo1973.xml'&lt;br /&gt;
&lt;br /&gt;
Some more details [[Getting_Openmoko_working_on_host_with_Xoo|here]].&lt;br /&gt;
&lt;br /&gt;
====Xephyr====&lt;br /&gt;
Or use Xephyr directly with locally compiled programs (e.g. matchbox svn + openmoko):&lt;br /&gt;
 Xephyr -screen 480x640 -nolisten tcp -ac :1 &amp;amp;&lt;br /&gt;
 export DISPLAY=:1&lt;br /&gt;
 export LD_LIBRARY_PATH=/usr/local/lib&lt;br /&gt;
 matchbox-window-manager -display $DISPLAY -use_titlebar no \&lt;br /&gt;
  -use_super_modal yes -use_lowlight yes -use_dialog_mode static \&lt;br /&gt;
  -use_cursor yes &amp;amp;&lt;br /&gt;
 matchbox-panel --geometry=480x44 --end-applets=clock &amp;amp;&lt;br /&gt;
 openmoko-footer &amp;amp;&lt;br /&gt;
 openmoko-taskmanager &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=== Q: Where can I find some type of tutorial for a 'Hello, world' on OpenMoko? ===&lt;br /&gt;
&lt;br /&gt;
A: This should get you started:&lt;br /&gt;
http://www.gtk.org/tutorial/&lt;br /&gt;
&lt;br /&gt;
=== Q: Can PalmOS apps applications be ported to run on OpenMoko? ===&lt;br /&gt;
&lt;br /&gt;
A: Making legacy apps written for the &amp;quot;Garnet&amp;quot; OS (née &amp;quot;Palm OS&amp;quot;) run on Linux&lt;br /&gt;
is decidedly non-trivial.&lt;br /&gt;
&lt;br /&gt;
PalmOS apps are in general very hard to simply 'port'. Particularly well-designed programs may make it possible.&lt;br /&gt;
&lt;br /&gt;
The ACCESS Linux Platform will include Garnet on Host (GHost), a PalmOS emulator that will support M6800 (68k) and ARM PalmOS applications. This part (GarnetVM and the .prc loader) will however be closed-source and likely under a restrictive license (fact confirmed by ACCESS Co. employees), making it rather unusable. In addition GarnetVM depends on Hiker and other packages.&lt;br /&gt;
&lt;br /&gt;
It is possible that POSE, an emulator that simulates a Palm device on a Linux host could be used to allow 68k based applications to run.  This emulator has been around a long time; one expects that it will also run on OpenMoko, but this has to be considered a short-term bandaid rather than a long-term solution.&lt;br /&gt;
&lt;br /&gt;
The soon-to-be-released [http://www.palm.com/foleo/ Palm Foleo], which runs a Linux port developed by Palm Inc. independently of ALP, contains a PalmOS compatibility environment that runs PalmOS apps, supposedly all of them and supposedly seamlessly. Little is known about how it works but if it's not too kludgy it should run unmodified on any ARM linux. It is not known what license it will be distributed under.&lt;br /&gt;
&lt;br /&gt;
Hopefully emulation will be necessary only for M68000 code (pre-PalmOS 5) while native ARM programs can run natively under Linux, provided a proper set of PalmOS libraries and a .prc executable loader.&lt;br /&gt;
&lt;br /&gt;
=== Q: Does it have Java? ===&lt;br /&gt;
A: It will have eventually, if you help us to get it working. Some good places to keep track of would be [http://projects.openmoko.org/projects/java-pkg/ projects.openmoko.org] and [https://phoneme.dev.java.net/ PhoneME].&lt;br /&gt;
&lt;br /&gt;
Project [[https://wiki.evolvis.org/jalimo/index.php/Jalimo Jalimo]] is a project aiming to provide a Java stack on mobile devices. This project supports OpenMoko.&lt;br /&gt;
&lt;br /&gt;
=== Q: What are the relevant X11 details? ===&lt;br /&gt;
&lt;br /&gt;
A: See [http://lists.openmoko.org/pipermail/community/2007-January/001353.html xdpyinfo output].&lt;br /&gt;
&lt;br /&gt;
=== Q: Does OpenMoko run on any other hardware? ===&lt;br /&gt;
&lt;br /&gt;
You can run it on your [[How_to_run_OpenMoko_Apps_on_PC|PC]]. There is work going on with [http://www.datenfreihafen.org/~stefan/weblog//archives/2007/02/#e2007-02-18T15_27_07.txt OpenEZX and HTC]. It's running on [http://dominion.kabel.utwente.nl/koen/cms/openmoko-running-on-an-ipaq iPaq hx4700], on a [http://hackndev.com/node/701 Palm TX] and on [http://blog.mikeasoft.com/2007/07/01/openmoko-on-a-treo-650/ PalmOne's Treo 650].&lt;br /&gt;
&lt;br /&gt;
=== Q: What are the requirements to the hardware to run OpenMoko? (Would it run on the IXI ogo?) ===&lt;br /&gt;
&lt;br /&gt;
=== Q: Why do you not build on top of the Maemo platform instead? ===&lt;br /&gt;
&lt;br /&gt;
While I can't speak for the OpenMoko team, it's worth noting that maemo is fixed resolution only. That will, I've heard, change in the future, but it hasn't yet. Maemo's current layout is also optimized for wide screens, not tall narrow ones. Most third party maemo applications that are out there will need to be modified to work at different sizes. Finally, a number of the software components of the Nokia 770 and N800 are not open source. --gopi&lt;br /&gt;
&lt;br /&gt;
To add up on that, according to Nokia, Maemo is designed to bring the &amp;quot;Desktop&amp;quot; experience to an Internet Tablet. A lot of Desktop paradigms just won't work on a phone. However, we really share a lot of the base-technology (gtk, dbus, eds, gconf, to name a few) with Maemo, so we are definitely not a reinvent-the-wheel team.&lt;br /&gt;
&lt;br /&gt;
=== Q: Will it be possible to use popular VoIP applications such as Skype on the OpenMoko platform? ===&lt;br /&gt;
&lt;br /&gt;
A: Perhaps. Hardware issues mean that it won't work well on the Neo1973. (the typical latency of GPRS is far too high). Also, Skype is a closed source application, which does not provide binaries that would be suitable to run on OpenMoko. Skype's vendor could of course choose to provide binaries for OpenMoko phones. However, many telephone providers' terms of service agreements preclude running VoIP over their baseline GSM service.&lt;br /&gt;
&lt;br /&gt;
=== Q: Same question for Instant Messaging applications such as MSN Messenger? ===&lt;br /&gt;
&lt;br /&gt;
A: Very probably. MSN is closed source and will only run where Microsoft wants you to run it. But there are many Open Source IM clients, many of which have a plugin architecture and so support the use of more than one IM protocol, even simultaneously. One example is [http://www.pidgin.im  Pidgin, formerly called GAIM]. GPRS does induce a certain amount of latency but that should not be a problem for simple, text-oriented chat between parties. And the GTA02's WiFi  will make it even better.&lt;br /&gt;
&lt;br /&gt;
==Neo1973 Hardware== &lt;br /&gt;
&lt;br /&gt;
=== Q: Is there description of [[:Category:Neo1973 Hardware | Neo1973 Hardware]] ? ===&lt;br /&gt;
&lt;br /&gt;
A: See [[:Category:Neo1973 Hardware | Neo1973 Hardware]] and [[Disassembling Neo1973]]&lt;br /&gt;
&lt;br /&gt;
=== Q: What are the dimensions? ===&lt;br /&gt;
&lt;br /&gt;
A: 120.7 x 62 x 18.5 mm, It would fit entirely in a coke can. (4.75 * 2.4 * 0.72 &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== Q: How heavy is it? ===&lt;br /&gt;
&lt;br /&gt;
A: 185g, (6.5 ounces).&lt;br /&gt;
&lt;br /&gt;
=== Q: Does it have a camera? ===&lt;br /&gt;
&lt;br /&gt;
A: No, see [[:Category:Neo1973 Hardware | Neo1973]] for details on what it does include (and [[Wish List - Hardware]] for what some want in the future.) See also [[FAQ#USB]].&lt;br /&gt;
&lt;br /&gt;
=== Q: Does it have Wifi? ===&lt;br /&gt;
&lt;br /&gt;
A: The currently available [[Neo1973]] does not have WiFi. There was no suitable Wifi device available when it was designed. The next version will have WiFi. See also [[FAQ#USB]].&lt;br /&gt;
&lt;br /&gt;
=== Q: Does it have bluetooth? ===&lt;br /&gt;
&lt;br /&gt;
A: Yes! Bluetooth 2.0.&lt;br /&gt;
&lt;br /&gt;
=== Q: Does it come with a stylus? ===&lt;br /&gt;
&lt;br /&gt;
A: Yes, but there's no holder for it on the phone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Q: Where are the buttons? ===&lt;br /&gt;
&lt;br /&gt;
[[Neo1973 Power Button|The power button]] is a small circular button, just next to the USB connector. &lt;br /&gt;
[[Neo1973 AUX Button|The Auxiliary button]] is a rectangular button on the top left of the edge of the phone. (on black phones it looks just like an IRDA port).&lt;br /&gt;
&lt;br /&gt;
=== Q: How do I input text? ===&lt;br /&gt;
&lt;br /&gt;
A: Use provided keyboard app.&lt;br /&gt;
&lt;br /&gt;
A: Use Bluetooth keyboard.&lt;br /&gt;
&lt;br /&gt;
A: For more methods and ideas see [[Wishlist:Text_Input]].&lt;br /&gt;
&lt;br /&gt;
=== Q: Can I record calls and/or play audio files in calls? ===&lt;br /&gt;
&lt;br /&gt;
A: Yes, audio path from GSM to/from mic and speakers is completely controllable by user. For example recording calls (both sides) and implementing an [[Answering Machine]] is possible. Also using text-&amp;gt;speech should be possible or modifying outgoing voice. Currently there is no software bundled in phone to do this.&lt;br /&gt;
There are only 2 A/D inputs and three D/A outputs (one dedicated to the earpiece). This means that stereo audio playback cannot happen at the same time as the [[Answering Machine]] functionality, amongst other things. See the audio page. [[Neo1973_Audio_Subsystem|Neo1973 Audio Subsystem]]&lt;br /&gt;
&lt;br /&gt;
=== Q: What is the battery life? ===&lt;br /&gt;
&lt;br /&gt;
A: There has been no word on this so far, but see [[Neo1973 Power Management#Approximate_power_draw_of_various_subsystems|these estimates]] for a rough idea.  More information about the battery [[Neo1973 Battery|here]].&lt;br /&gt;
&lt;br /&gt;
=== USB ===&lt;br /&gt;
&lt;br /&gt;
==== Q: What can I do with the USB port on the Neo1973? ====&lt;br /&gt;
A: Charge the phone, communicate with it over USB-serial, or USB-networking.&lt;br /&gt;
&lt;br /&gt;
A: Plug external devices, such as wifi, cameras, or mass-storage devices in. The &amp;quot;Mass Market&amp;quot; version of the phone will have wifi integrated.&lt;br /&gt;
&lt;br /&gt;
==== Q: What can't I do with the USB? ====&lt;br /&gt;
&lt;br /&gt;
The only limitation on current hardware seems to be no usb 2.0 support, which means slower communication with 2.0 devices.&lt;br /&gt;
&lt;br /&gt;
==== Q: Why is only USB 1.1 provided? ====&lt;br /&gt;
&lt;br /&gt;
A: The processor has USB 1.1 built in. One with USB2 built in would have been more expensive.&lt;br /&gt;
&lt;br /&gt;
==== Q: Can the Neo charge and use devices on a USB hub at the same time? ====&lt;br /&gt;
&lt;br /&gt;
A: &lt;br /&gt;
*When the Neo is connected to a device port on a USB hub, it will start charging. If the hub is a powered hub, then it will charge fast (3h), otherwise around 12h.&lt;br /&gt;
&lt;br /&gt;
*If you plug the Neo into the host port of a USB hub you can use devices on that hub but the Neo will not charge. (Some/many USB hubs will not accept an unpowered host as valid, hence the need for the below cable.)&lt;br /&gt;
*This is because the host socket on USB hubs is not powered.&lt;br /&gt;
&lt;br /&gt;
FIC product development is looking into providing something that&lt;br /&gt;
conveniently solves this problem.&lt;br /&gt;
&lt;br /&gt;
The USB port on the Neo is not a properly compliant USB host port, all USB host ports must provide 5V - though powered devices or hubs may not draw any current from this, they may refuse to work. (The Belkin Tetrahub is an example of a hub that will not work.)&lt;br /&gt;
&lt;br /&gt;
One solution is a three headed cable.&lt;br /&gt;
&lt;br /&gt;
One end plugs into the Neo. One end plugs into a device port of a powered hub, or the Neo charger. One end plugs into the host port of a hub.&lt;br /&gt;
&lt;br /&gt;
The Charger/USB device plug only has +5V and 0V connected in the simple cable, which are connected to the other ends.&lt;br /&gt;
&lt;br /&gt;
For a more complex cable, when the host socket is not plugged in, the cable acts as a simple USB cable.&lt;br /&gt;
&lt;br /&gt;
==== Q: What are the details of the USB port on the [[Neo1973]]? How does it compare to USB On-The-Go? ====&lt;br /&gt;
&lt;br /&gt;
A: The [[Neo1973]] will have mini-USB-B, and will be able to function as either a host or a device. It will NOT be USB On-The-Go.  OTG is a complex specification, and it comprises way more than just&lt;br /&gt;
a AB socket, but also electrical and software components which cannot be provide by the S3C2410.&lt;br /&gt;
&lt;br /&gt;
You will need a special Mini-B to regular-B cable (note that this won't actually comply with the USB standard:  a compliant cable has to have an A or Mini-A plug on one end, and B or Mini-B on the other).&lt;br /&gt;
&lt;br /&gt;
=== Q: Are there any LEDs on the Neo 1973? ===&lt;br /&gt;
&lt;br /&gt;
A: The [[Neo1973]] P1/P2 will have no LEDs besides the screen backlight.&lt;br /&gt;
&lt;br /&gt;
=== Q: Will a JTAG port be made available? ===&lt;br /&gt;
&lt;br /&gt;
A:  Included with purchase of The &amp;quot;Hacker's Lunchbox&amp;quot; (Advanced version).&lt;br /&gt;
&lt;br /&gt;
There are [[Neo1973_Hardware#Changes_from_GTA01Bv3|exposed I2C, SPI and debug board connectors]] inside case in all versions and [[Debug Board|Debug Board v2]] (JTAG and serial console) in Advanced version. [[Connecting Neo1973 with Debug Board v2]] explains how to connect it to the phone.&lt;br /&gt;
&lt;br /&gt;
=== Q: Will the JTAG interface that comes with GTA01 be compatible with GTA02?  ===&lt;br /&gt;
&lt;br /&gt;
A: Yes&lt;br /&gt;
&lt;br /&gt;
=== Q: What can we expect in future versions? ===&lt;br /&gt;
&lt;br /&gt;
A: A faster CPU, faster GSM (EDGE?) perhaps even powered USB port, USB2, wifi, and camera. No details have been released yet. More details of hardware upgrades should be available sometime in May. There will also be 5 more OpenMoko devices - some not phones in the traditional sense - announced by FIC in September.&lt;br /&gt;
&lt;br /&gt;
==Networking/Connectivity==&lt;br /&gt;
&lt;br /&gt;
=== Q: What kind of connectivity? ===&lt;br /&gt;
&lt;br /&gt;
A: Tri-band GSM (commonly known as &amp;quot;European tri-band&amp;quot;, 900/1800/1900 MHz), GPRS Class12/CS4 2.5G (Not EDGE), Bluetooth 2.0 EDR, USB in all versions. WiFi: Atheros AR6K in [[GTA02#.22Phase_2.22_.28GTA02.2C_.22Mass_Market.22.29|GTA02]]. (No 3G in year 2007 models)&lt;br /&gt;
&lt;br /&gt;
=== Q: Can I bridge to an Ethernet (wired or unwired) network via a suitable Bluetooth enabled router? ===&lt;br /&gt;
&lt;br /&gt;
A: Yes - see [http://gentoo-wiki.com/HOWTO_Configure_a_bluetooth_network_access_point this howto for how to configure a linux computer to act as such a router] and [[Bluetooth Support]].&lt;br /&gt;
&lt;br /&gt;
=== Q: What providers provide the GSM required for Neo1973? ===&lt;br /&gt;
&lt;br /&gt;
A: See [[Neo1973 compatible cellphone providers]]&lt;br /&gt;
&lt;br /&gt;
=== Q: Will OpenMoko &amp;quot;Just Work&amp;quot; with Mac OS X? ===&lt;br /&gt;
&lt;br /&gt;
A: There has been some discussion of this on the mailing list. There is motivation, and there are interested developers. &lt;br /&gt;
Not being a Mac OS X user, I don't know enough&lt;br /&gt;
to summarize the discussion to answer this question. Can someone please fill in?&lt;br /&gt;
&lt;br /&gt;
A: For IP over USB cable connectivity, it is planned to improve/adapt the AJZaurusUSB driver, allowing ssh into the OpenMoko.&lt;br /&gt;
&lt;br /&gt;
A: It is expected that (Bluetooth/UB) SyncML based interoperation for&lt;br /&gt;
contacts and events can easily be achieved by a patch&lt;br /&gt;
to the Apple iSync configuration tables.&lt;br /&gt;
&lt;br /&gt;
A: There is an open source implementation of Cocoa (GNUstep) that aims to run MacOS X compatible applications (sort of&lt;br /&gt;
PPC/x86/ARM universal binaries) on OpenMoko devices: mySTEP.&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
&lt;br /&gt;
=== Q: On the lists on lists.openmoko.org, should replies be added above or below the original text? ===&lt;br /&gt;
&lt;br /&gt;
A: Please reply UNDER post.&lt;br /&gt;
&lt;br /&gt;
=== Q: How can I find out if a question or topic has already been discussed on the mailing lists? ===&lt;br /&gt;
&lt;br /&gt;
A: By searching the mailing list archives. For example, using Google searches:&lt;br /&gt;
&lt;br /&gt;
 site:openmoko.org text&lt;br /&gt;
&lt;br /&gt;
For example, to search for accelerometer:&lt;br /&gt;
&lt;br /&gt;
 site:openmoko.org accelerometer&lt;br /&gt;
&lt;br /&gt;
If you only want to read the &amp;quot;official&amp;quot; mails from FIC people or from OpenMoko people:&lt;br /&gt;
&lt;br /&gt;
 site:openmoko.org text &amp;quot;at fic.com.tw&amp;quot;&lt;br /&gt;
 site:openmoko.org text &amp;quot;at openmoko.org&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For example to search for &amp;quot;release date&amp;quot; from FIC people:&lt;br /&gt;
&lt;br /&gt;
 site:openmoko.org &amp;quot;release date&amp;quot; &amp;quot;at fic.com.tw&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the [http://www.google.com/coop/cse?cx=018430699993342716089%3Aszsaurhronw custom OpenMoko search engine] that is using [http://www.google.com/coop/ Google Co-op].&lt;br /&gt;
&lt;br /&gt;
=== Q: how many dead pixels may the LCM have before calling it defect? ===&lt;br /&gt;
&lt;br /&gt;
A: the answer for the display used in GTA01 and GTA02 is '2'&lt;br /&gt;
&lt;br /&gt;
=== Q: Can I has some money for a Neo1973? ===&lt;br /&gt;
&lt;br /&gt;
A: No.&lt;br /&gt;
&lt;br /&gt;
{{Languages|FAQ}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Information]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_1973_vs_Neo_FreeRunner</id>
		<title>Neo 1973 vs Neo FreeRunner</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_1973_vs_Neo_FreeRunner"/>
				<updated>2008-02-16T11:10:05Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: Sold out&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Comparison between the Neo 1973 (GTA01Bv4) and Neo Freerunner ([[GTA02#.22Phase_2.22_.28GTA02.2C_.22Mass_Market.22.29|GTA02]]) hardware revisions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 {| border=&amp;quot;1&amp;quot;&lt;br /&gt;
 !Feature&lt;br /&gt;
 !&lt;br /&gt;
 !&lt;br /&gt;
 |-&lt;br /&gt;
 |FIC Internal Codename&lt;br /&gt;
 |GTA01Bv4&lt;br /&gt;
 |GTA02&lt;br /&gt;
 |-&lt;br /&gt;
 |Public or Commercial Name&lt;br /&gt;
 |Neo 1973&lt;br /&gt;
 |Neo Freerunner&lt;br /&gt;
 |-&lt;br /&gt;
 |Sale&lt;br /&gt;
 |Sold out&lt;br /&gt;
 |Not ready yet. See http://wiki.openmoko.org/wiki/Community_Updates&lt;br /&gt;
 |-&lt;br /&gt;
 |Dimensions&amp;lt;br /&amp;gt;(no differences) &lt;br /&gt;
 |120.7 x 62 x 18.5 mm&lt;br /&gt;
 |120.7 x 62 x 18.5 mm&lt;br /&gt;
 |-&lt;br /&gt;
 |Weight&lt;br /&gt;
 |184 g&lt;br /&gt;
 |184 g (unconfirmed)&lt;br /&gt;
 |-&lt;br /&gt;
 |Screen&amp;lt;br /&amp;gt;(no differences)&lt;br /&gt;
 |2.8&amp;quot; 480x640 at 285 ppi, &lt;br /&gt;
 |2.8&amp;quot; 480x640 at 285 ppi,&lt;br /&gt;
 |-&lt;br /&gt;
 |[[Neo1973_Hardware#microSD-Card|Storage]]&lt;br /&gt;
 |64 MB integrated flash memory (expandable with [http://lists.openmoko.org/pipermail/community/2007-February/003156.html any size microSD or MicroSDHC memory cards])&lt;br /&gt;
 | [http://lists.openmoko.org/pipermail/announce/2007-June/000013.html 256 MB] integrated flash memory.&lt;br /&gt;
Expandable with [http://www.techtree.com/India/News/Samsung_Readies_8GB_microSD_Card/551-81172-581.html any size microSD or microSDHC memory cards]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[Neo1973_Hardware#Processor|CPU]]&lt;br /&gt;
 |Samsung s3c2410 SoC @ 266 MHz ([http://lists.openmoko.org/pipermail/announce/2007-January/000000.html Source])&lt;br /&gt;
 |[http://www.samsung.com/global/business/semiconductor/productInfo.do?fmly_id=229&amp;amp;partnum=SC32442&amp;amp;&amp;amp;ppmi= Samsung 2442] SoC @ 400 MHz &lt;br /&gt;
 |-&lt;br /&gt;
 |Graphics Accelerator&lt;br /&gt;
 |&lt;br /&gt;
 |[http://www.smediatech.com/product3362.htm SMedia 3362 2D/3D Graphics Accelerator] [http://lists.openmoko.org/pipermail/announce/2007-June/000013.html lists.openmoko.org announcement]&lt;br /&gt;
 |-&lt;br /&gt;
 |[[Neo1973_Hardware#RAM|RAM]]&lt;br /&gt;
 |128 MB&lt;br /&gt;
 |128 MB&lt;br /&gt;
 |-&lt;br /&gt;
 |Wireless&lt;br /&gt;
 |Tri-band GSM 800/1800/1900, GPRS Class12/CS4/[http://lists.openmoko.org/pipermail/community/2007-September/010400.html B] 2.5G (Not EDGE), Bluetooth 2.0 EDR&lt;br /&gt;
 |Tri-band GSM 800 or 850/1800/1900, GPRS Class12/CS4/[http://lists.openmoko.org/pipermail/community/2007-September/010400.html B] 2.5G (Not EDGE), Bluetooth 2.0 EDR; WiFi: [http://lists.openmoko.org/pipermail/announce/2007-April/000012.html Atheros AR6K] (See also [[AR6K]]) (802.11 b/g)&lt;br /&gt;
 |-&lt;br /&gt;
 |Embedded devices&lt;br /&gt;
 |Assisted GPS, 2 buttons&lt;br /&gt;
 |Assisted GPS, 2 backlit buttons; 2x3D [[Accelerometer]]s&lt;br /&gt;
 |-&lt;br /&gt;
 |GPS Hardware&lt;br /&gt;
 |Global Locate (now Broadcom) Hammerhead&lt;br /&gt;
 |u-blox/Atmel ATR0635 [http://lists.openmoko.org/pipermail/community/2007-October/011013.html]&lt;br /&gt;
 |-&lt;br /&gt;
 |Sound&lt;br /&gt;
 |Built-in stereo speakers, stereo handset&lt;br /&gt;
 |Built-in mono speaker, stereo jack for output to headset/earphones&lt;br /&gt;
 |-&lt;br /&gt;
 |WiFi&lt;br /&gt;
 |no&lt;br /&gt;
 |yes&lt;br /&gt;
 |-&lt;br /&gt;
 |Accelerometer&lt;br /&gt;
 |no&lt;br /&gt;
 |yes&lt;br /&gt;
|-&lt;br /&gt;
 |Software&lt;br /&gt;
 |Extremely buggy. Most software needs to be added or made to work.&lt;br /&gt;
 |Basic PDA included. Software can be created by normal users.&lt;br /&gt;
 |-&lt;br /&gt;
 |Battery&lt;br /&gt;
 |Replaceable [[Neo1973_Battery|1200mAh battery]] charged via USB 1.1&lt;br /&gt;
 |Replaceable [[Neo1973_Battery|1200mAh battery]] charged via USB 1.1, or wall charger supplying 1000mA[http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=956]. Also has a coulomb counter for accurate charge reading[http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=957]&lt;br /&gt;
 |-&lt;br /&gt;
 |USB Host Support&lt;br /&gt;
 |Yes, but external +5V is required&lt;br /&gt;
 |Yes, powered port [http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000280.html]&lt;br /&gt;
 |-&lt;br /&gt;
 |Ready for use&lt;br /&gt;
 |Not really. [[Developer_preview|What to expect from the Developer preview GTA01]].&lt;br /&gt;
 |Yes, when released(!)&lt;br /&gt;
 |-&lt;br /&gt;
 |Price &amp;lt;br /&amp;gt; (not including shipping costs and applicable taxes for your country)&lt;br /&gt;
 |USD 300 (base model), USD 399 including additional development hardware. (All units are shipped from the U.S.)&lt;br /&gt;
 |USD 450 (base model), USD 600 including additional development hardware.&lt;br /&gt;
 |-&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
{{Languages|Neo1973: GTA01Bv4 versus GTA02 comparison}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Neo1973 Phase 1 related]]&lt;br /&gt;
[[Category:Neo1973 Phase 2 related]]&lt;br /&gt;
[[Category:Information]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_FreeRunner</id>
		<title>Neo FreeRunner</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_FreeRunner"/>
				<updated>2008-02-16T11:07:52Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: The name of the operating system should be from the capital letter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Neo FreeRunner (internal codename GTA02) is the second phone designed to run Openmoko software and is the direct descendant of the earlier [[FIC]] [[Neo1973]].    Hardware specs are [[Neo FreeRunner GTA02 Hardware|here]].&lt;br /&gt;
&lt;br /&gt;
=== Finding out status before FreeRunner is released ===&lt;br /&gt;
&lt;br /&gt;
To be emailed when it is released sign up to the announce mail list here http://lists.openmoko.org/mailman/listinfo/announce.    For frequently asked questions please check [[FAQ]].     Approximately, twice a month an Openmoko team member writes an update to the project here [[Community Updates]].&lt;br /&gt;
&lt;br /&gt;
No official launch date will be given until the phone is ready.&lt;br /&gt;
&lt;br /&gt;
=== Intended use and users ===&lt;br /&gt;
&lt;br /&gt;
The Neo FreeRunner is a Linux based touch screen smart phone aimed at general consumer use as well as Linux desktop users and Linux software developers.&lt;br /&gt;
&lt;br /&gt;
General phone users will appreciate the high spec and performance of the phone and the wide range of free and custom software packages that you are free to install to make the maximum use of the hardware for your particular needs.    Note that software tweaks and improvements will continue after launch as both the Openmoko team developers and the wider linux community work together.&lt;br /&gt;
&lt;br /&gt;
Linux users and software developers will appreciate the total freedom they have to use and design software for the FreeRunner&lt;br /&gt;
&lt;br /&gt;
=== What are the specs ===&lt;br /&gt;
&lt;br /&gt;
The specs share some features with the previous [[Neo1973]] such as&lt;br /&gt;
&lt;br /&gt;
* A very high resolution touch screen (1.7&amp;quot; x 2.27&amp;quot; - 43mm x 58mm) 480x640 pixels&lt;br /&gt;
* 128MB SDRAM memory to allow operation of many applications at once&lt;br /&gt;
* Internal GPS module for map and tracking programs&lt;br /&gt;
* Bluetooth for local data exchange&lt;br /&gt;
* Physical appearance will be the same as the Neo1973. See openmoko.com for more.&lt;br /&gt;
&lt;br /&gt;
but will gain the additional features of&lt;br /&gt;
&lt;br /&gt;
* 802.11 b/g WiFi for fast web browsing and data transfer&lt;br /&gt;
* A faster 400Mhz processor (up from 266MHz)&lt;br /&gt;
* A hardware Graphics Accelerator chip allowing fast graphics including video playback&lt;br /&gt;
* 2 accelerometers so that the phone can know its orientation for example switching to landscape mode automatically&lt;br /&gt;
* 2 LEDs illuminating the two buttons on the rim of the case&lt;br /&gt;
* Tri-band GSM and GPRS for North America (850/1800/1900 Mhz) and the rest of the world (900/1800/1900 Mhz)&lt;br /&gt;
* USB Host function with 100mA power allowing you to power USB devices for short periods (will drain the FreeRunner battery faster)&lt;br /&gt;
&lt;br /&gt;
A full list of the hardware specs and components of the Neo FreeRunner (internal codename GTA02xxx) can be found here [[Neo FreeRunner GTA02 Hardware]]&lt;br /&gt;
&lt;br /&gt;
A comparison between Neo 1973 and Neo FreeRunner is [[Neo1973: GTA01Bv4 versus GTA02 comparison|here]]&lt;br /&gt;
&lt;br /&gt;
=== What is the price? ===&lt;br /&gt;
&lt;br /&gt;
It will be available in two versions &lt;br /&gt;
* FreeRunner Base (for almost all users) and &lt;br /&gt;
* Freerunner Advanced (for some software developers).&lt;br /&gt;
Further details to follow&lt;br /&gt;
&lt;br /&gt;
We will sell this device through multiple channels. Direct from openmoko.com, the price will be $450 for the FreeRunner Base and $600 for the FreeRunner Advanced.&lt;br /&gt;
&lt;br /&gt;
[[Category:Neo1973 Phase 2 related| ]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Neo_FreeRunner</id>
		<title>Neo FreeRunner</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Neo_FreeRunner"/>
				<updated>2008-02-16T11:07:13Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Intended use and users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Neo FreeRunner (internal codename GTA02) is the second phone designed to run Openmoko software and is the direct descendant of the earlier [[FIC]] [[Neo1973]].    Hardware specs are [[Neo FreeRunner GTA02 Hardware|here]].&lt;br /&gt;
&lt;br /&gt;
=== Finding out status before FreeRunner is released ===&lt;br /&gt;
&lt;br /&gt;
To be emailed when it is released sign up to the announce mail list here http://lists.openmoko.org/mailman/listinfo/announce.    For frequently asked questions please check [[FAQ]].     Approximately, twice a month an Openmoko team member writes an update to the project here [[Community Updates]].&lt;br /&gt;
&lt;br /&gt;
No official launch date will be given until the phone is ready.&lt;br /&gt;
&lt;br /&gt;
=== Intended use and users ===&lt;br /&gt;
&lt;br /&gt;
The Neo FreeRunner is a Linux based touch screen smart phone aimed at general consumer use as well as linux desktop users and linux software developers.&lt;br /&gt;
&lt;br /&gt;
General phone users will appreciate the high spec and performance of the phone and the wide range of free and custom software packages that you are free to install to make the maximum use of the hardware for your particular needs.    Note that software tweaks and improvements will continue after launch as both the Openmoko team developers and the wider linux community work together.&lt;br /&gt;
&lt;br /&gt;
Linux users and software developers will appreciate the total freedom they have to use and design software for the FreeRunner&lt;br /&gt;
&lt;br /&gt;
=== What are the specs ===&lt;br /&gt;
&lt;br /&gt;
The specs share some features with the previous [[Neo1973]] such as&lt;br /&gt;
&lt;br /&gt;
* A very high resolution touch screen (1.7&amp;quot; x 2.27&amp;quot; - 43mm x 58mm) 480x640 pixels&lt;br /&gt;
* 128MB SDRAM memory to allow operation of many applications at once&lt;br /&gt;
* Internal GPS module for map and tracking programs&lt;br /&gt;
* Bluetooth for local data exchange&lt;br /&gt;
* Physical appearance will be the same as the Neo1973. See openmoko.com for more.&lt;br /&gt;
&lt;br /&gt;
but will gain the additional features of&lt;br /&gt;
&lt;br /&gt;
* 802.11 b/g WiFi for fast web browsing and data transfer&lt;br /&gt;
* A faster 400Mhz processor (up from 266MHz)&lt;br /&gt;
* A hardware Graphics Accelerator chip allowing fast graphics including video playback&lt;br /&gt;
* 2 accelerometers so that the phone can know its orientation for example switching to landscape mode automatically&lt;br /&gt;
* 2 LEDs illuminating the two buttons on the rim of the case&lt;br /&gt;
* Tri-band GSM and GPRS for North America (850/1800/1900 Mhz) and the rest of the world (900/1800/1900 Mhz)&lt;br /&gt;
* USB Host function with 100mA power allowing you to power USB devices for short periods (will drain the FreeRunner battery faster)&lt;br /&gt;
&lt;br /&gt;
A full list of the hardware specs and components of the Neo FreeRunner (internal codename GTA02xxx) can be found here [[Neo FreeRunner GTA02 Hardware]]&lt;br /&gt;
&lt;br /&gt;
A comparison between Neo 1973 and Neo FreeRunner is [[Neo1973: GTA01Bv4 versus GTA02 comparison|here]]&lt;br /&gt;
&lt;br /&gt;
=== What is the price? ===&lt;br /&gt;
&lt;br /&gt;
It will be available in two versions &lt;br /&gt;
* FreeRunner Base (for almost all users) and &lt;br /&gt;
* Freerunner Advanced (for some software developers).&lt;br /&gt;
Further details to follow&lt;br /&gt;
&lt;br /&gt;
We will sell this device through multiple channels. Direct from openmoko.com, the price will be $450 for the FreeRunner Base and $600 for the FreeRunner Advanced.&lt;br /&gt;
&lt;br /&gt;
[[Category:Neo1973 Phase 2 related| ]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Wish_List_-_Hardware</id>
		<title>Wish List - Hardware</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Wish_List_-_Hardware"/>
				<updated>2008-02-14T07:19:37Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Galileo/GLONASS/GPS receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details hardware features which some would like to go into future phones similar to the [[Neo1973]].&lt;br /&gt;
&lt;br /&gt;
Related pages are:&lt;br /&gt;
*[[Wishlist - Hardware - Novel Devices]] - openmoko will run on a large number of devices in the future, some of which may be DVD players, cameras, or convergance devices.  &lt;br /&gt;
*[[Wishlist:Unlikely]] - Hardware that is unlikely to appear in any OpenMoko device, due to it being impossible to fabricate with near-term technology, or for other reasons.&lt;br /&gt;
*[[Wishlist:Accessories]] - Accessories that people would like, that connect easily to the phone - initially primarily for the Neo1973 &lt;br /&gt;
*[[Wishlist:Expansion]] - add-ons to the phone, maybe involving hardware changes, and software and hardware protocols to implement these.&lt;br /&gt;
&lt;br /&gt;
This page is rather long. Before adding a new idea, please read through this page and the above pages, to make sure your idea has not been suggested before.&lt;br /&gt;
==Processor==&lt;br /&gt;
===A FPGA===&lt;br /&gt;
A FPGA is a general purpose reconfigurable logic device.&lt;br /&gt;
See [[Wish List - Hardware:FPGA]] for more details.&lt;br /&gt;
&lt;br /&gt;
===Samsung S3C2443===&lt;br /&gt;
*[http://www.samsung.com/global/business/semiconductor/productInfo.do?fmly_id=229&amp;amp;partnum=S3C2443&amp;amp;&amp;amp;ppmi=1427 Samsung S3C2443] Up to 533 MHz, can act as a USB 2.0 device.&lt;br /&gt;
&lt;br /&gt;
==Internal Memory==&lt;br /&gt;
===RAM===&lt;br /&gt;
128MB Dedicated for open files, running software etc., not for storage, or 256MB at all would be really nice and enough for any future software.&lt;br /&gt;
&lt;br /&gt;
===ROM===&lt;br /&gt;
Enough to Hold O/S and a fair number of applications and their settings. Persistent Storage with XIP capability. About 128 MB.&lt;br /&gt;
&lt;br /&gt;
===Storage===&lt;br /&gt;
An internal Micro SDHC should be used for users' files and additional software&lt;br /&gt;
&lt;br /&gt;
==Wireless data networking==&lt;br /&gt;
&lt;br /&gt;
===WiMAX support===&lt;br /&gt;
[http://en.wikipedia.org/wiki/Wimax WiMAX] is a high-speed data service, similar to wifi, though longer range and newer. Where service is available, this would complement WiFi. Unfortunately, unlike wifi, frequencies vary worldwide, so global usage may be complex. In South Korea, 2.3Ghz is available for WiMAX, known as WiBro. WiMAX Forum sets heart on 2.5 GHz for global use.&lt;br /&gt;
----&lt;br /&gt;
Two campuses of the University of California have just completed a deal with a WiMAX service provider to lease UC's ITFS/EBS spectrum to provide WiMAX in the SF Bay Area. Bidding was aggressive between Nextwave, Sprint-Nextel, and Clearwire. Other UC campuses have awarded other contracts throughout California to various of the three contenders. The point here is: these three companies are competing aggressively for spectrum in the 2.5-2.7 GHz range, and it's not limited to CA. At a National ITFS Association meeting in 2005, representatives from Intel said they would be ready to release a WiMAX chipset compatible with these frequencies in 2007, for inclusion in laptops. I assume the folks at [[FIC]] know much more about it that I do! Based on these and other clues, I think WiMAX is coming in the 2.5-2.7 GHz band in the near future... I'll be surprised if I do not see some offerings by early 2009. &lt;br /&gt;
&lt;br /&gt;
-[[User:Tzf|Tzf]] 21:54, 24 November 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LTE support===&lt;br /&gt;
[http://en.wikipedia.org/wiki/3GPP_Long_Term_Evolution Long Term Evolution (LTE)] is a high-speed data service, similar to WiMax, but designed to be more compatible with existing GSM systems.  While Sprint &amp;amp; Clearwire are currently testing WiMax deployment in the US, AT&amp;amp;T and Verizon appear to be in preference of LTE.&lt;br /&gt;
&lt;br /&gt;
While the project is ongoing and general in scope, it has set itself some specific goals, many of which are oriented around upgrading UMTS to a so-called fourth generation mobile communications technology, essentially a wireless broadband Internet system with voice and other services built on top.&lt;br /&gt;
&lt;br /&gt;
===Emerging Protocols===&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Near_Field_Communication Near Field Communication] has a few centimeter range, useable for keys, ID badges, pairing bluetooth devices and similar uses. Mentioned in newer bluetooth and SD standards. (No products.)&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ZigBee ZigBee] is designed for connecting sensors and switches in buildings, with many options including mesh networks and aggressive power saving compared to bluetooth. (Almost no products available.)&lt;br /&gt;
*The [http://en.wikipedia.org/wiki/ANT_%28network%29 ANT network] is for connecting worn devices. Similar to ZigBee, but much simpler and maybe lower power. ([http://www.thisisant.com/?section=9 Short list] of products.)&lt;br /&gt;
&lt;br /&gt;
==Camera==&lt;br /&gt;
&lt;br /&gt;
* A camera that can take reasonable quality video and pictures is something many want. Applications vary from simple snapping, to gesture interfaces, video conferencing, barcode reading, buisness card reading, healthcare, servicing, and more.&lt;br /&gt;
&lt;br /&gt;
* Some people can't take cameras into work - a model without the camera, or some way of removing the camera would be useful or leave the camera chip in place and have a removable lens assembly and replacement backcover.&lt;br /&gt;
*See [[Hardware:Neo1973:Alternate_Cases:Camera | Alternate Cases:Camera]] for phone casing suggestions.&lt;br /&gt;
&lt;br /&gt;
* See [[Wishlist:Camera]] for a more detailed wishlist.&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
===Multitouch screen===&lt;br /&gt;
&lt;br /&gt;
''Main article: [[Wishlist:Spell_weaving|Spell weaving]]''&lt;br /&gt;
&lt;br /&gt;
See also [http://pogue.blogs.nytimes.com/2007/03/27/the-multi-touch-screen/ this page] containing a link to a video demonstration.&lt;br /&gt;
&lt;br /&gt;
A history of multitouch implementations is [http://billbuxton.com/multitouchOverview.html here] ([http://google.com/search?q=cache:billbuxton.com/multitouchOverview.html google cache version])&lt;br /&gt;
&lt;br /&gt;
*Use examples: [http://www.youtube.com/watch?v=UcKqyn-gUbY&amp;amp;mode=related&amp;amp;search= Multi-touch interface (from Adobe TED)], [http://www.youtube.com/watch?v=1ftJhDBZqss&amp;amp;mode=related&amp;amp;search= Multi Touch (new touchscreen technology)]&lt;br /&gt;
&lt;br /&gt;
===Bigger and better screen===&lt;br /&gt;
2.8&amp;quot; widescreen (like in [http://etencorp.com E-ten] PDA/smartphones), or 3.5&amp;quot; widescreen (like in [http://www.expansys.ie/d.aspx?i=134944 Fujitsu Siemens LOOX N560]).&lt;br /&gt;
&lt;br /&gt;
262k or 16.7M colurs for displaying images and especially videos.&lt;br /&gt;
&lt;br /&gt;
OLED for better contrast, more rich colours, and less energy consumption.&lt;br /&gt;
&lt;br /&gt;
Maybe the [http://www.sharpsme.com/Page.aspx/europe/en/part/LS037V7DW01/ LS037V7DW01] by Sharp could be a solution. It has nearly the same specs as the currently used, but 3,7&amp;quot; -- [[User:Wedge | Wedge]]&lt;br /&gt;
&lt;br /&gt;
===Distance sensing touchscreen===&lt;br /&gt;
{{Main|Hardware:NearlyTouchScreen}}&lt;br /&gt;
TouchKo's (now Wacom Company Ltd.) spatial capacitive &amp;quot;touchscreen&amp;quot;, can sense fingers at a small distance, so you do not get your display greasy, and can unlike some touchscreens, be operated with gloves.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;s&amp;gt;Video acceleration&amp;lt;/s&amp;gt;===&lt;br /&gt;
Hardware acceleration for video playback and 2D/3D accelleration will be present in [[Neo1973 GTA02]].&lt;br /&gt;
&lt;br /&gt;
===EPD===&lt;br /&gt;
Or electronic paper display, EPD is used in many new devices such as the new Motorola motofone, sonys new e-reader and Irex's iliad. The technology provides thin, lightweight, power saving screens using new eink technology. This technology could cut the weight of the phone and its power usage. For more info see: [http://www.eink.com eink's website].&lt;br /&gt;
&lt;br /&gt;
Pro: laserprinter like quality, glossy, very stable image, easy on the eyes. Electronics are similar to TFT. Very low power consumption. &lt;br /&gt;
&lt;br /&gt;
Con: Black and grey only (like a newspaper, but glossy), although there were already color prototypes in 2005. low framerate (5fps). Can reflect light (like paper), backlight is impossible.&lt;br /&gt;
&lt;br /&gt;
===Transreflective===&lt;br /&gt;
It would be nice to have (the option of) a transreflective display, which while being less bright, is readable without needing to power the backlight. Then again, it depends on how much power the backlight uses compared to everything else...&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;Slightly&amp;quot; Larger Screen===&lt;br /&gt;
43mm x 57mm (2.8inch diagonal) is tiny.  A 53mm x 71mm (3.5 inch diagonal) like on the TD035STEE1 would be a nice improvement.  A widescreen format at about 53mm x 82.5mm instead of the 3:4 aspect ratio would be even cooler (if one could be found).&lt;br /&gt;
&lt;br /&gt;
===Second Display===&lt;br /&gt;
A 32x32 OLED display possibly on the back for camera framing or on an edge so it can be viewed like a pager.&lt;br /&gt;
This could be used to display any number of alerts (from any installed software) the alerts could have a dynamic prioritisation which means during the work day a message from the boss has high priority but lower at home (could be GPS/Time controlled?) multiple alerts shrink the icons to a 3x3 grid higher priority messages get more space.&lt;br /&gt;
&lt;br /&gt;
===Micro Projector===&lt;br /&gt;
[http://www.engadget.com/media/2006/02/digismartphone2.jpg Like the one shown here], new cellphones are now coming out with a small, low power projector. This can be used to show movies from your cell phone with 0.5m high image on a while wall for example...&lt;br /&gt;
&lt;br /&gt;
==Input devices==&lt;br /&gt;
&lt;br /&gt;
===No Dependence on Stylus===&lt;br /&gt;
The Neo's basic functionality should be completely usable without a stylus, Like the iPhone but with stylus use for precision work.&lt;br /&gt;
&lt;br /&gt;
===A laser projection keyboard===&lt;br /&gt;
Similar to [http://www.thinkgeek.com/computing/input/8193/ this], except the device would be integrated into the phone itself.  Setting the Neo up on a stand on a flat surface (perhaps a stand could be built into the back of the Neo itself, or into a case) would turn the Neo into a micro-laptop.  There may be several issues with the inclusion of this technology, including patents, the space required to project the laser grids, and the power consumption.  If possible, however, it would make text input a breeze.&lt;br /&gt;
&lt;br /&gt;
===Just a few more Buttons===&lt;br /&gt;
&lt;br /&gt;
2 buttons more, 3 buttons total, mounted sideways would be enough. You could use them for play/pause and loudness controll while the phone remains in your pocket (display locked, ...), reading mails, rss, ebooks,... without wasting display space and so on.&lt;br /&gt;
&lt;br /&gt;
With 5 buttons in total you could possibly emulate a keyboard (2^5 = 32 combinations) for those who know how to play a flute. Useable onehanded, not wasting display space and faster than t9. (It's not faster than T9 - I've used this system with the microwriter agenda --[[User:Speedevil|Speedevil]] 00:00, 2 July 2007 (CEST)) Hopefully this is not patented already.&lt;br /&gt;
&lt;br /&gt;
===D-Pad and Buttons===&lt;br /&gt;
*Adding a D-pad (to the bottom of the phone) and 2 to 4 buttons (to the top) would provide some tactile input controls, in addition to the touchscreen. They could be used as shortcut keys in the menu, or playback control when playing media. When the phone is held sideways, they can be used as games controls. (With touchscreen alone, gameplay options are limited)&lt;br /&gt;
&lt;br /&gt;
Game buttons would be best on both sides of the screen. The larger the buttons, the better. 2x 4 buttons in up-down-left-right configuration + some extra buttons separately a bit lower on the device would be good for many for emulation games. &lt;br /&gt;
&lt;br /&gt;
Here is a concept drawing of a possible neo1973 gaming version: &lt;br /&gt;
(This has a 4-way direction pad, 8 way may be better for gaming)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Neogame90.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Shoulder buttons would be a great addition, too. It would be interesting if there was a total 4 of them, one for every corner. It would make the phone very flexible for rotating and 2 to 6 players playing on one device.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
:''Note'' : The [http://en.wikipedia.org/wiki/Tapwave_Zodiac Tapwave Zodiac] Palm PDA / Game console hybrid had a similar setup - with an analog stick on the left (also used for quick selection using a radial main menu when working as a PDA), 4 buttons on the right (also configurable for shortcuts when using the device as PDA), and 2 shoulder buttons. Also it had and still has an enthusiastic scene of homebrew development (almost any console emulator for PalmOS can also take advantage of the additional buttons and graphic power of the device). If we also take into account the success encountered by the [http://en.wikipedia.org/wiki/GP32 GP32] in the past and the [http://en.wikipedia.org/wiki/GP2X GP2X] currently on the homebrew scene, it's not unreasonable to plan a future OpenMoko device with both a SmartPhone/PDA functionnality ''and'' hand-held console targeting homebrew development.&lt;br /&gt;
&lt;br /&gt;
===Thumb keyboard or keyboard attachment accessory===&lt;br /&gt;
*Could be slide out or clamshell (hinge on long side) design with an external OLED. The keyboard should be protected when not in use.&lt;br /&gt;
*Could be a clip on keyboard that attaches to the serial port or communicates by bluetooth (not preferred for permanent keyboard users).&lt;br /&gt;
*Cheap clippable miniusb keyboard&lt;br /&gt;
*One of the layouts proposed in [[Hardware:Keyboards]]&lt;br /&gt;
* What about virtual keyboard? [[http://www.extremetech.com/article2/0,3973,539778,00.asp Keyboard]]&lt;br /&gt;
&lt;br /&gt;
===Analogue Controllers===&lt;br /&gt;
&lt;br /&gt;
====Trackball====&lt;br /&gt;
A trackball would provide an efficient mouse-like interface in a very compact package.  As exemplified in the newer Blackberry&amp;amp;reg; models.&lt;br /&gt;
Maybe instead an optical sensor as are used in mice could be used so that the whole phone can be moved over a surface just like a mouse. (It could function as a Bluetooth mouse for other devices like laptop computers: see [[Bluetooth_Support#Acting_as_HID_device]]. Adding one other two-axis analogue input (possibly just the screen) would make the Neo usable as a TrackPoint or scroll-and-tilt mouse.) The same sensor might be usable as a barcode reader.&lt;br /&gt;
&lt;br /&gt;
====Analog Joystick====&lt;br /&gt;
A joystick, or [http://www.extremetech.com/article2/0,1697,1772689,00.asp Rollermouse]-like device would provide additional control, compared with touchscreen only.&lt;br /&gt;
*A standard [http://en.wikipedia.org/wiki/Pointing_stick pointing stick (ie. TrackPoint)] might serve well. As a fairly standard part, might they be quite inexpensive?&lt;br /&gt;
&lt;br /&gt;
====Dual analogues====&lt;br /&gt;
Dual analogue controllers (one trackball or joystick above, one below the screen, most likely) might even be feasible. That might be overkill since the accelerometers or touchscreen can be used to provide a second analogue input. But it would be nice to have four axes of analogue control without having to tilt the screen away from you or partly cover it with your hand.&lt;br /&gt;
&lt;br /&gt;
===TV/radio receiver===&lt;br /&gt;
[[Digital Television]], [[Digital Radio]] or even normal analogue TV/radio is widely available in the world, though unfortunately in various different forms. In markets where one standard is widespread, and hardware is suitable, it would be a great extension of the phone to a general entertainment device for when you're away from home. Multi standard devices would be ideal, but may not be small, low-power, or cheap.&lt;br /&gt;
A good start would be an FM tuner, since it's one of the most widely used formats of radio broadcasting in the world.&lt;br /&gt;
&lt;br /&gt;
Here's a selection of chips, though it's not clear if the drivers are open source. http://www.sigmatel.com/products/portable/wireless/fmtuner.aspx#fragment-14&lt;br /&gt;
http://www.st.com/stonline/products/families/automotive/am_fm_tuners.htm&lt;br /&gt;
&lt;br /&gt;
===Accelerometer=== &lt;br /&gt;
This enables the phone to sense which direction 'down' is, and to sense any movements the phone makes.&lt;br /&gt;
&lt;br /&gt;
See [[Accelerometer Fundamentals]] for more information on accelerometers as they may be used in phones.&lt;br /&gt;
&lt;br /&gt;
In some cases integrated gyroscopes may also be needed. A [[#Digital compass]] can even be of more use since it gives absolute rotation so slow rotations could also be measured. A 3D compass would be nicest, but a simple 2D compass already is a helpful addition to the accelerometers.&lt;br /&gt;
&lt;br /&gt;
*[[Wishlist:3D Viewport|3D Viewport]]&lt;br /&gt;
*[[Wishlist:Computer Mouse|Computer Mouse]]&lt;br /&gt;
*[[Wishlist:Determine Position|Determine Position]]&lt;br /&gt;
*[[Wishlist:Dynamic Screen Orientation|Dynamic Screen Orientation]]&lt;br /&gt;
*Change media player playlist when jogging vs walking. &lt;br /&gt;
*Attempt to use to stabilise any future camera.&lt;br /&gt;
&lt;br /&gt;
This feature is scheduled for inclusion in the phase 2 Neo1973, GTA02.&lt;br /&gt;
&lt;br /&gt;
===Side-Mounted Touch Strip===&lt;br /&gt;
Add a &amp;quot;touch strip&amp;quot; sensor onto the side of the phone which can be used to scroll. By having it on the side you can use your thumb to scroll comfortably while holding the phone one-handed. An 8-element capacitive sensor would work wonderfully and be easy to fab using either a Quantum QT411 (http://www.qprox.com/products/qslide_qt411.php) or Analog Devices AD7143 (http://www.analog.com/en/prod/0,2877,AD7143,00.html) controller. The Analog Devices chip seems better suited due to it's smaller allowable element size.&lt;br /&gt;
*With the AD7143 you can have an 8-element (128-position) 25mm long strip - Perfect!.&lt;br /&gt;
*With a few OLED screens beneath the strip it could be used as dynamic configurable buttons/alerts eg. zoom/flash/shutter with a camera application and SMS/Email/Voicemail alerts in standby&lt;br /&gt;
&lt;br /&gt;
===Heart Rate Compatibility=== &lt;br /&gt;
&lt;br /&gt;
An RF interface to receive data from popular heart rate straps (Polar, Garmin, Sigma, Suunto, etc.). This would go along well with the existing GPS functionality and possible future Accelerometer functionality to make for a full-blown workout tool.&lt;br /&gt;
&lt;br /&gt;
Software can be written to track heart rate along a running, cycling, skiing, swimming loop, to monitor max and min heart rate, to match heart rate data to GPS coordinates and print map data w/ relevant data.&lt;br /&gt;
&lt;br /&gt;
===Digital compass=== &lt;br /&gt;
A digital compass is useful for orienting maps to the terrain and other location/direction/orientation based applications (... is 300 meter that way) when the user is standing still (regardless of GPS reception) and for following a bearing when GPS reception is poor or speed is low. Also could be used to make the accelerometer data more exact.&lt;br /&gt;
&lt;br /&gt;
Very small [[I2C]] sensors like [http://www.ssec.honeywell.com/magnetic/hmc6352.html Honeywell's HMC6352 2-Axis Digital Integrated Compass] (6.5 x 6.5 x 1.5 mm) are very appropriate for this.&lt;br /&gt;
&lt;br /&gt;
*[[Wishlist:Auto Align Map]]&lt;br /&gt;
&lt;br /&gt;
See [[Wishlist - Hardware: Digital compass]] for more information&lt;br /&gt;
&lt;br /&gt;
===Thermometer===&lt;br /&gt;
An electronic thermometer might become handy for some users.&lt;br /&gt;
&lt;br /&gt;
There are very small [[I2C]] devices available, that could easily integrate to the existing bus. For example [http://focus.ti.com/docs/prod/folders/print/tmp100.html this one from ti].&lt;br /&gt;
(Could just be cheap and use the thermometer from the battery, thats how they did it in the nokia 5140's). Also is integrated in a barometer/altimeter like the SMD500 mentioned in [[Wish List - Hardware - Atmospheric]].&lt;br /&gt;
::But if you carry it in your pocket it is unlikely to show the correct air temperature anyway. [[User:AudriusA|AudriusA]] 17:12, 12 January 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
===Barometer and Variometer (Altimeter)===&lt;br /&gt;
&lt;br /&gt;
A Barometer measures air pressure. This can be used to give weather information, and also as a variometer, to sense relative altitude. Variometers are commonly used in flying microlight and ultralight aircraft, to get accurate relative altitude.&lt;br /&gt;
&lt;br /&gt;
These are also common on high end GPS units. This is a great feature for walkers as you can tell how far you have got on any ascent/decent.&lt;br /&gt;
&lt;br /&gt;
See [[Wish List - Hardware - Atmospheric]] for more information.&lt;br /&gt;
::The GPS device [[Manually using GPS|outputs the altidude]] as well. This has been tested and works fine. [[User:AudriusA|AudriusA]] 21:44, 7 February 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
===Finger print sensor===&lt;br /&gt;
A fingerprint sensor gives easy and fast access to the phone, could lock the touchscreen etc. An example of this device can be found at [http://www.sonystyle.com/is-bin/INTERSHOP.enfinity/eCS/Store/en/-/USD/SY_BrowseCatalog-Start?CategoryName=cpu_VAIONotebookComputers_UX_Series&amp;amp;Dept=computers Sony UX17].&lt;br /&gt;
&lt;br /&gt;
Most fingerprint sensors in the embedded market include a navigation mode, where they work similar to either a touch-stick or touch-pad of a laptop.&lt;br /&gt;
&lt;br /&gt;
===Barcode Scanner===&lt;br /&gt;
*less cpu intensive and more reliable than camera+ocr&lt;br /&gt;
*though, bluetooth-enabled readers are already available.&lt;br /&gt;
&lt;br /&gt;
===Light Sensor===&lt;br /&gt;
Ability to sense ambient light, and act accordingly. i.e if it's 3am and LightValue&amp;lt;.1 then Ring Quietly.&lt;br /&gt;
&lt;br /&gt;
===Wheel===&lt;br /&gt;
A navigation wheel like on a sony/ericsson 810i would be nice.&lt;br /&gt;
&lt;br /&gt;
===Proximity Sensor===&lt;br /&gt;
Switch off backlight when you place the phone to your ear. Prevent accidental activation of speakerphone or other sounds when the phone is near the ear (prevent hearing damage). Possibly switch the speakerphone on or off automatically depending on if the phone is by your head or not.&lt;br /&gt;
&lt;br /&gt;
=== Make ''all'' unlocking of phone, password protected===&lt;br /&gt;
&lt;br /&gt;
When my (current non-neophone) phone is in my pocket and I have it locked, it sometimes accidentally unlocks itself since only two keystrokes in the correct order are necessary to unlock it. When it's unlocked and still in my pocket it sometimes calls someone without my knowledge. All phones I've seen today have a press-just-one-button bypass to answer an incoming call even when the phone is locked. I suggest making the locking mechanism let the user configure it so that the user has to enter a password even for answering incoming calls. The likeliness of the phone accidentally runbbing against my car keys, hitting a ten character long password, unlocking the phone without my knowledge and consent is low enough even for us most unlucky users.&lt;br /&gt;
&lt;br /&gt;
==Expansion==&lt;br /&gt;
===Positioning of Buttons, Connections and ports===&lt;br /&gt;
&lt;br /&gt;
Ideally any cable ports such as charging, USB, audio, docking should not get in the way of your hand or fingers when holding it in it's normal orientation. For the sake of SDIO cards an external SD slot should be on the top edge. IR for remote control software and ease of inter-device communication should be on the corner so that it is facing away from you for both orientations. Buttons obviously are positioned for finger control. An example of how '''not''' to do this would be the HTC Universal&lt;br /&gt;
&lt;br /&gt;
===Storage===&lt;br /&gt;
&lt;br /&gt;
====MMC/SD/SDIO slot (rather than?) miniSD or microSD====&lt;br /&gt;
*Cheaper, more durable cards in a widely accepted format.&lt;br /&gt;
*Much much larger storage capacity, [http://blog.scifi.com/tech/archives/2007/08/23/toshiba_unleash_1.html even 32GB]&lt;br /&gt;
*Cards are harder to lose&lt;br /&gt;
*Wider selection of accessories, including SDIO accessories.&lt;br /&gt;
*Make externally available so that larger length SDIO cards can be used (thinking about SDIO WLAN here)&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Secure_Digital_card#SDHC SDHC] compatible. It seems to already have the right hardware for it - see [[Neo1973_Hardware#microSD-Card]].&lt;br /&gt;
&lt;br /&gt;
====Two SD slots====&lt;br /&gt;
*Micro SDHC for /home partition. Keep like current design underneath SIM card&lt;br /&gt;
*Hot swappable externally accessible normal size SDHC/SDIO slot&lt;br /&gt;
&lt;br /&gt;
=== Internal Communication Bus ===&lt;br /&gt;
*A standard and/or documented internal communication bus of some sort could simplify adding new hardware modules.&lt;br /&gt;
*Serial USB or I2C connector internal to case towards the top&lt;br /&gt;
*Several digital I/O pins that operate at TTL levels&lt;br /&gt;
*A few analogue I/O pins attached to a A/D converter&lt;br /&gt;
*Documentation of Debug board connector could provide some of this functionality.&lt;br /&gt;
&lt;br /&gt;
I2C is used on the Neo with some details of resources already in use documented!&lt;br /&gt;
Please see [[I2C | Neo I2C Devices]] for more information &amp;amp; a list of devices &amp;amp; the addresses currently in use &amp;amp; documented for the Neo1973.&lt;br /&gt;
&lt;br /&gt;
===Local Communication===&lt;br /&gt;
&lt;br /&gt;
====USB====&lt;br /&gt;
* 5V Powered, to avoid having to carry around a hub for when you want to occasionally plug in a memory stick. Many powered hubs will not recognize a totally unpowered host. Provide a maximum current to drive a basic USB keyboard/memory stick/mouse/webcam/astrowebcam. This could be done by adding a small cheap power converter like the [http://www.national.com/pf/LM/LM2753.html LM2753]&lt;br /&gt;
* USB 2.0 &lt;br /&gt;
* Standard type A socket for quick &amp;amp; easy insertion of memory sticks etc.&lt;br /&gt;
* OTG, to be able connect usb keyboard like [http://www.mobile-review.com/pda/review/cherry-kb-en.shtml Cherry G84-4321 SUNRG]&lt;br /&gt;
* Bootable USB device emulation: the possibility to boot any computer on a bootable flagged partition of the transflash.&lt;br /&gt;
* Protection against incorrectly wired USB ports: some USB ports are wired incorrectly; if the +5V and GND are swapped, the device would get -5V when it's expecting +5V, which could burn some chips. A reverse-biased diode between +5V and GND, D+ and GND, D- and GND, and (if used) ID and GND, with a low enough forward voltage drop (to limite the negative voltages to what the chips can withstand), would protect the device by tripping the port's short circuit protection.&lt;br /&gt;
&lt;br /&gt;
====Wireless USB support====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Wireless_USB Wireless USB] is the wireless version of USB offering data-rates up to 480 Mbit/s over short distances (&amp;lt;3 meter). Chipsets suitable for a phone are likely to take some time to be available.&lt;br /&gt;
&lt;br /&gt;
====SIR/FIR transceiver (Serial Infrared) / IR remote control====&lt;br /&gt;
*An infrared transceiver is cheap, small, and useful for sync with many laptops and mobile phones. &lt;br /&gt;
*Replace/emulate all IR-based remote controls used for your tv, vcr, etc on your neo cell phone.&lt;br /&gt;
** replaces multiple 'dumb' devices with a single intelligent device (your neo) that you will probably carry with you at all times anyway. &lt;br /&gt;
**Command sets should be retrieved from a database or learned from other less intelligent remote control devices with macros. &lt;br /&gt;
**reduces clutter, particularly in the living room.&lt;br /&gt;
**inceases the neo's practical status as an 'always-have' device. &lt;br /&gt;
&lt;br /&gt;
Other uses.&lt;br /&gt;
*Detecting reflections from inside of a caddy, and switching from active mode.&lt;br /&gt;
*FIR would be a nice option, as it's some 40 times faster than SIR.&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
&lt;br /&gt;
====Video Out====&lt;br /&gt;
*Through a docking port&lt;br /&gt;
**S-Video/Composite Out&lt;br /&gt;
**DVI Out&lt;br /&gt;
**HDMI Out&lt;br /&gt;
**Display Port&lt;br /&gt;
&lt;br /&gt;
==Output devices==&lt;br /&gt;
&lt;br /&gt;
===LED===&lt;br /&gt;
*The Neo1973 GTA02 will have LEDs of some sort behind at least one button. [http://lists.openmoko.org/pipermail/community/2007-July/008458.html]&lt;br /&gt;
*A blinking LED would be a cheap, low power way to inform the user of new SMS/Email....&lt;br /&gt;
**An alternative to this would be for one small part of the LCD to be separately backlit.&lt;br /&gt;
**This requires the CPU and LCD to be somewhat active, to keep the LCD refreshed, but gives much more information.&lt;br /&gt;
**A Small OLED Screen could be used and display much more information than a LED with minimal power usage.&lt;br /&gt;
&lt;br /&gt;
*For example a multicolor LED which pulses yellow for GSM/GPRS transmit, blue for Bluetooth/Wifi, green to indicate non-urgent information - missed call etc, red to indicate battery low or other urgent notices.&lt;br /&gt;
&lt;br /&gt;
**The LED and button ideas could be combined: illuminated buttons.&lt;br /&gt;
**It must be possible to completely disable the LED to save power or other personal preferences.&lt;br /&gt;
&lt;br /&gt;
=== Flashlight ===&lt;br /&gt;
For finding keys, or any other application. May also optionally pulse in time with ring, to make phone more visible.&lt;br /&gt;
This is really well done in Nokia 5500.&lt;br /&gt;
&lt;br /&gt;
-I second this one. The most used feature in my Nokia 5140 after the calling and sms features is the flashlight. It's just one simple LED, but powerful enough to see with if it's really dark. If it ain't dark, you won't need the light anyway. :)&lt;br /&gt;
&lt;br /&gt;
Also, Who hasn't lost their keys and opened up their cell phone to use as a flashlight?&lt;br /&gt;
&lt;br /&gt;
=== FM transmitter ===&lt;br /&gt;
Small FM transmitter to output to car, and other nearby radios.&lt;br /&gt;
&lt;br /&gt;
Fix the biggest flaw in the iPod before Apple does!&lt;br /&gt;
&lt;br /&gt;
=== Infrared Transmitter w/ universal remote software ===&lt;br /&gt;
Infrared LED on top of device with universal remote software so you can control televisions, DVDs etc.&lt;br /&gt;
[http://www.novii.tv/ Here] is an example of universal remote software.&lt;br /&gt;
&lt;br /&gt;
:I'd like to add that i fully support this. An IR port on future openmoko devices capable of controlling set-top boxes like TV/DVD/Stereo is necessary to make the device as universal as possible. A cellphone should be your window to the world and allow you to interact with it in as many ways as possible.&lt;br /&gt;
&lt;br /&gt;
:Care must be taken to use the correct type of IR chipset/controller in the phone. Most IR ports you find on devices like computers, some cellphones etc. Are for high speed data communication and CAN'T control TVs/DVDplayers/Stereos etc.&lt;br /&gt;
&lt;br /&gt;
:In order to reduce cost it maybe possible to use the sound chipset in the phone to generate the waveform sent to the IR led. IR remotes work at ~38Khz which is within the range of the sound chipset. The sound output could be internally switched between the IR led or the speakers.&lt;br /&gt;
&lt;br /&gt;
===HAC Compliance===&lt;br /&gt;
[http://quux.wiki.zoho.com/WhereAreHACphones.html Here] is some summary/discussion of how hearing aid compliance rules work in the US. Specifically it would be nice to see the phone include a [http://www.hearingresearch.org/Dr.Ross/telecoil_and_telephones.htm telecoil], which allows the phone to connect wirelessly to many standard hearing aids.&lt;br /&gt;
&lt;br /&gt;
==Mobile Communication options==&lt;br /&gt;
&lt;br /&gt;
===Generic Access Network / Unlicensed Mobile Access===&lt;br /&gt;
This technology requires cooperation from the cellular provider, but [http://en.wikipedia.org/wiki/Unlicensed_Mobile_Access UMA/GAN] is already offered by T-Mobile in the United States, and perhaps others in other countries.  Allowing the user to roam from GSM to wifi, this technology can save the end user a significant amount of money, and also allow the user to deploy coverage where there was none before.  There are only a few UMA capable phones currently, but it would be great if this could be made to work on a phase 2 type OpenMoko device.&lt;br /&gt;
&lt;br /&gt;
Note that this features requires more advanced access to the GSM modem. &lt;br /&gt;
Special messages needs to be exchanged with the network.&lt;br /&gt;
&lt;br /&gt;
===Faster/better mobile connectivity.===&lt;br /&gt;
[http://en.wikipedia.org/wiki/Gsm GSM]/[http://en.wikipedia.org/wiki/GPRS GPRS] is at best slow. An incremental improvement would be a radio with [http://en.wikipedia.org/wiki/EDGE EDGE ] support. EDGE is an evolved GSM standard and, like GPRS, it operates on the same frequency as voice. This means a quad-band EDGE radio will have near-complete worldwide coverage. &lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/UMTS UMTS] - which is widespread in Europe and being deployed in the US, [http://en.wikipedia.org/wiki/HSDPA HSDPA] (asia) and any other mobile standards would be nice for faster data connectivity and coverage.&lt;br /&gt;
It is unlikely that all of these will be supported initially, but it is a goal. These faster standards operate in different frequencies from GSM/GPRS/EDGE. Which frequency exactly will depend on the carrier and country. For UMTS in the US, AT&amp;amp;T uses 850/1900 MHz but T-Mobile will use 2100/1700 MHz for example.&lt;br /&gt;
&lt;br /&gt;
Until that goal is reached, it is likely that some phones will be brought out for various specific markets - Europe, Asia, US.&lt;br /&gt;
&lt;br /&gt;
===Ability to use multiple SIMs/networks===&lt;br /&gt;
* External SIM sockets are widely available in China, a dual external socket would be a very good solution.&lt;br /&gt;
* [http://www.fonefunshop.co.uk/dualsim/digital.htm Dual SIM card kit] - two SIMs are trimmed and combined, software supportwould be needed, and both can't be used at once...&lt;br /&gt;
* Some networks support multiple numbers on one SIM. Unfortunately this won't allow split networks.&lt;br /&gt;
* A second/dual GSM module would allow full use of both sims at all times.&lt;br /&gt;
* As a hack, [http://wiki.openmoko.org/wiki/Wish_List#Bluetooth_powered_Multi-SIM_support use another mobile via BT].&lt;br /&gt;
** As many as three SIM slots would be genuinely useful, especially for a 3G phone - some 3G data tariffs are only available on data-only SIMs. A user could quite reasonably have one SIM for data, once SIM for his personal voice calls, and a third SIM for his business number.&lt;br /&gt;
* Dual SIM card support will be especially welcome by the women. They just love to talk on the phone.&lt;br /&gt;
&lt;br /&gt;
===PMR446/FRS Radio===&lt;br /&gt;
* Include a PMR/FRS Radio.&lt;br /&gt;
* A two-way walkie talkie lets you use the phone to communicate with friends without requiring a GSM connection (crowded networks at festivals, at locations with no GSM coverage).&lt;br /&gt;
&lt;br /&gt;
===[[DECT]]===&lt;br /&gt;
* Include a [[DECT]] GAP/CAT-iq transceiver so you can use your home and/or office PSTN line&lt;br /&gt;
** Ability to use Alcatel phonebook stuff (like provided by the eventphone.de phone equipment) would be very nice too&lt;br /&gt;
&lt;br /&gt;
===[[SIP phone]]===&lt;br /&gt;
Make stripped down (and thus cheaper) version of the Neo1973 phone for use as a SIP phone. Remove GPS, GSM, accelerometers, stylus.&lt;br /&gt;
&lt;br /&gt;
Addition of an centimeters-precise location system [http://en.wikipedia.org/wiki/Real_Time_Location_Systems RTLS] would be nice, as it will allow highly sensible indoor context detection. Imagine putting the phone next to your mirror (where you shave daily) and watch it automatically switch to news radio channel. Or put it next to your bed and see it automatically switch to &amp;quot;sleeping&amp;quot; mode, when only calls from predefined numbers are accepted.&lt;br /&gt;
&lt;br /&gt;
=='''Casing'''==&lt;br /&gt;
See also: [[Alternate Neo1973 case designs]] for a list of cases being considered for design/manufacture by the community.&lt;br /&gt;
&lt;br /&gt;
=== [[Hardware:Neo1973:Alternate_Cases:Expansion_Module_Casing | Expansion Module Casing]] ===&lt;br /&gt;
Longer case (150-160mm+) with space in the top to put expansion modules, including test &amp;amp; hobby hardware.  Would require use of a standard internal power &amp;amp; communications bus. Could be left empty with blank cover or house cameras, solar panels, a crank powered charger, special transmitters/recievers, or anything else imaginable.&lt;br /&gt;
&lt;br /&gt;
[http://www.likeasecret.com/Neo1973/Neo1973-Exp.mov Neo1973 Expansion Module Quicktime rendering]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Image:Neo1973-Exp.png]]&lt;br /&gt;
&lt;br /&gt;
=== Expansion Back Casing ===&lt;br /&gt;
Replacement backs with additional features ranging from solar power, larger batteries, extra hardware, ...&lt;br /&gt;
&lt;br /&gt;
===[[Hardware:Neo1973:Alternate_Cases:Expansion_Front_Casing|Expansion Front Casing]]===&lt;br /&gt;
Replacement fronts with e.g. extra buttons.&lt;br /&gt;
&lt;br /&gt;
=== Space efficient Lanyard ===&lt;br /&gt;
The hole at the bottom of the phone takes a lot of space. A [http://en.wikipedia.org/wiki/Kensington_Security_Slot Kensington Security Slot] could be used instead.&lt;br /&gt;
&lt;br /&gt;
=== Rugged version ===&lt;br /&gt;
We need something you can drop from 4 feet in to a puddle of dirty water on construction site. Sunlight readable display, maybe aluminium case. The big ugly pseudo military version.&lt;br /&gt;
&lt;br /&gt;
=== Transparent ===&lt;br /&gt;
Make a transparent, see-through casing. Why do we need a closed casing for open hardware and open software? Show the world it is a truly Free/Open source phone.&lt;br /&gt;
&lt;br /&gt;
That makes sense to me. I second that idea!&lt;br /&gt;
&lt;br /&gt;
=== Blank ===&lt;br /&gt;
Even though the transparent case would work too, I would like to see a blank case of pure black or white so people could have the option of air-brushing,painting or even drawing on the case.&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
===Galileo/GLONASS/GPS receiver===&lt;br /&gt;
*A multi-standard satellite positioning module would be nice eventually, it does not seem to be near-term due to chipset availability problems. Galileo is the to be launched (2011) European positioning system. GLONASS is the already existing Russian one.&lt;br /&gt;
&lt;br /&gt;
=== GPS antena ===&lt;br /&gt;
The current GPS device seems even dependent on weather and may not work in heavy rain or snow. It seems necessary to think how to improve the reliability. The small portable GPS antena may be an option.&lt;br /&gt;
&lt;br /&gt;
===X10 RF Remote===&lt;br /&gt;
Many PC-based media centers are being equipped with an RF (433 MHz) / X10-based remote control. The [http://en.wikipedia.org/wiki/X10_(industry_standard) X10] protocol also facilitates home automation to control lamps, switches, etc.&lt;br /&gt;
The advantages of using RF for control instead of Infra-red this that it also works when furniture, walls, or doors are blocking the path between RF remote and the equipment or device. [http://www.lirc.org/ Lirc] supports X10-based RF remotes (but expects having an USB RF receiver attached to the media center).&lt;br /&gt;
&lt;br /&gt;
===RFID tag/RFID Reader===&lt;br /&gt;
* Implementation/Cooperation with: [http://www.rfidguardian.org/ RFID-Guardian]&lt;br /&gt;
*An enable-able tag would be of use - for example being able to use the phone to open doors, or cars. Unfortunately, it's moderately hard to do secure programmable tags that are compatible with existing systems, for obvious reasons.&lt;br /&gt;
* Say you have RFID tags on your personal belongings: cellphone, keys... Neo could be programmed to remember the last recorded GPS location before it lost contact with the respective RFIDs. It'd be trivial to check where you left your cellphone, get directions from a map...or beep when the phone gets out of RFID range.&lt;br /&gt;
&lt;br /&gt;
*I agree with this idea, a great idea and you have to do it (Jackcday)&lt;br /&gt;
&lt;br /&gt;
===NFC chip===&lt;br /&gt;
*A Near Field Communication chip, with this chip it will be possible to pay with your phone (like a credit card)in the near future, see [http://www.nokia.com/A4305081 Nokia]for details&lt;br /&gt;
*NXP is a chip fabricator which provides NFC chips [http://nxp.com NXP] direct link&amp;gt;&amp;gt; www.nxp.com/#/pip/cb=[type=product,path=/53420/53424]|pip=[pfp=53424][0] their chips also support the above RFID reading&lt;br /&gt;
&lt;br /&gt;
===Less weight===&lt;br /&gt;
* Work on the weight of the Neo1973 and following devices. At the present time the Neo1973 is just a moderate / normal business or multimedia phone. The ordinary &amp;quot;user&amp;quot; may want something lighter. Take a look at the following table, that's the Neo1973 compared with other common bussiness or multimedia phones.&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
| Neo1973 || Fujitsu-Siemens LOOX N560 || E-Ten Glofiish X500+ || Sony Ericsson P990i || iPhone || Nokia E65 &lt;br /&gt;
|- &lt;br /&gt;
|  184 g  ||            160 g          ||         146 g        ||        150 g        ||  135 g ||   115 g   &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Make it smaller===&lt;br /&gt;
* To stay within physical matters: Maybe the Neo1973 is also just a normal business/multimedia phone when looking at the size. It would be great the shrink it a bit. Especially the thickness of 18.5 mm could be worked on!&lt;br /&gt;
&lt;br /&gt;
===Standard 3.5mm headphone jack===&lt;br /&gt;
The Neo1973 uses a 4-conductor 2.5mm jack for stereo headphones and a microphone. A 2.5mm jack is the most common for headsets. &lt;br /&gt;
&lt;br /&gt;
There is an emerging convention used in the Nokia N800 and some other devices. A 4-conductor 3.5mm jack that can use a microphone with special headsets, but can also be used with off-the-shelf 3.5mm stereo headphones. Adapters to 2.5mm are of course available and this 3.5mm jack is much more robust.&lt;br /&gt;
&lt;br /&gt;
Neglecting space limitations, multiple sockets - 2.5mm and 3.5mm would be nice. Probably not practical in a phone. Other expanded plugs might allow remote controls.&lt;br /&gt;
&lt;br /&gt;
Other uses might be better met using bluetooth, or USB audio.&lt;br /&gt;
&lt;br /&gt;
===Laser Pointer===&lt;br /&gt;
Include a built in laser pointer.  Everything is better with lasers.&lt;br /&gt;
&lt;br /&gt;
===Completely free hardware===&lt;br /&gt;
Consider selling one device with absolutely no non-free components in it, even if that means dropping the GSM support.  I believe having one such device available would be good, because then it could be recommended by organizations like the FSF which typically never recommends anything if it has even a little non-free code in it.&lt;br /&gt;
&lt;br /&gt;
=== Consider economy / inexpensive / less featured edition ===&lt;br /&gt;
Some people want less features, because they do not need them. Leaving out some features either lets the phone get smaller or possibly enhances battery live.&lt;br /&gt;
&lt;br /&gt;
One big suggestion in this area is a b/w lower res display instead of the big color display.&lt;br /&gt;
&lt;br /&gt;
=== Inductive Charger ===&lt;br /&gt;
&lt;br /&gt;
It would be nice if it was possible to charge the phone without having to connect a cable. I'd like to have a simple docking station with an inductive charger like the type that's used for electric toothbrushes [http://home.howstuffworks.com/question292.htm ]. The charger itself could get its power from a standard wall-wart power supply, or it could be USB/Firewire powered.&lt;br /&gt;
&lt;br /&gt;
=== Solarpanel/dynamo Charger===&lt;br /&gt;
&lt;br /&gt;
It would be very nice to be able to charge the phone outside of the electric grid (for example on hikes and boating trips). A combined solarpanel and muscle empowered (rotational etc.) charger would do the trick nicely.&lt;br /&gt;
&lt;br /&gt;
'''some mobile Solarpanels'''&lt;br /&gt;
 	&lt;br /&gt;
[http://www.globetrotter.de/de/shop/detail.php?mod_nr=off01011&amp;amp;k_id=1400&amp;amp;hot=0 Off-Grid Systems Sunbag L]&lt;br /&gt;
&lt;br /&gt;
[http://www.globetrotter.de/de/shop/detail.php?mod_nr=off01001&amp;amp;k_id=1400&amp;amp;hot=0 Off-Grid Systems Sunbag S]&lt;br /&gt;
&lt;br /&gt;
[http://www.globetrotter.de/de/shop/detail.php?mod_nr=sv_01011&amp;amp;k_id=1400&amp;amp;hot=0 Silva Solar I]&lt;br /&gt;
&lt;br /&gt;
[http://www.globetrotter.de/de/shop/detail.php?mod_nr=sv_01012&amp;amp;k_id=1400&amp;amp;hot=0 Silva Solar II]&lt;br /&gt;
&lt;br /&gt;
[http://www.globetrotter.de/de/shop/detail.php?mod_nr=sol01011&amp;amp;k_id=1400&amp;amp;hot=0 Solarc e-Go Professional]&lt;br /&gt;
&lt;br /&gt;
[http://www.heise.de/mobil/suche/ergebnis?rm=result;q=solar;url=/mobil/artikel/74142/;words=solar Solarc e-Go *] &lt;br /&gt;
&lt;br /&gt;
[http://www.heise.de/newsticker/suche/ergebnis?rm=result;words=Solar%20solar;q=solar;url=/newsticker/meldung/91536/ Solar JKT]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- I think a dynamo charger (&amp;quot;share charger&amp;quot;, rotational, ...) would be more practical as a peripheral, connected through the USB-interface using the same principle cellphones now charge when connected to an USB-port. You could very easily hack this together. [http://www.metacafe.com/watch/449950/hack_a_flashlight_to_power_your/ flashligh recharge hack]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Random thought; Why not create some merchandise toys with a small lithium battery which charge through centrifugal force allowing to recharge the phone with a small &amp;quot;general&amp;quot; connector.&lt;br /&gt;
&lt;br /&gt;
[http://www.heise.de/mobil/artikel/61368/0 Article about aome mobile power-sources]&lt;br /&gt;
&lt;br /&gt;
=== Plastic Solar/Back side on the Neo===&lt;br /&gt;
&lt;br /&gt;
Sollar cells from Plastic, on the reverse side of the Neo 1973&lt;br /&gt;
modified and intergreated in the batery backcover/flap,&lt;br /&gt;
like an energy source when the display is in standby mode.&lt;br /&gt;
Thats can be use also as alternate charge method's and also helps in emergency.&lt;br /&gt;
&lt;br /&gt;
==Related Hardware==&lt;br /&gt;
See [[Related Hardware]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware ideas| ]]&lt;br /&gt;
[[Category:User]]&lt;/div&gt;</summary>
		<author><name>AudriusA</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>2008-02-09T12:19:22Z</updated>
		
		<summary type="html">&lt;p&gt;AudriusA: /* Red Hat or similar */  + tested with&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Neo1973 side =&lt;br /&gt;
&lt;br /&gt;
== Name resolution ==&lt;br /&gt;
&lt;br /&gt;
By default Neo1973 has usb0 interface working due to Ethernet gadget (g_ether) compiled into kernel.&lt;br /&gt;
&lt;br /&gt;
On the Neo, if you want to reach out to the internets using full qualified hostnames, you need to define your DNS server. Create a file /etc/resolv.conf with at least one line saying&lt;br /&gt;
&lt;br /&gt;
 nameserver xxx.xxx.xxx.xxx&lt;br /&gt;
&lt;br /&gt;
e.g. nameserver 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
Then you can also easily update your 2007.2 OpenMoko packages with &amp;quot;ipkg update &amp;amp;&amp;amp; ipkg upgrade&amp;quot; on the Neo.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A better approach is it edit: /etc/network/interfaces and modify the line:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
up echo nameserver 192.168.0.200 &amp;gt;/etc/resolv.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
to specify your preferred DNS server instead of 192.168.0.200.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
example:  &amp;lt;code&amp;gt;up echo nameserver 4.2.2.2 &amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another approach is to symlink  (NOW OBSOLETE?)&lt;br /&gt;
&lt;br /&gt;
 ln -s /var/run/resolv.conf /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
and fill the file at bootup with a script /etc/network/if-up.d/08setupdns containing:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh -e&lt;br /&gt;
 echo  nameserver 192.168.0.200 &amp;gt; /var/run/resolv.conf&lt;br /&gt;
&lt;br /&gt;
this way the file is correctly handled from ppp package when dialing into gprs.&lt;br /&gt;
&lt;br /&gt;
== Routing ==&lt;br /&gt;
&lt;br /&gt;
You need a additional route for traffic to the internet. This traffic can be routed through your pc (see below) if the pc is the default route destination. you can achieve this by adding&lt;br /&gt;
&lt;br /&gt;
 gateway 192.168.0.200&lt;br /&gt;
&lt;br /&gt;
to your /etc/network/interfaces in the usb0 section.&lt;br /&gt;
&lt;br /&gt;
= Desktop side =&lt;br /&gt;
&lt;br /&gt;
== Manual method ==&lt;br /&gt;
&lt;br /&gt;
With the device connected, modprobe usbnet module and configure usb0 interface (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ifconfig usb0 192.168.0.200 netmask 255.255.255.0&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;
&lt;br /&gt;
1. ping the Neo with&lt;br /&gt;
 # ping -I usb0 192.168.0.202&lt;br /&gt;
2. add a route to your Neo:&lt;br /&gt;
 # /sbin/route add -host 192.168.0.202/32 dev usb0&lt;br /&gt;
3 log in to the Neo&lt;br /&gt;
 # ssh root@192.168.0.202&lt;br /&gt;
&lt;br /&gt;
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:&lt;br /&gt;
* CONFIG_USB_USBNET&lt;br /&gt;
* CONFIG_USB_NET_CDCETHER&lt;br /&gt;
Both options are available in the Device Drivers -&amp;gt; USB support -&amp;gt; USB Network Adapters. For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].&lt;br /&gt;
&lt;br /&gt;
== Automatic method ==&lt;br /&gt;
&lt;br /&gt;
Took from [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] post by Marcin 'Hrw' Juszkiewicz.&lt;br /&gt;
&lt;br /&gt;
=== Debian or similar ===&lt;br /&gt;
Edit /etc/network/interfaces:&lt;br /&gt;
&amp;lt;pre&amp;gt;&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;
        network 192.168.0.0&lt;br /&gt;
        post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24&lt;br /&gt;
        post-up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
        post-up iptables -P FORWARD ACCEPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu (Tested with Feisty and Gutsy) ===&lt;br /&gt;
Edit /etc/network/interfaces:&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.0.200&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.0.0&lt;br /&gt;
        up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
        up echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &amp;amp;&lt;br /&gt;
        up iptables -P FORWARD ACCEPT &amp;amp;&lt;br /&gt;
        down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are doing the echo 1 &amp;gt; /proc/... command manually, sudo may not be enough, then you will have to execute it from a sudo bash.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Feisty and Gutsy appear to have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.&lt;br /&gt;
One can patch /etc/udev/rules.d/85-ifupdown.rules, editing the two lines at the end of the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SUBSYSTEM==&amp;quot;net&amp;quot;, DRIVERS==&amp;quot;?*&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;,          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;
&lt;br /&gt;
LABEL=&amp;quot;net_end&amp;quot;&lt;br /&gt;
&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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the bug is that the LABEL=&amp;quot;net_end&amp;quot; is at the wrong position&lt;br /&gt;
=== SuSE ===&lt;br /&gt;
/etc/sysconfig/network/ifcfg-usb0&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;
=== Fedora (Tested with FC8) ===&lt;br /&gt;
/etc/sysconfig/network-scripts/ifcfg-usb0&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# USB configuration for PDAs (openmoko)&lt;br /&gt;
# from http://www.handhelds.org/moin/moin.cgi/UsbNet&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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat or similar (tested with Workstation 5) ===&lt;br /&gt;
Edit /etc/sysconfig/network-scripts/net.hotplug:&lt;br /&gt;
&lt;br /&gt;
After this command&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;
add&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;
* Open /etc/conf.d/net and add:&lt;br /&gt;
 # Neo1973&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;
* Create a new init script:&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 ln -s net.lo net.usb0&lt;br /&gt;
* Put iptables into use:&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;
* Store them&lt;br /&gt;
 /etc/init.d/iptables save&lt;br /&gt;
* If you want the routing by default:&lt;br /&gt;
 rc-update add iptables default&lt;br /&gt;
* You must also inform the kernel, to start forwarding.  One way to automate this is to create /etc/conf.d/net.usb0 as follows&lt;br /&gt;
 &lt;br /&gt;
 preup() {&lt;br /&gt;
        echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&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;
        return 0&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This way, packet forwarding will be turned on when Neo is plugged in, and off when it's not.&lt;br /&gt;
&lt;br /&gt;
=== MacOS X ===&lt;br /&gt;
See the [[MacOS_X#USB_Networking|USB Networking section in the MacOS X article]].&lt;br /&gt;
&lt;br /&gt;
= Mobile development  =&lt;br /&gt;
&lt;br /&gt;
== Proxying DNS requests ==&lt;br /&gt;
&lt;br /&gt;
If, like me, you move about quite a lot, connecting to various networks as you go and getting your ip via dhcp, you'll probably be annoyed at having to constantly update your resolv.conf on the Neo 1973.&lt;br /&gt;
&lt;br /&gt;
To get round this, as part of my setup script, I run a proxy dns on the ip address the neo comes in on at the usb0 port. This means that my Neo /etc/resolv.conf only contains:&lt;br /&gt;
&lt;br /&gt;
 nameserver 192.168.0.200 &lt;br /&gt;
&lt;br /&gt;
and my laptop will proxy all dns requests based on it's own /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
'''note that we only run the dns proxy on the usb0 interface so that we don't break any other networking'''&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 from my site. 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;
Another easy setup is using a udp forwarder like the one from http://www.tapor.com/udpf/ - is use it with the command&lt;br /&gt;
&lt;br /&gt;
 udpf-elf\&lt;br /&gt;
        -p=53\&lt;br /&gt;
        -f=`cat /etc/resolv.conf|awk '$1 == &amp;quot;nameserver&amp;quot;{print $2; exit(0);}'`:53&lt;br /&gt;
&lt;br /&gt;
=== Proxying with iptables ===&lt;br /&gt;
Its is possible to forward DNS requests with iptables using the DNAT target&lt;br /&gt;
&lt;br /&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&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 residential gateway (router). This is the easiest method, but its not recommended if you have a direct connection to the Internet as ISP DNS servers can change, and this does no load-balancing.&lt;br /&gt;
&lt;br /&gt;
= Connecting to phone =&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;ssh root@192.168.0.202&amp;lt;/tt&amp;gt; with empty password to get into phone.&lt;br /&gt;
&lt;br /&gt;
NOTE: the ssh daemon (dropbear 0.49) on the OpenMoko 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;
===SSH Extras===&lt;br /&gt;
&lt;br /&gt;
If you get fed up with typing root@192.168.0.202, on your PC edit /etc/hosts and add an entry for 'phone'&lt;br /&gt;
&lt;br /&gt;
 192.168.0.202 phone&lt;br /&gt;
&lt;br /&gt;
then edit ~/.ssh/config (or create it) and add&lt;br /&gt;
&lt;br /&gt;
 host phone&lt;br /&gt;
 user root&lt;br /&gt;
&lt;br /&gt;
then all you need to do is type &lt;br /&gt;
&lt;br /&gt;
 # ssh phone&lt;br /&gt;
&lt;br /&gt;
To avoid ssh added a new line for every ssh host-key to you known_hosts you can add the following to the phone section in ~/.ssh/config&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;
====From host to phone====&lt;br /&gt;
&lt;br /&gt;
To generate ssh keys for use as a login mechanism type&lt;br /&gt;
&lt;br /&gt;
 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;
 # mkdir ~/.ssh&lt;br /&gt;
&lt;br /&gt;
then from your PC copy the '''.pub''' file to the phone.&lt;br /&gt;
&lt;br /&gt;
 # scp ~/.ssh/id_rsa.pub phone:.ssh/authorized_keys&lt;br /&gt;
&lt;br /&gt;
You should now be able to ssh directly into the phone.&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 phone to host====&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;
This works for me.  I ripped off these instructions from: [[http://forum.openwrt.org/viewtopic.php?pid=53705]]&lt;br /&gt;
&lt;br /&gt;
===GUI on desktop through SSH===&lt;br /&gt;
&lt;br /&gt;
If you need to get the GUI on the phone onto the desktop via usb, you can use ssh as follows&lt;br /&gt;
&lt;br /&gt;
  ssh -l root -X -v 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Login, and 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;
===Remote apps on neo===&lt;br /&gt;
&lt;br /&gt;
To get desktop apps to show up on your neo, first log in to the phone&lt;br /&gt;
&lt;br /&gt;
  ssh -l root 192.168.0.202&lt;br /&gt;
&lt;br /&gt;
Then once inside, 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=moko: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;
&amp;lt;span id=&amp;quot;bottom&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; &lt;br /&gt;
{{Languages|USB Networking}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:Implemented]]&lt;/div&gt;</summary>
		<author><name>AudriusA</name></author>	</entry>

	</feed>