Skip to main content

Wi-Fi Hotspot Configuration Guide

This document provides instructions on how to enable the Wi-Fi Hotspot feature , sharing the internet connection from the Ethernet port (eth0) to wireless clients (wlan0/mlan0).

Prerequisites

Before proceeding, ensure your device meets the following requirements:

  • An active internet connection via Ethernet (eth0).
  • A wireless network interface (wlan0/mlan0) that supports Access Point (AP) mode.
  • Administrative (sudo) privileges.

Identify Network interface

Depending on the Wi-Fi module installed on product, the network interface names may differ from the standard wlan0 and eth0. For example, IMX95/IMX93/IMX91 may use IW416/IW611 Wi-Fi module, and register the wireless interface as mlan0. Similarly, devices with multiple Ethernet ports might use eth1 for the external internet connection.


Identify network interface by ifconfig.
For example:

  • EDM-G-IMX8MP, use eth0 and wlan0
root@edm-g-imx8mp:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.88.93.165 netmask 255.255.248.0 broadcast 10.88.95.255
inet6 fe80::d7d7:91ba:b8b3:288d prefixlen 64 scopeid 0x20<link>
ether 00:1f:7b:50:0d:3e txqueuelen 1000 (Ethernet)
RX packets 3207 bytes 1294723 (1.2 MiB)
RX errors 0 dropped 1025 overruns 0 frame 0
TX packets 1202 bytes 179085 (174.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 216

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.1 netmask 255.255.255.0 broadcast 192.168.4.255
ether ce:7b:48:98:d6:7a txqueuelen 3000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
  • EDM-IMX93, use eth1 and mlan0
root@edm-imx93:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:1f:7b:aa:02:fe txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.88.94.177 netmask 255.255.248.0 broadcast 10.88.95.255
inet6 fe80::8897:c87:eb65:fef1 prefixlen 64 scopeid 0x20<link>
ether 00:1f:7b:aa:02:ff txqueuelen 1000 (Ethernet)
RX packets 5220 bytes 637732 (622.7 KiB)
RX errors 0 dropped 2715 overruns 0 frame 0
TX packets 139 bytes 11292 (11.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 107

mlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.1 netmask 255.255.255.0 broadcast 0.0.0.0
ether ea:a5:37:59:00:e8 txqueuelen 1000 (Ethernet)
RX packets 888 bytes 54585 (53.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 128 bytes 12701 (12.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Note

The following instructions use a standard network interface with as wlan0 and eth0 an example.
The commands must be modified according to the actual situation.


Enable Wi-Fi Hotspot on GNOME GUI

The hotspot feature requires specific backend components to handle wireless protocols and IP address assignment.
Run the following command in the terminal:

1. Install Required Packages

sudo apt-get update
sudo apt-get install hostapd dnsmasq -y

2. Stop Conflicting Services
Since GNOME's NetworkManager will manage the hotspot, ensure the manual services are not occupying the hardware:

sudo systemctl stop hostapd dnsmasq

3. Network Routing and NAT
To allow connected devices to access the internet through the device, you must enable IP forwarding and configure NAT (Network Address Translation) rules.

3.1 Enable IP Forwarding
Enable IPv4 forwarding in the kernel to allow traffic to pass between interfaces:

sudo sysctl -w net.ipv4.ip_forward=1

3.2 Configure NAT and Firewall Rules
Set up the firewall to "masquerade" traffic from the wireless hotspot through the Ethernet interface:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

4. Enabling the Hotspot via GNOME GUI
Once the backend is configured, you can activate the hotspot using the GUI interface:

  • Launch Settings APP.
  • Select Wi-Fi 🛜 from the left-hand sidebar.
  • Select Turn On Wi-Fi Hotspot.
  • Enter your desired Network Name (SSID) and Password.
  • Click Turn On.

A QR Code will now appear on the screen. Mobile devices can scan this code to connect to the network and access the internet automatically.


Manual Wi-Fi Hotspot Configuration Guide (CLI Mode)

This guide provides step-by-step instructions for manually configuring a Wi-Fi Hotspot (no GUI/GNOME).
This method uses hostapd for the access point and dnsmasq for DHCP/DNS services.
Use this method for devices without a desktop environment or when you require full control over the networking stack.

1. Install Required Packages
Install the necessary tools for the access point and DHCP services:

sudo apt-get update
sudo apt-get install hostapd dnsmasq -y

2. Configure the Wi-Fi Access Point (hostapd)
hostapd is the daemon that allows your wireless card to act as an access point.

2.1 Create the Configuration File
Create and edit the configuration file:

sudo vi /etc/hostapd/hostapd.conf

Add the following content:

interface=wlan0
driver=nl80211
ssid=MyWiFiNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
Note

Adjust interface, ssid and wpa_passphrase if needed

2.2 Point the System to the Config File
Edit the default daemon settings:

sudo vi /etc/default/hostapd

Find the line #DAEMON_CONF="", uncomment and change it to:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

3. Manage Services
To avoid conflicts, you must disable the standard Wi-Fi client manager (wpa_supplicant) and enable the access point service.

# Stop and mask Network Manager/Supplicant to prevent interference
sudo systemctl stop wpa_supplicant
sudo systemctl mask wpa_supplicant

# Unmask and start the Hotspot service
sudo systemctl unmask hostapd
sudo systemctl enable hostapd
sudo systemctl start hostapd

4. Configure DHCP and DNS (dnsmasq)
dnsmasq provides IP addresses to devices that connect to your hotspot.

4.1 Backup and Edit Configuration

# Backup the original config
sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.org

# Edit the new config
sudo vi /etc/dnsmasq.conf

Add the following lines on the top to define the IP range for connected clients:

interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h

5. Network Routing and NAT
Now, assign a static IP to the wireless interface and set up the routing to share the Ethernet (eth0) internet connection.

5.1 Interface and IP Forwarding

# Assign static IP to wlan0
sudo ip addr add 192.168.4.1/24 dev wlan0
sudo ip link set wlan0 up

# Enable IP forwarding in the kernel
sudo sysctl -w net.ipv4.ip_forward=1

5.2 Configure NAT (Firewall)
Use iptables to route traffic from the hotspot to the internet-facing Ethernet port:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

# Restart dnsmasq to apply DHCP settings
sudo systemctl restart dnsmasq

6. Connection Verification
Your hotspot is now active. To connect:

  • Open the Wi-Fi settings on your client device (phone/laptop).
  • Search for the network name: MyWiFiNetwork.
  • Enter the password: 12345678.

Troubleshooting

Check hostapd service status by command sudo systemctl status hostapd.service
More detail logs by command journalctl -xeu hostapd.service

Example1: hostapd.conf is incorrect

root@edm-g-imx8mp:~# systemctl status hostapd.service
○ hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
Loaded: loaded (/usr/lib/systemd/system/hostapd.service; enabled; preset: enabled)
Active: inactive (dead)
Condition: start condition unmet at Thu 2026-03-12 01:21:11 UTC; 55min ago
Docs: man:hostapd(8)
Mar 12 01:21:11 edm-g-imx8mp systemd[1]: hostapd.service - Access point and authentication server for Wi-Fi and Ethernet was skipped because of an unmet condition check (ConditionFileNotEmpty=/etc/hostapd/hostapd.conf).
root@edm-g-imx8mp:~# journalctl -xeu hostapd.service
░░ The process exit code is 'exited' and its exit status is 1.
...
Mar 12 02:21:50 edm-g-imx8mp systemd[1]: hostapd.service: Failed with result 'exit-code'.
Mar 12 02:21:52 edm-g-imx8mp (hostapd)[5058]: hostapd.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Mar 12 02:21:52 edm-g-imx8mp hostapd[5058]: Line 1: unknown configuration item 'nterface'
Mar 12 02:21:52 edm-g-imx8mp hostapd[5058]: 1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Mar 12 02:21:52 edm-g-imx8mp hostapd[5058]: Failed to set up interface with /etc/hostapd/hostapd.conf
Mar 12 02:21:52 edm-g-imx8mp hostapd[5058]: Failed to initialize interface
Mar 12 02:21:52 edm-g-imx8mp systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
...

Example2: interface name is incorrect, need to match the same interface from ifconfig
Interface name is wlan0 in hostapd.conf, but interface name from ifconfig is mlan0.

root@edm-g-imx8mp:~# journalctl -xeu hostapd.service
...
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: Could not read interface wlan0 flags: No such device
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: nl80211: Driver does not support authentication/association or connect commands
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: Could not read interface wlan0 flags: No such device
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: nl80211 driver initialization failed.
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: wlan0: interface state UNINITIALIZED->DISABLED
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: wlan0: AP-DISABLED
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: wlan0: CTRL-EVENT-TERMINATING
Mar 12 02:29:39 edm-g-imx8mp hostapd[5405]: hostapd_free_hapd_data: Interface wlan0 wasn't started
Mar 12 02:29:39 edm-g-imx8mp systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
root@edm-g-imx8mp:~# ifconfig
...
mlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
...

Example3: The device connected to the hotspot shown an error message "Can't provide internet"
Please double check commands in "Network Routing and NAT" section. They should match wireless name and ethernet name from ifconfig.