USB Networking troubles

michael cole mjcole137 at gmail.com
Sat Aug 9 03:22:35 CEST 2008


Andrew,

I'll make the netmask changes you suggest.

Further to my comments above re: the USB networking page @ openmoko. My
issue could have been avoided if the networking page made clear that the
Freerunner--Desktop connection is on a different network than the LAN the
desktop uses to access the Internet. Likewise a troubleshooting note when
one cannot ping past the desktop machine. The document, as it is now
written, focuses on just the Freerunner--Desktop connection and makes an
assumption that the LAN is not 192.168.0.X Your description placing the task
of setting up USB networking in the context of the whole LAN makes clear how
the FR--Desktop network is situated. It probably seems obvious for most of
the users here.

Perhaps someone with editing rights to the networking page can add a couple
of lines to make clear the need for distinct networks in specifying the
setup. Also, it would help to extend the worked example to show (at each
stage) what output one should see from "route -n " on each machine. This is
also a point to check in troubleshooting cases where one can ping the
desktop but no other machines on the LAN.

Once again I appreciate the time everyone has taken to help.

Thanks,

Michael

On Fri, Aug 8, 2008 at 8:40 AM, Andrew C. Dingman <
andrew+openmoko at dingman.org <andrew%2Bopenmoko at dingman.org>> wrote:

> On Fri, 2008-08-08 at 06:32 -0400, michael cole wrote:
> > First thanks to all for replying.
> >
> > These changes worked.
>
> Glad it helped. I hope the IP routing mini-lecture made clear *why* :)
>
> > So on my Freerunner /etc/network/interfaces includes:
> >
> > # Ethernet/RNDIS gadget (g_ether)
> > # ... or on host side, usbnet and random hwaddr
> > auto usb0
> > iface usb0 inet static
> >       address 192.168.2.202
> >       netmask 255.255.255.0
> >       network 192.168.2.0
> >       gateway 192.168.2.200
> > # orig:
> > #     up echo nameserver 192.168.0.200 >/etc/resolv.conf
> > # using home (nimiq.net)
> >       up echo nameserver 207.235.125.4 >/etc/resolv.conf
> >
> > on the desktop  /etc/network/interfaces includes:
> > allow-hotplug usb0
> > iface usb0 inet static
> >         address 192.168.2.200
> >         netmask 255.255.255.192
> >         post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s
> 192.168.2.192/26
> >         post-up echo 1 > /proc/sys/net/ipv4/ip_forward
> >         post-up iptables -P FORWARD ACCEPT
> >         pre-down iptables -D POSTROUTING -t nat -j MASQUERADE -s
> > 192.168.2.192/26
>
> Almost right, and in fact this configuration won't break in practice
> because you can't plug additional devices into your USB network.
> However, the FreeRunner and the desktop really *should* agree about the
> netmask. You have the FreeRunner thinking its local network includes 256
> addresses (192.168.2.0-255), and the desktop thinking that the network
> it and the FreeRunner live in includes only 64 (192.168.2.192-255). If
> you choose to fix this on the desktop by using the 255.255.255.0
> netmask, you'll also want to fix the masquerade rule to specify
> 192.168.2.192/24, as the /n part indicates a netmask with binary 1 in
> the n most significant bits. (255.255.255.0 == binary IP 11111111
> 11111111 11111111 00000000. 255.255.255.192 == binary 11111111 11111111
> 11111111 11000000)
>
> If you want to play with this stuff a bit more, you might be interested
> in a tool called 'gip' that you can install on your desktop with
> 'apt-get install gip'. It lets you enter IPs and netmasks in any of the
> normal forms and shows you the resulting network sizes and binary,
> hexadecimal, and decimal representations of the results.
> --
>
>
> _______________________________________________
> support mailing list
> support at lists.openmoko.org
> https://lists.openmoko.org/mailman/listinfo/support
>



-- 
Michael Cole
mjcole137 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/support/attachments/20080808/045f5f48/attachment.htm 


More information about the support mailing list