Setting up the USB networking

Introduction

This document describes how you can set up USB networking between your host Linux machine and your Internet Tablet device.

USB networking means that the Internet Tablet device and your Linux laptop are talking IP protocol over the USB cable. This provides fast and effortless access to the Internet Tablet device and things like file copying, remote login over SSH, using NFS or doing remote debugging becomes possible.

Setting up your environment and device

In order to use USB networking on your device, you need to have a development root filesystem flashed into it. To do this you should read Using the flasher and making your own rootfs. All the details in this document are related to the developer rootfs and the examples here possible do not work as-is if you are using the actual sales image in your device.

The Linux host side insructions are for Debian and might be a bit different for other distributions.

The maemo developer root filesystem is configured to use a static IP address for USB networking.

  • IP address = 192.168.2.15

To get the USB network working on the Developer RootFS you must run the program "USB Networking" on the device. It is located in the Control Panel. Using this program you select if the USB connection is presented as a USB mass storage device or as a network port to the Linux host computer. Start the program and select the "USB networking" mode.

You also need to do the following modifications in your host Linux machine. Do the following:

  1. Disconnect the device from the USB connection
  2. Make sure that your Linux PC's kernel has usbnet support enabled
  3. Add the following lines to /etc/networking/interfaces. You need root user rights to do this on your host
    auto usb0
    iface usb0 inet static
    address 192.168.2.14
    netmask 255.255.255.0
    network 192.168.2.0
    broadcast 192.168.2.255
    up iptables -t nat -A POSTROUTING -o eth0 -s 192.168.2.15 -j MASQUERADE
    up echo 1 > /proc/sys/net/ipv4/ip_forward
    down iptables -t nat -D POSTROUTING -o eth0 -s 192.168.2.15 -j MASQUERADE
    down echo 0 > /proc/sys/net/ipv4/ip_forward 
    	  
  4. Now bring up the usb0 network interface with the following command:
    $ ifup usb0
    	  

Testing the connection

To test that the USB connection between your Linux PC and the Internet Tablet device works follow these simple steps.

  1. Attach the USB cable to the device
  2. The device should now be connected. You can check this by running the ifconfig command in your Linux PC. You should see the usb0 device in the list:
    $ ifconfig
    or
    $ ifconfig usb0
    	  
    Study the output. The usb0 interface should be in the list and it should be "UP" and it should have IP address. For details how to use the ifconfig program try "man ifconfig".
  3. Now you can try to ping the device from your Linux PC over the USB network with the address 192.168.2.15. Run command:
    $ ping 192.168.2.15	    
    	  
  4. If the ping answers, log into the device as root. The root password is rootme
    $ ssh root@192.168.2.15 
    
    You should get login prompt and you should be able to login to the device normally.

Once you are logged into the device, you can change the DNS resolve set up. By default, it is not functional. To do this you should edit /etc/resolv.conf on the device and for example add the same information your host machine has to it.

Knowns issues

There are a few known issues with the USB networking.

  1. The connection is not available when a MMC card is inserted in the device. The reason is that the USB port in the device can only play one role at a time.
  2. The USB network connection might occasionally die. If this happens then just disconnect the USB cable and connect it again.

Now that you have setup the USB networking working between the device and the Linux PC you can basically use any network services between the device and the Linux host PC.



Improve this page