User Tools

Site Tools


ap_mode

IWD & AP Mode

iwd supports very basic AP mode functionality.

Hotspot / Connection Sharing Example

The easiest way to set this up is to create a new Access Point profile. For detailed documentation of all properties, please refer to 'man 5 iwd.ap'. First create '/var/lib/iwd/ap' directory if it doesn't exist yet:

# sudo mkdir -p /var/lib/iwd/ap/

Then place the following contents in the file /var/lib/iwd/ap/<ssid>.ap where <ssid> will be used as the SSID of the Access Point when it is started:

[Security]
Passphrase=password123

[IPv4]
Address=192.168.250.1
Gateway=192.168.250.1
Netmask=255.255.255.0
DNSList=8.8.8.8

With iwd started, start iwctl and switch your device into ap mode, then start the AP mode with the just-created profile:

[iwd]# device wlan0 set-property Mode ap
[iwd]# ap wlan0 start-profile test
[iwd]# 

Set up NAT:

# sudo sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
# sudo iptables -t nat -A POSTROUTING -s 192.168.250.0/24 -j MASQUERADE

You should now be able to connect to SSID 'test' and be able to reach whatever outside world that the box running the access point mode can reach.

ap_mode.txt · Last modified: 2021/05/26 23:27 by Denis Kenzior