HowTos/Bridging with Ubuntu
From OpenZaurus
This describes how to give network access to your Zaurus via ethernet bridging with a PC running Ubuntu Linux. This allows a USB-connected Zaurus to appear as another host on the same network as the PC. Bridging is useful only if you can allocate an IP address for the Zaurus that is on the same network as the PC (e.g. you are connected to a private network). Bridging is not appropriate if your PC is connected directly to the internet (via a cable/adsl/modem) and thus has a public IP address, in this case see this howto.
Contents |
Prerequisites for Ubuntu host machine
- This HOWTO has been tested on Kubuntu 6.06 but it will probably work on the same and later versions of all the Ubuntu family and maybe even later versions of other Debian-based distros. It will probably NOT work on earlier versions of Ubuntu.
- The brctl command is provided by the bridge-utils package:
sudo apt-get install bridge-utils
Configuring the Ubuntu machine
The interface with the Zaurus, usb0, will be combined with eth0 in a virtual interface called br0, this is what will be assigned the IP configuration for the PC. The Zaurus will be getting an IP address on the same network.
NB: The Ubuntu package bridge-utils must be installed
The Ubuntu machine is configured entirely via the /etc/network/interfaces file, which should contain:
auto lo
iface lo inet loopback
# Configure br0 using ifupdown with dhcp and add eth0 to the bridge
auto br0
iface br0 inet dhcp
bridge_ports eth0
# udev calls ifupdown for usb0 when it is created and destroyed. See /etc/udev/rules.d/85-ifupdown.rules
# Tell ifupdown not to assign an IP address and add it to the bridge.
auto usb0
iface usb0 inet manual
up ifconfig $IFACE 0.0.0.0 up
post-up brctl addif br0 usb0
Configuring the Zaurus
Use the Network settings GUI to configure usbd0. Either use DHCP, or a static config on the same subnet as the PC, e.g.:
Automatically bring up IP Address = 192.168.2.50 Subnet Mask = 255.255.255.0 Gateway = 192.168.2.1 (same as the PC) First DNS = 192.168.2.10 (same as the PC) Second DNS = 192.168.2.1 (same as the PC)
Troubleshooting
- If you set the Zaurus to use DHCP, it can take over a minute to configure usbd0
- I found that the MTU assigned to usbd0 on the Zaurus was diferent from that assigned to usb0 on the PC:
ubuntu # ifconfig usb0
usb0 Link encap:Ethernet HWaddr 66:5E:F2:2A:07:79
UP BROADCAST RUNNING MULTICAST MTU:1494 Metric:1
RX packets:198 errors:0 dropped:0 overruns:0 frame:0
TX packets:3368 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20256 (19.7 Kb) TX bytes:349616 (341.4 Kb)
collie # ifconfig usbd0
usbd0 Link encap:Ethernet HWaddr 40:00:01:00:00:01
inet addr:192.168.2.50 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3459 errors:2 dropped:2 overruns:0 frame:2
TX packets:251 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
This does not prevent logging into the Zaurus using ssh but does prevent downloading files larger than about 1kB. I am not sure why this happens, it may be related to this kernel bug report
The solution is to reduce the MTU on the Zaurus end. You can configure the Zaurus to do this automatically by editing /etc/network/interfaces. Find the section starting 'iface usbd0' and add the following line:
up ifconfig usbd0 mtu 1494

