In post describes how to set a “favorite node” using the PKI or remote admin functionality built into the Meshtastic firmware. It assumes that you have already setup a working remote admin system using official documentation. If you haven’t do that first and then return here for how to use the Meshtastic CLI tool to set favorite nodes.
Additionally, you may want to look at my post on how to get Linux to connect to a node using Bluetooth as well as setting up a Python virtual environment. This post is located at https://dustinrue.com/2025/12/connecting-to-a-meshtastic-node-using-bluetooth-from-linux/. This post assumes you are using Bluetooth to set favorite nodes on a remote target.
Setting favorite nodes remotely is surprisingly easy. You will need to activate your virtual environment (. ./venv/bin/activate) or whatever name you used to create your venv. Next, you will need to know the node IDs of the remote host you want configure AND the node IDs of the nodes you wish to favorite. In my example, I know that the node ID of my remote node is a5592387 and the ID of the node I want to mark as a favorite is 0c3a3de4. With this information on hand, I can use the command below to target a5592387 with a set-favorite command to set 0c3a3de4 as a favorite using bluetooth.
meshtastic -b D0:9D:0C:3A:3D:E4 --dest '!a5592387' --set-favorite-node '!0c3a3de4'
You may have noticed that I have marked the Bluetooth node as a favorite node on my remote node. That is correct! In an effort to use the 0-hop feature of the 2.7.x firmware series, it is necessary to add next hop nodes as favorites so that the hop count is not reduced. This feature is detailed in a blog post over on meshtastic.org.
You can use this method to perform a number of admin tasks using the Meshtastic CLI and some options, like setting favorite nodes, can only be done using the Meshtastic CLI if you are using the iOS client. For a complete list of commands for the Meshtastic CLI, issue meshtastic and press enter.