Chapter 4. Persona Area Network

This chapter explain how to set up a network connection over a Bluetooth link between two or more Bluetooth capable computers. These instructions apply to Affix version 3.0.0. Personal area network (PAN) is a scatternet (see chapter 1) where two or more Bluetooth capable computers partisipate.

Host that allows other computers to connect with itself over Bluetooth connection is called Network Access Point (NAP) or Group Network (GN). You have two options to set a NAP up. You can use routing option with masquerading or you can set up a bridge. In the following sections both configurations are introduced.

GN is a configuration when there is no IP forwarding or routing features used to connect piconet participants to a LAN. In GN configuration hosts are connect together over Bluetooth link. You can think that NAP is GN expanded with a LAN connection. Thus setting up a GN is a subset os setting up a NAP which is explained here.

Note! When you compile your kernel on NAP remember to enable the following features under Device Drivers->Networking support->Networking options->Network packet filtering->IP:Netfilter Configuration

Make sure you have IP forwarding enabled. Give command echo 1 > /proc/sys/net/ipv4/ip_forward as a root in the console.

Note! Currently Affix does not support connection encrypting. To establish a secure connection use LAN over RFCOMM instead. See the following chapter.

4.1. Setting up a router

To configure your computer to act as network access point (NAP) do the following steps. These steps instruct you to set your computer up using a router configuration.

  1. Edit Affix configuration file (/etc/affix/affix.conf). Check that pan role "nap" is chosen. Comment other roles out.

    Also choose "router" as pan scheme uncommenting the line pan_scheme="router" and commenting other schemes out.

  2. Restart PAN giving commands:

    btpan stop

    btpan init nap

    Now you are able to connect this computer from the others. To allow TCP/IP traffic over just created PAN follow also the following steps. You need to restart PAN only this time. Next time you reboot your computer PAN is initialized automatically as NAP.

  3. Set up the pan0 interface if it is not set up yet.

    ifconfig pan0 192.168.0.1 up

    Now pan0 interface should show up in the interface list you get typing command ifconfig without parameters.

  4. You probably want to set up DHCP server in your NAP. Check that you have dhcpd installed in your system and then start the daemon.

    dhcpd -q -cf /etc/affix/dhcpd.conf pan0

    Now you have configured an access point for your group network (GN). If you have a network connection in your computer you probably want to share it with others and configure your computer as a NAP. If so proceed to step five. If GN is enough for you can skip the following point.

  5. To use your host as a router to the network your computer is connected you should allow masquerading. To allow masquerading edit your iptables.

    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

    Change the IP address above to correspond the address and IP mask you have chosen to your NAP address.

Now you are ready to set up the client (PANU) computers. See instructions in the third section in this chapter.

When you boot your NAP server you do not need to repeat all the instruction above. All you need to do is allow IP forwarding as instructed in the previous section.