pand Command in Linux



The pand command in Linux is a daemon used to manage Bluetooth Personal Area Network (PAN) connections. It was part of BlueZ, the official Bluetooth stack for Linux, allowing devices to connect and share network access. It supported roles like PANU (client), NAP (network access point), and GN (group ad-hoc network). However, it has been deprecated in favor of bluetoothd and bt-network.

Table of Contents

Here is a comprehensive guide to the options available with the pand command −

Note − Since pand was removed in newer BlueZ versions, its functionality is now handled by bluetoothctl for device management, bt-network from bluez-tools for PAN connections, and nmcli from NetworkManager for Bluetooth PAN support.

Syntax of pand Command

The syntax of the pand command in Linux is as follows −

pand [options]

The [options] field is used to specify various options, such as listing PAN connections, establishing and killing PAN connections, and others.

pand Command Options

The options of the pand command are listed below −

Flag Option Description
-l --show Show active PAN connections
-s --listen Listen for PAN connections
-c <bdaddr> --connect <bdaddr> Create PAN connection
-Q[duration] --search[duration] Search and connect
-k <bdaddr> --kill <bdaddr> Kill PAN connection
-K --killall Kill all PAN connections
-r <role> --role <role> Local PAN role (PANU, NAP, GN)
-d <role> --service <role> Remote PAN service (PANU, NAP, GN)
-e <name> --ethernet <name> Network interface name
-i <bdaddr> --device <bdaddr> Source bdaddr
-D --nosdp Disable SDP
-E --encrypt Enable encryption
-S --secure Secure connection
-M --master Become the master of a piconet
-n --nodetach Do not become a daemon
-p[interval] --persist[interval] Persist mode
-C[valid] --cache[valid] Cache addresses
-P <pidfile> --pidfile <pidfile> Create PID file
-u <script> --devup <script> Script to run when interface comes up
-o <script> --devdown <script> Script to run when interface comes down
-z --autozap Disconnect automatically on exit

Examples pand Command in Linux

This section demonstrates the usage of the pand command in Linux with examples −

  • Listing Active PAN Connections
  • Searching and Connecting to a PAN Device
  • Connecting to a Specific Device
  • Killing a PAN Connection
  • Killing All PAN Connections

Listing Active PAN Connections

To list the active PAN Bluetooth connections, use the -l or --show option with the pand command −

pand -l

Searching and Connecting to a PAN Device

To search and connect to a PAN device, use the -Q or --search option −

pand -Q5

The above command searches the connections for 5 seconds and connects.

Connecting to a Specific Device

To connect to a specific device, use the -i or --device option with the Bluetooth device address −

pand -c -i 00:1A:7D:DA:71:13 -r PANU

In the above command, the -c option is used to connect, and -r is used to specify the role. In this example, the role is PANU, which indicates that the device is acting as a PAN User (client).

Killing a PAN Connection

To kill a PAN connection, use the -k or --kill option with the Bluetooth device address −

pand -k 00:1A:7D:DA:71:13

Killing All PAN Connections

To kill all PAN connections, use the -K or --killall option −

pand -K

Alternative to pand Command in Linux

The pand command has largely been replaced by bluetoothctl, an interactive tool to list and connect to Bluetooth devices.

To enter the interactive shell, use −

bluetoothctl
Alternative to pand Command in Linux1

To turn on the Bluetooth controller, use −

power on

Before pairing, set up the agent −

agent on

The agent is required to manage pairing requests and connections. To scan for devices, use −

scan on

To pair with a device, use the pair command with the Bluetooth device address −

pair 00:1A:7D:DA:71:13

A prompt will appear to confirm the pairing, and the agent will handle that. If a PIN is required, it will be requested.

To connect to a device, use −

connect 00:1A:7D:DA:71:13

To disconnect a device, use the following command in the bluetoothctl interactive shell −

disconnect 00:1A:7D:DA:71:13

To remove a paired device, use −

remove 00:1A:7D:DA:71:13

To display help, use the following command −

help
Alternative to pand Command in Linux2

Conclusion

The pand command in Linux, once part of the BlueZ Bluetooth stack, was used to manage Bluetooth PAN connections by allowing devices to connect and share network access. It supported roles like PANU, NAP, and GN, but has been deprecated in favor of more modern tools such as bluetoothd, bt-network, and bluetoothctl.

While pand was used for tasks like listing, connecting, and disconnecting PAN connections, other tools now handle its functionality. For managing Bluetooth PAN connections, bluetoothctl and nmcli offer more efficient alternatives.

Advertisements