This page explains how to bridge the usb0 device to eth0 on your Linux host, enabling your Linux host to act as a hub for your BeagleBoard and connecting it to the outside world. As an additional reference, the following article is good at explaining how to create a typical Ethernet bridge on a Linux machine with two Ethernet cards:

+

[[Category: Linux]]

+

[[Category: OMAP]]

+

This page explains how to bridge the usb0 device to eth0 on your Linux host, enabling your Linux host to act as a hub for your [[BeagleBoard]] and connecting it to the outside world. As an additional reference, the following article is good at explaining how to create a typical Ethernet bridge on a Linux machine with two Ethernet cards:

Revision as of 12:11, 12 February 2009

This page explains how to bridge the usb0 device to eth0 on your Linux host, enabling your Linux host to act as a hub for your BeagleBoard and connecting it to the outside world. As an additional reference, the following article is good at explaining how to create a typical Ethernet bridge on a Linux machine with two Ethernet cards:

The main difference between the scenario in the Linux Journal article mentioned above and the BeagleBoard is that we're creating a bridge from usb0 to eth0 instead of from eth1 to eth0. Also, we have to deal with the fact that "usb0" doesn't exist as a device on our Linux host except when the USB Gadget support is running on the connected Beagleboard, which isn't the case when we're first booting the Linux host.

My Linux host is running Fedora Core 10. I'm sure some of the following network configuration steps are specific to Fedora, but they can probably be easily adapted to other Linux distributions. On Fedora, I edited the network scripts "/etc/sysconfig/network-scripts/ifcfg-eth0" and "/etc/sysconfig/network-scripts/ifcfg-usb0" by hand to make sure those interfaces had no IP or gateway settings, and that they were not controlled by the Fedora network manager by setting NM_CONTROLLED=no.

Next, I created a new script "/etc/sysconfig/network-scripts/ifcfg-br0" that is going to be the "bridge" interface that connects both usb0 and eth0 to the outside world. This script looks a lot like what "ifcfg-eth0" used to look like.

I set the br0 init script to run during bootup by making the following symbolic link:

ln -s /etc/init.d/br0 /etc/rc5.d/S91br0

My system typically runs at runlevel 5 (hence rc5.d), and "S91" on my system runs after the networking scripts, but before critical services like dns, named, dhcp, samba, etc, which need the interface to be up when starting.

The br0 script manually brings up eth0 and br0, which is why it is important that these interfaces are not controlled by Fedora's network manager.

After re-booting the Linux host (without a BeagleBoard attached), the result of "ifconfig" should list "br0", "eth0", and "lo", and if you execute "sudo brctl show" it should list eth0 as being a member of the bridge.

You should be able to access the external network the same as before on your Linux host at this point.

Step 2: Booting the BeagleBoard

The next step is to boot the BeagleBoard with kernel parameters that tell it to mount its root file system over NFS. Here are the U-Boot settings I used to boot the kernel from an SD card, then boot the rootfs over NFS:

While the BeagleBoard kernel is booting, the usb0 device will show up on the Linux host. Run "ifconfig" a few times, and when "usb0" is listed, run the following command:

$ sudo brctl addif br0 usb0

This will add "usb0" to the Ethernet bridge, and the Linux host will now act as a hub for the Beagleboard. The Beagleboard will now continue to boot, but the weird thing is I didn't see any of the kernel boot messages scroll by while it's starting up. However, when it's done the "Angstrom" prompt comes up on the serial normally.

If you execute "sudo brctl show" after the BeagleBoard is done booting, it should now should both eth0 and usb0 being on the bridge:

Step 3: Accessing the Outside World from the BeagleBoard

You might want to make sure that any firewall software like iptables is disabled on the Linux host, or at least make sure the firewall settings allow the Linux host to act as a hub for your BeagleBoard. Otherwise, the BeagleBoard will not be able to see the outside world.

On the BeagleBoard, modify "/etc/network/interfaces", and configure the settings for "usb0".