BTPAND(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’™ BTPAND(8) β€” the Bluetooth PAN daemon, bestie edition

okay so real talk: this is btpand(8) from the System Manager's Manual, and she's the one who handles all your Bluetooth networking biz. sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

btpand β€” the Bluetooth PAN daemon. that's it, that's her. πŸ‘‘


🌸 SYNOPSIS 🌸

btpand [-i ifname] [-m mode] -a addr -d device
       {-s service | -S service [-p psm]}
btpand [-c path] [-i ifname] [-l limit] [-m mode] [-p psm] -d device
       {-s service | -S service}

two whole invocation flavors, pick your fighter πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the btpand daemon is out here handling Bluetooth Personal Area Networking services on your system, no cap. she can run in two whole modes:

  • client mode β€” as a Personal Area Networking User (PANU), which is giving main character energy
  • server mode β€” as a Network Access Point (NAP), Group ad-hoc Network (GN), or a PANU host

how does she connect to your system? via a tap(4) virtual Ethernet device, and then she forwards Ethernet packets out to your remote Bluetooth devices using the Bluetooth Network Encapsulation Protocol (BNEP). iconic behavior, honestly.


πŸŽ€ the three roles, explained

the PANU client β€” this is the device that's using either the NAP or GN service. she can also just talk directly to a PANU host in a crossover-cable kinda way. lowkey flexible.

a GN host β€” forwards Ethernet packets to each of the connected PAN users as needed, but does not provide access to any additional networks. she's here for the group hang, not the extended network.

the NAP service β€” this one gives you some of the features of an Ethernet bridge. the NAP host forwards Ethernet packets between each of the connected PAN users, and also to a different network media. very giving.

note that the only differences between NAP and GN services as implemented by btpand are in the SDP service record. the bridging of packets by the NAP has to be configured separately. so like... don't assume, configure it. πŸ”₯

the options are as follows, bestie:


πŸ’… OPTIONS πŸ’…

  • -a address β€” in client mode, this is the address of the remote server. you can give it as a BDADDR or as a name, and if you give a name, btpand will attempt to resolve the address via the bt_gethostbyname(3) call. 🫢
  • -c path β€” in server mode, specify the path to the sdpd(8) control socket. the default path is /var/run/sdp. πŸŽ€
  • -d device β€” restrict connections to the local device. you can give it as a BDADDR or as a name, and if you give a name, btpand will attempt to resolve the address via the bt_devaddr(3) call. also, btpand will set the tap(4) interface physical address to the BDADDR of the Bluetooth radio. πŸ’€ that part matters, remember it.
  • -i ifname β€” btpand uses the tap(4) driver to create a new network interface for use. use this option to select a specific tap(4) device interface, which must already be created. no creating-on-the-fly, she's not doing that for you. πŸ™ˆ
  • -l limit β€” in server mode, limit the number of simultaneous connections. the default limit is 7 for NAP and GN servers, and 1 for a PANU server. okay queen of setting boundaries πŸ‘‘
  • -m mode β€” set the L2CAP connection link mode. the supported modes are:
    • auth β€” require devices to be paired.
    • encrypt β€” auth, plus enable encryption.
    • secure β€” encryption, plus change of link key.
NOT YET SUPPORTED. use global device settings to set authentication and encryption. fr fr, don't come for her, she told you.
  • -p psm β€” use an alternative L2CAP Protocol/Service Multiplexer (PSM) for server mode or client mode (when not using Service Discovery). the default PSM for BNEP is 15 (0x000f). ⭐
  • -s service β€” name of the service to provide or connect to. the following services are recognised:
    • GN β€” Group ad-hoc Network.
    • NAP β€” Network Access Point.
    • PANU β€” Personal Area Networking User.
  • -S service β€” same as per -s, except that btpand will not use SDP services for connection setup. going rogue, love that for her. 🌈

🧚 one little profile requirement

when providing networking services, the Bluetooth PAN profile says that the β€˜Class of Device’ property of the bluetooth controller SHALL include Networking capability (set bit 0x020000). see hccontrol(8) for details. this is not a suggestion, bestie, it's a SHALL. πŸ’–

πŸ’œ and then she dips

after btpand has set up the client or server connection and opened the tap(4) interface, it will create a pid file and detach. she's out. 🌸


πŸ“ FILES πŸ“

  • /dev/tap
  • /etc/bluetooth/hosts
  • /var/run/sdp
  • /var/run/tapN.pid

⭐ EXIT STATUS ⭐

the btpand utility exits 0 on success, and >0 if an error occurs. classic, clean, no notes.


πŸ”₯ EXAMPLES πŸ”₯

ifconfig tap1 create
btpand -a host -d mydevice -s NAP -i tap1
dhclient tap1

this will create a connection to the NAP on host, and link that to the tap1 interface. three lines, whole vibe. ✨

btpand -d mydevice -s GN

this will create a Group Network and register the GN service with the local SDP server. one-liner queen. πŸ‘‘


🌈 SEE ALSO 🌈

bluetooth(3), bridge(4), tap(4), dhclient(8), hccontrol(8), ifconfig(8), sdpd(8)

the "Personal Area Networking Profile" and "Bluetooth Network Encapsulation Protocol" specifications are available at

http://www.bluetooth.com/

go read them, iykyk πŸ¦‹


πŸ’– AUTHORS πŸ’–

Iain Hibbert β€” we stan.


πŸ’€ BUGS πŸ’€

okay so the known issues, and we're being honest about them:

  • there is no way to supply alternative values for the SDP record.
  • there is no way to set net type or multicast address filters.
  • btpand does not do any address routing except to directly connected unicast addresses. all other packets are multicast. so like, don't expect routing miracles. 😭
  • as btpand uses the BDADDR of the Bluetooth radio as the physical address of the tap, only one instance can be run per radio. literally one. per radio. periodt.
  • btpand can only provide a single service. one service and one service only, she's monogamous like that πŸ™ˆ

and that's the whole page, bestie!! this was btpand(8) from the System Manager's Manual, Debian build, dated August 17, 2008 β€” go forth and PAN responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from