Mozilla Skin

Howto network usb ben

From JLiMe.com

About

The easiest way to get network access with the ben is to use the usb cable. The default kernel has support for this.

Howto

First we set an ipnumber on our nanonote. It can be anything but must be unique. Most home networks dont use 192.168.1.x so lets use that.

1) Configure your nanonote

   $ ifconfig usb0 192.168.1.2

Now we need to set a unique ip adress for our laptop/desktop (whatever the usb cord i attached to).

2) Configure your laptop/desktop

   $ lsusb
   Bus 001 Device 006: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB    Ethernet/RNDIS Gadget
   $ ifconfig usb0 192.168.1.1 (must be on same subnet as nanonote)
   $ ifconfig
   usb0      Link encap:Ethernet  HWaddr 16:90:89:ea:82:6f  
             inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
             inet6 addr: fe80::1490:89ff:feea:826f/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000 
             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

You should now be able to ping your nanonote from your PC.

3) Getting internet to work On your nanonote do this:

        route add default gw 192.168.1.1
        echo "nameserver xxx.xxx.xxx.xxx" > /etc/resolv.conf

replace xxx... with the correct ip of your nameserver.

On your PC do this:

         iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
         echo 1 > /proc/sys/net/ipv4/ip_forward