Original post : https://unix.stackexchange.com/a/310699
nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes 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 con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
nmcli con up Hostspot
If after reboot nmcli con up Hotspot doesn't work
Use this command instead to start Hotspot
UUID=$(grep uuid /etc/NetworkManager/system-connections/Hotspot | cut -d= -f2)
nmcli con up uuid $UUID
I tried
nmcli dev wifi hotspotbut it didn't provide Internet connection.is it possible to replicate Windows' hotspot behavior? where the hotspot has internet connection from the same wireless network card that being used as hotspot as well.
I'm looking for networkmanager-only solution to avoid installing another dependency.
EDIT:
problem solved, thanks to this comment, I ended up using create_ap from linux-wifi-hotspot instead of networkmanager' nmcli.
I just need to specify the channel
the appropriate channel number can be found by: