Internet On Your Neo FreeRunner (USB Networking)

From GeoSharing

Jump to: navigation, search
Internet on FreeRunner via USB

It is always simpler to have a direct internet access from your Neo FreeRunner when you want to install or develop something on your phone. We will take advantage of the internet connection of the PC and the USB connection between the PC and the Neo FreeRunner.

For this example, we are working with Ubuntu 10.10 on a laptop.

Contents

Connect the Openmoko

The first thing to do is to create an alias for the IP address of the Neo FreeRunner.

192.168.0.202 openmoko

NoteĀ : The alias "openmoko" can be replaced by any other name at the will of the user.

Then, we must set up the connection.

With the network manager

The easiest way to set up the connection with the Openmoko is to create a new connection (called Openmoko here) for the wired networks. For this connection, you choose a static (manual) IP address 192.168.0.200.

Screenshot-Editing Openmoko.png

Without the network manager

# The Openmoko network interface 
auto eth1
iface eth1 inet static 
address 192.168.0.200 
netmask 255.255.255.0
$ /etc/init.d/networking restart
$ ssh root@openmoko
root@om-gta02 ~ #

Configuration IP tables

In order to make the computer connected to the openmoko forward packets comming from the interface eth1, it is necessary to enable IP forwarding which is deactivated by default in Ubuntu. It is therefore requiered to issue the following commands with administrator (sudo) priviledges :

$ gedit /etc/sysctl.conf
#net.ipv4.conf.default.forwarding=1

and uncomment it (remove the # caracter if not already done).

sudo sysctl -w net.ipv4.conf.default.forwarding = 1
$ gedit /etc/rc.local
/sbin/iptables -P FORWARD ACCEPT 
/sbin/iptables --table nat -A POSTROUTING -s 192.168.0.202/32 -o iface -j MASQUERADE

where iface corresponds to the interface connected to the internet (wlan0, eth0, eth1, ...). These changes also take effect only after a reboot. To make them effective directly, type the same command in a terminal by replacing /sbin/ by sudo.

Sources

Personal tools
Namespaces
Variants
Actions
Navigation
GeoSharing
Misc
Toolbox