Skip to content

Instantly share code, notes, and snippets.

@johnsimcall
Last active January 4, 2025 09:49
Show Gist options
  • Save johnsimcall/de13dbb62d8788b65359fe8248f4a878 to your computer and use it in GitHub Desktop.
Save johnsimcall/de13dbb62d8788b65359fe8248f4a878 to your computer and use it in GitHub Desktop.
Use NetworkManager to create a WiFi hotspot

Option 1 - more control

nmcli con add type wifi  conn.id "John Hotspot" \
      conn.interface-name wlp0s20f0u1 \
      conn.autoconnect no \
      wifi.mode ap \
      wifi.band a \
      wifi.channel 32 \
      wifi.ssid "John Hotspot" \
      wifi-sec.key-mgmt wpa-psk \
      wifi-sec.psk "12345678" \
      ipv4.method shared
      
# conn.interface-name can be used if multiple WiFi devices exist (e.g. built-in Intel WiFi & NetGear via USB)

Option 2 - less typing

nmcli dev wifi hotspot  ifname wlp0s20f0u1  ssid "John Hotspot"  password "12345678"

# additional options...
# band a   # 5GHz
# band bg  # 2.4GHz
# channel <channel>   # https://en.wikipedia.org/wiki/List_of_WLAN_channels
@johnsimcall
Copy link
Author

Using larger channel widths (e.g. 40MHz and 80MHz) is available in Fedora 41 via wifi.channel-width 40mhz - https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1243

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