This guide will show you how to set up a Wi-Fi hotspot using NetworkManager.
Before you begin, make sure you have:
Suitable devices that support AP (Access Point) mode include Rock 5C, Rock 5B+, Khadas Edge 2, Khadas Vim 4, all Mekotronics R58 devices, and the Orange Pi 5B.
You can easily create a hotspot using the NetworkManager command-line tool nmcli
.
List your network devices to identify the Wi-Fi interface you’ll use:
nmcli device status
Create the hotspot by using the following command (replace wifi_interface
with your actual interface name, like wlp2s0
or wlan0
):
nmcli device wifi hotspot ifname wifi_interface ssid MyHotspot password "mypassword"
This command will:
MyHotspot
mypassword
If you get the following error run the command again with sudo
Error: Failed to setup a Wi-Fi hotspot: Not authorized to control networking.
Once the hotspot is created, you can verify its status by running:
nmcli connection show
You should see the hotspot listed under the active connections.
To share your internet connection through the hotspot, you need to enable IP forwarding:
Enable IP forwarding:
sudo sysctl net.ipv4.ip_forward=1
Make it permanent by editing /etc/sysctl.d/99-sysctl.conf
:
sudo nano /etc/sysctl.d/99-sysctl.conf
Add the following line:
net.ipv4.ip_forward=1
To stop the hotspot, simply run:
nmcli connection down Hotspot