Skip to content

6LBR Interface Configuration

Michael edited this page Mar 24, 2017 · 4 revisions

Note: This page is only relevant for Linux based 6LBR

On a Linux platform, you need to link the 6LBR application to your LAN. In order to do so you have three different possibilities. (To make things easier, imagine that 6LBR is a virtual machine running on your Linux Host)

Raw Ethernet

This is the easiest way but also the most limited one: Your Linux Host will not be able to communicate with 6LBR and the WSN directly. As the name indicates, the 6LBR uses the configured Ethernet interface directly to send and receive packets.

Raw Ethernet

The configuration needed in your /etc/6lbr/6lbr.conf file is (if your Ethernet interface is eth0) :

RAW_ETH=1
BRIDGE=0
DEV_ETH=eth0

Bridge mode

This mode requires more configuration but you will be able to communicate to the 6LBR from the Linux Host. In this mode, 6LBR will create a virtual Ethernet interface called 'tap0' by default. You need to bridge it to your Ethernet interface in order to provide connectivity. The created Bridge interface will replace your Ethernet interface for all purposes.

Important note: Your Ethernet driver must support Promiscuous mode! If not the bridge won't work properly and you will have intermittent connectivity with 6LBR. The Ethernet driver of the Beaglebone does not support promiscuous mode!

Bridge

The configuration needed in your /etc/6lbr/6lbr.conf file is (if your Ethernet interface is eth0) :

RAW_ETH=0
BRIDGE=1
CREATE_BRIDGE=0
DEV_ETH=eth0
DEV_BRIDGE=br0
DEV_TAP=tap0

You also need to create the bridge interface 'br0'. In /etc/6lbr, we provides two examples of /etc/network/interfaces files to do so. For example, if you are using DHCP, the content of the file should be something like:

...

iface eth0 inet static
address 0.0.0.0

auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    up echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
    post-up ip link set br0 address `ip link show eth0 | grep ether | awk '{print $2}'`

...

As you see, the Ethernet interface is no longer configured and it has been replaced by br0.

It is possible to create the Bridge when 6LBR starts up, but this has as a consequence that you will lose all your existing connections when the Ethernet interface joins the bridge. If you really want this mode, you have to add to your 6lbr.conf file :

CREATE_BRIDGE=1

Routing mode

This mode is the most powerful, but also the most complex one. Instead of creating a bridge to connect the tap0 interface and the eht0 interface, you rely on the Linux Host stack to do the routing between the two interfaces: either at IP level using actual routes or Ethernet level using ebtables. This is only useful when you have several interfaces, need complex routing or simply when your Ethernet driver does not support Promiscuous mode.

Routing

The configuration in 6lbr.conf is easy:

RAW_ETH=0
BRIDGE=0
DEV_ETH=eth0
DEV_TAP=tap0

IP Forwarding can be enabled by adding the following two lines in /etc/sysctl.conf:

net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding=1

To avoid having a needless subnet between the tap0 and eth0 interfaces it is better to use the SmartBridge mode without prefix autoconfiguration.

More information

You can have a look at 6lbr.conf documentation for more information and configuration options.

Clone this wiki locally