Create a WiFi Hotspot

This guide explains how to set up a WiFi hotspot on the ALPON X4 using nmcli, the NetworkManager command-line tool. It's a simple and efficient way to share your internet connection.


Step 1: Create the WiFi Hotspot

  • Open a terminal on the ALPON X4.
  • Use the following command to create a WiFi hotspot. Replace <YourSSID> and <YourStrongPassword> with your desired network name and password:
nmcli connection add \
    type wifi \
    ifname wlan0 \
    con-name hotspot-shared \
    ipv4.method shared \
    ipv4.addresses 192.168.10.1/24 \
    wifi.mode ap \
    wifi.ssid <YourSSID> \
    wifi-sec.key-mgmt wpa-psk \
    wifi-sec.psk <YourStrongPassword>
root@alpon-2wcg67e19263:~# nmcli connection add \ type wifi \ ifname wlan0 \ con-name hotspot-shared \ ipv4.method shared \ ipv4.addresses 192.168.10.1/24 \ wifi.mode ap \ wifi.ssid Hotspot \ wifi-sec.key-mgmt wpa-psk \ wifi-sec.psk SecurePassword123! Connection 'hotspot-shared' (9260000e-8Wg0-2w7v-1199-e8b85f18lbee) successfully added.
wlan0The WiFi interface used for the hotspot.
<YourSSID>Your WiFi network's name.
<YourStrongPassword>A strong password for your WiFi network.

❗️

Important

  • The default Sixfab applications on the ALPON X4 use the 100.0.0.0/16 subnet, and the container management system operates on a separate subnet.
  • To avoid conflicts, ensure the subnet 192.168.10.1/24 or any other subnet you choose does not overlap with the Sixfab subnets.


Step 2: Start & Verify the Hotspot

  • Start the hotspot with the command:
nmcli connection up hotspot-shared
root@alpon-2wcg67e19263:~# nmcli connection up hotspot-shared Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)
  • Verify the hotspot is active by listing connections:
nmcli connection show
root@alpon-2wcg67e19263:~# nmcli connection show NAME UUID TYPE DEVICE hotspot-shared *** wifi wlan0 Wired connection 3 *** ethernet usb0 cni0 *** bridge cni0 dummy0 *** dummy dummy0 flannel.1 *** vxlan flannel.1 lo *** loopback lo sfnetwork *** tun sfnetwork Wired connection 1 *** ethernet eth0 docker0 *** bridge docker0 Wired connection 2 *** ethernet --

You should see hotspot-shared in the list of active connections.



Step 3: Test the Hotspot

  • Connect a device (e.g., smartphone or laptop) to the hotspot using the SSID and password you set earlier.
  • Verify the device can access the internet.


Step 4: Deactivate the Hotspot

To stop and delete the hotspot configuration, run:

nmcli connection delete hotspot-shared


Conclusion

Setting up a WiFi hotspot using nmcli is a quick and efficient way to share your internet connection on the ALPON X4. The integration with NetworkManager ensures easy management and avoids manual configuration.



Troubleshooting: Common Issues and Fixes

 Error Adding Connection

Error Message:

Error:Failed to add 'hotspot-shared' connection: 802-11-wireless-security.psk: property is invalid

Cause
This error usually occurs when the WiFi password (PSK) provided does not meet the security requirements of WPA2 standards. WPA2 passwords must:

  • Be at least 8 characters long.
  • Contain a mix of letters, numbers, and symbols for security.

Solution

  • Update the command with a password that meets these requirements. For example:
wifi-sec.psk "SecurePassword123!"
  • Re-run the nmcli connection add command with the updated password.

 Command Not Found or NetworkManager Missing

nmcli commands fail with "command not found" or NetworkManager is unavailable.

Solution

  • Ensure NetworkManager is installed:
sudo apt update  
sudo apt install network-manager
  • Restart NetworkManager service:
sudo systemctl restart NetworkManager