How to create a Wi-Fi hotspot with the command line tool
nmcli and share the ethernet internet connection to the wireless access point.
I created a Hotspot with the GNOME Network-Manager. The problem was, that I can not configure the SSID and password in GUI. If you create the Hotspot with the Network-Manager GUI, it creates the file
/etc/NetworkManager/system-connections/Hotspot. In that file it is possible to edit the SSID and the password.
sudo vim /etc/NetworkManager/system-connections/Hotspot
The content of the file looks like this:
[connection] id=Hotspot uuid=0bf627gd-8e34-48c6-865a-06f898b4y1hb type=wifi autoconnect=false permissions= secondaries= [wifi] hidden=false mac-address=YOUR_WIFI_INTERFACE_MAC_ADDRESS mac-address-blacklist= mode=ap seen-bssids= ssid=SSID_NAME [wifi-security] group=ccmp; key-mgmt=wpa-psk pairwise=ccmp; proto=rsn; psk=YOUR_WIFI_AP_PASSWORD [ipv4] dns-search= method=shared [ipv6] dns-search= method=auto
I changed the
ssid and the
psk properties to my needs. To enable autostart you have to set the parameter
true. Then I restarted my computer because the command:
sudo systemctl restart NetworkManager for network restart seems not to work correctly, because in the Network-Manager GUI:
I have no wireless network settings anymore and also the following command worked not before the restart. After restart you can use the
nmcli command to start the access point.
nmcli con up Hotspot ifname YOUR_WIFI_INTERFACE
YOUR_WIFI_INTERFACE you can find out with the command
I found the hint to this at the ask.fedoraproject.org site.