| 1 |
|
|---|
| 2 |
*** Bluetooth network configuration in /etc/net *** |
|---|
| 3 |
|
|---|
| 4 |
To set up a BT connection between two /etc/net managed Linux hosts, |
|---|
| 5 |
you will need 2 BT interfaces with distinct MAC addresses. BT MAC |
|---|
| 6 |
addresses are 6 bytes long, like Ethernet MAC addresses, and can |
|---|
| 7 |
be displayed with "hcitool dev" command. You need "bluetooth" service |
|---|
| 8 |
running to access BT interfaces. |
|---|
| 9 |
|
|---|
| 10 |
After that you normally use one Linux host as a "server" and another |
|---|
| 11 |
one as a "client". To make the server side wait for connections, make |
|---|
| 12 |
sure you have hcid and pand services are running with the right options. |
|---|
| 13 |
|
|---|
| 14 |
pand startup is configured in /etc/sysconfig/bluetooth: |
|---|
| 15 |
PAND_ENABLE=true |
|---|
| 16 |
PAND_OPTIONS="--listen --role NAP" |
|---|
| 17 |
hcid is configured in /etc/bluetooth/hcid.conf |
|---|
| 18 |
|
|---|
| 19 |
After this setup is done, Linux BT system will accept client connections, |
|---|
| 20 |
create a BNEP interface and pass the rest of configuration task to /etc/net |
|---|
| 21 |
via a hotplug call. Your server BNEP interface will look as follows: |
|---|
| 22 |
/etc/net/ifaces/bluetooth/options: |
|---|
| 23 |
USE_HOTPLUG=yes |
|---|
| 24 |
TYPE=eth |
|---|
| 25 |
Yes, at server side it is treated as an Ethernet interface, this could be |
|---|
| 26 |
changed somewhere in future. Don't forget to add an entry for BT device into |
|---|
| 27 |
/etc/net/iftab. |
|---|
| 28 |
|
|---|
| 29 |
Client configuration would be done in /etc/net/ifaces/bluetooth/options: |
|---|
| 30 |
|
|---|
| 31 |
TYPE=bnep |
|---|
| 32 |
USE_HOTPLUG=no |
|---|
| 33 |
NAP=00:01:02:03:04:05 |
|---|
| 34 |
|
|---|
| 35 |
After that "ifup bluetooth" at client side should create a new interface, |
|---|
| 36 |
it usually takes up 10 seconds. You will probably want to run IPv4 or IPv6 |
|---|
| 37 |
over the newly created interface, just add ipv[46]address/ipv[46]route files |
|---|
| 38 |
where appropriate. |
|---|