Skip to content

Instantly share code, notes, and snippets.

@Pupwiz
Forked from narate/create-hotspot.md
Created July 23, 2025 21:20
Show Gist options
  • Select an option

  • Save Pupwiz/649690ec57320a7d1677ce655d3d9fc4 to your computer and use it in GitHub Desktop.

Select an option

Save Pupwiz/649690ec57320a7d1677ce655d3d9fc4 to your computer and use it in GitHub Desktop.
Create Wi-Fi Hotspot on Linux using nmcli
#!/bin/bash
echo 'Original post : https://unix.stackexchange.com/a/310699'
nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect no ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli conn modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
nmcli con up Hostspot
# Note after reboot `nmcli con up Hotspot` doesn't work
# Use this command instead
#-------------------------
# UUID=#(grep uuid /etc/NetworkManager/system-connections/Hotspot | cut -d= -f2)
# nmcli con up uuid $UUID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment