PAN over Bluetooth in Ubuntu 12.04 w/Bluez 4 & Blueman

I’m setting up a Bluetooth “Group ad-hoc Network” (GN) between my desktop (say, MAC 00:00:00:00:00:0A) and laptop (MAC 00:00:00:00:00:0B) just to see if I can. Existing documentation’s pretty sparse, so I’m documenting what I do as I go along, to be able to recreate it later if need be. This is not a proper how-to, it’s public just for myself; you’re free to apply it though (as you should).

I installed bluez-tools.

$ bt-adapter -i

shows information about the local adapter.

I set both adapters discoverable:

$ bt-adapter –set Discoverable 1

They already were pairable. If not, set them so:

$ bt-adapter –set Pairable 1

This enables me to query the other device:

jani@A:~$ sudo hcitool info 00:00:00:00:00:0B

jani@B:~$ hcitool scan
Scanning …
00:00:00:00:00:0A A-0

And to pair them:

jani@A:~$ bluez-simple-agent
Agent registered

jani@B:~$ bluez-simple-agent hci0 00:00:00:00:00:0A
RequestPinCode (/org/bluez/1075/hci0/dev_00_00_00_00_00_0A)
Enter PIN Code: 1234

#(back at A)
RequestPinCode (/org/bluez/1395/hci0/dev_00_1A_6B_28_21_1C)
Enter PIN Code: 1234

#(back at B)
New device (/org/bluez/1075/hci0/dev_00_00_00_00_00_0A)

I did this manually, because I was having trouble pairing the devices using GUIs. But once I had the two computers paired, I ran Blueman on both, added networking service on the desktop (all the default settings, using dnsmasq and Network Manager), created trust between the two (not sure if necessary) and connected the laptop to the desktop’s networking service. Oh, and patched Blueman on the laptop to be able to connect.

After that I ran sudo dhclient bnep0 on the laptop. I think the DhcpClient plugin in Blueman is supposed to take care of this, but it doesn’t work for some reason, and Network Manager doesn’t see the interface (on either end) so it’s not configurable there either.

At some point of the process I also added myself to the ‘bluetooth’ group on both setups, though I’m not sure if it’s necessary or even desirable. If things continue to work as they are, I’ll probably try removing myself from the group to see if it still works.