Chapter 4. Usage manual

4.1. Personal Area Networking Profile (PAN)

4.1.2. Setting up the NAP device

To enable access from PANU device to external network the NAP must be configured to have briding or routing functionality.

Bridging functionality is supported by the Linux kernel. In order to enable it, it is necessary to compile the kernel with following option enabled: [Networking Options/802.1d Ethernet Bridging].

Configuration of the Ethernet bridge is done using brctl utility that is distributed with the bridge-utils package.

First, initialize the PAN interface: "btctl paninit nap bt0". This command will create a new network (PAN) interface called pan0, pan1, etc.

Second, set up a bridge:

  1. add a new bridge to the system: "brctl addbr br0". This command will create a new network interface called br0. It is used with the ifconfig command in the same way as with any ethernet interface.

  2. add Ethernet interface and PAN interface to the bridge: "brctl addif br0 eth0" and "brctl addif br0 pan0".

  3. activate the bridge and assign an IP address. "ifconfig br0 up". It may have the same IP address as the eth0 interface.

  4. check and fix, if necessary, the routing table. Default gateway must point to the bridge interface br0 (route add default ...). If eth0 and br0 have the same IP address then entry pointing to eth0 must be removed from the table (route del ... eth0).

Third, activate the PAN interface: ifconfig pan0 up. It's also possible to assign an IP address to the PAN interface, but as bridge has IP interface it's not really necessary.

Active NAP PAN interface waits for connection establishment.

To enable multiple clients on one NAP, the Bluetooth device on the NAP should be configured to accept role switch when connection occurs. This is done by: "btctl role allow|deny master". In this case, the NAP device becomes master when a client (PANU) connects to it.