Advanced Network Setup
For the captive portal to work correctly, the operating system must act as an access point and provide basic network services (DHCP and DNS).
1. Install Requirements
Section titled “1. Install Requirements”sudo apt updatesudo apt install hostapd dnsmasq2. Network Interface Configuration
Section titled “2. Network Interface Configuration”Assign a static IP to the WiFi hotspot interface:
sudo ip addr add 192.168.10.1/24 dev wlx1cbfce41183asudo ip link set wlx1cbfce41183a up3. hostapd Configuration (Access Point)
Section titled “3. hostapd Configuration (Access Point)”Create or edit /etc/hostapd/hostapd.conf:
interface=wlx1cbfce41183adriver=nl80211ssid=My_WiFi_Networkhw_mode=gchannel=6auth_algs=1wmm_enabled=0macaddr_acl=0ignore_broadcast_ssid=0To enable it, edit /etc/default/hostapd:
DAEMON_CONF="/etc/hostapd/hostapd.conf"4. dnsmasq Configuration (DHCP and DNS)
Section titled “4. dnsmasq Configuration (DHCP and DNS)”Edit /etc/dnsmasq.conf:
interface=wlx1cbfce41183abind-interfacesdhcp-range=192.168.10.10,192.168.10.100,255.255.255.0,12hdhcp-option=3,192.168.10.1dhcp-option=6,192.168.10.1,8.8.8.8server=8.8.8.85. Start Services
Section titled “5. Start Services”sudo systemctl unmask hostapdsudo systemctl enable hostapdsudo systemctl restart hostapd
sudo systemctl enable dnsmasqsudo systemctl restart dnsmasq6. Common Troubleshooting
Section titled “6. Common Troubleshooting”- Interface “Busy”: Configure NetworkManager to ignore the WiFi interface by adding to
/etc/NetworkManager/conf.d/99-catsplash.conf:[keyfile]unmanaged-devices=interface-name:wlx1cbfce41183a - DNS not responding: Check that port 53 is not blocked by
systemd-resolvedor another service.