Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save max-pfeiffer/9e8e76d190698cc8381b75399c1ded1d to your computer and use it in GitHub Desktop.
Save max-pfeiffer/9e8e76d190698cc8381b75399c1ded1d to your computer and use it in GitHub Desktop.
Create a Wifi Hotspot on Raspberry Pi with NetworkManager

Create a Wifi Hotspot on Raspberry Pi with NetworkManager (Rasbian v12, Debian Bookworm)

Create a wifi hotspot like this:

sudo nmcli connection add con-name <NAME> type wifi ifname <INTERFACE> wifi.mode ap wifi.ssid <SSID> wifi-sec.key-mgmt wpa-psk wifi-sec.psk <PASSWORD> ipv4.method shared

That is a minimal configuration which should work on all Raspberry Pi devices from v3 upwards. Problem with this configuration is, that it only provides weak WPA encryption/security.

To remedy this you can switch on some additonal security features:

sudo nmcli connection modify <NAME> wifi-sec.proto rsn wifi-sec.pairwise ccmp wifi-sec.group ccmp

But this could result in clients not being able to connect to the Hotspot.

You can also use a more convenient configuration shortcut, which provides a Hotspot with these security features already enabled:

sudo nmcli device wifi hotspot con-name <NAME> ifname <INTERFACE> ssid <SSID> password <PASSWORD> 

Create Hotspot On Startup

If you want to have the hotspot up and running after reboot, you need to modify the connection with these parameters:

sudo nmcli connection modify <name> connection.autoconnect yes connection.autoconnect-priority 100

Official Documentation

See: https://networkmanager.dev/docs/api/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment