Hello, I’m trying to create an AP with hostapd, but with no success, maybe because DHCP configuration.
Does anyone know how to configure this correctly?
Thanks in advance.
Hello, I’m trying to create an AP with hostapd, but with no success, maybe because DHCP configuration.
Does anyone know how to configure this correctly?
Thanks in advance.
Hello Luiz,
I would try it static if you suspect DHCP to be the problem.
You can set it in the /etc/network/interfaces.
Regards
It worked, with static IP, thanks for the reply, after that I used dnsmasq to set DHCP instead of ISP-DHCP and worked too.
ap0
for AP mode (optional, you can use wlan0):iw dev wlan0 interface add ap0 type __ap
Prevent NetworkManager to take care of the interface (/etc/NetworkManager/conf.d/ignore-ap0.conf
):
[keyfile]
unmanaged-devices=interface-name:ap0
systemd
to auto set IP of ap0
interface:create /systemd/network/42-ap0.network
with the following content:
[Match]
Name=ap0
[Network]
Address=192.168.42.1/24
create dnsmasq.d/dnsmasq-mydhcp.conf
listen-address=::1,127.0.0.1,192.168.42.1
domain-needed
bogus-priv
filterwin2k
localise-queries
local=/lan/
expand-hosts
no-negcache
resolv-file=/tmp/resolv.conf.auto
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases
read-ethers
# Plage DHCP
dhcp-range=192.168.42.100,192.168.42.150,12h
# Netmask
dhcp-option=1,255.255.255.0
# Route
dhcp-option=3,192.168.42.1
then restart dnsmasq
systemctl restart dnsmasq
Create /etc/hostapd.conf with the following content:
interface=ap0
driver=nl80211
ssid=dragonAP
hw_mode=g
ieee80211n=1
ht_capab=[DSSS_CCK-40][SHORT-GI-20]
channel=1