A problem with usb networking

Joe Pfeiffer joseph at pfeifferfamily.net
Wed Dec 5 20:08:04 CET 2007


geniere90 at interfree.it writes:
> 
>I have a neo1973 and I wish I could connect it to my Laptop in order
>to access the internet ( I use Ubuntu 7.10 ).
>I followed this page on the wiki
>http://wiki.openmoko.org/wiki/USB_Networking but nothing... my neo
>won't connect to the internet! Everything seems ok but the internet
>connection...

(what follows is for Debian Linux.  If you've got another Linux,
mapping this to your environment should be straightforward.  If you're
running Windows... oh, well).

There are a bunch of things that could be happening -- in a nutshell,
you need to make sure that your laptop will route appropriate packets
to your NEO, and that it will forward packets.

My first problem when I tried setting up networking was that my home
network is 192.168.0.x, and of course the NEO wants 192.168.0.202.  So
the first thing I did was to edit the NEO's /etc/network/interfaces to
use IP 192.168.200.202, with gateway 192.168.200.200.  I also set the
DNS server to 192.168.200.200.

On my laptop, I edited /etc/network/interfaces to include

allow-hotplug usb0
iface usb0 inet static
        address 192.168.200.200
        netmask 255.255.255.0

So now, when a usb0 net interface is created by plugging in the NEO,
the NEO and the laptop can talk to each other.

I set the NEO's DNS server to be my laptop because I'm already running
dnsmasq on the laptop for other reasons, and this way I don't need to
reconfigure the NEO depending on whether I'm at home or at work.

Next, I needed to turn on packet forwarding on the laptop.  This
required editing my /etc/sysctl.conf to uncomment the line

net.ipv4.ip_forward=1

Finally, turning on NAT in my laptop's firewall finished the job.







More information about the community mailing list