view · edit · print · history

This is a short guide on how to make the slug an ethernet bridge. This can be useful if you have added an usb ethernet adapter, however there are other reasons why you might want to do this:

  • Build a bluetooth-to-lan access point, which connects bluetooth devices directly to your LAN (what i did)
  • openvpn in TAP mode, so your openvpn-clients appear also direclty in LAN (what I'm planning to do)

The advantage of bridging is, that you don't need any routing, so it is simpler to setup in small networks.

The only extra problem with briding on the slug (if compared to other linux boxes) is, that you're normally connected via SSH (unless you have serial - then forget about my guide ;) ), so in the moment you add eth0 to the bridge, it becomes unavailable and the ssh connection gets close, so you can't finish up your bridge. But one step after another.


  • openslug 2.7 or later (as the kernel module for bridging is not in the current stable feed, you have to build your own openslug 2.7. Maybe you can also build the kernel module for the 2.5 kernel from the 2.5 tarball, but I didn't try this)


  • Install kernel-module-bridge and bridge-utils:
    ipkg install kernel-module-bridge bridge-utils
  • Due to the problems described above, you can't do the usual brctl addif ... now, because this would disconnect you from the slug and you would have to do a reboot. Instead, i wrote a litte script which does this:

brctl addbr pan0
brctl addif pan0 eth0
ifconfig eth0 promisc
ifup pan0
[add additional interfaces...]

  • For ifup to work, you have to create a new entry in /etc/network/interfaces:

iface pan0
address 192.168.XXX.XXX
gateway 192.168.XXX.XXX

Note: 192.168.XXX.XXX is the address which was assigned to eth0 before / your gateway address, netmask should be adjusted to your needs.

Now run the script. (I used nohup [scriptname] to run it, but as the ssh connection stayed alive, i think this should not be necessary.) Check if the bridge is created properly: ifconfig. When all works as expected, you can move the script to /etc/init.d and create the symlinks for automatic startup.

That's it!



TK: followed this on openslug using a dhcp server. After running script unable to access slug, "no route to host"

view · edit · print · history · Last edited by TK.
Originally by joschi.
Page last modified on July 08, 2007, at 04:09 AM