Skip to content
Search

Hostapd

lastmod 2026-03-31created 2021-01-2210 edits

hostapd is user-space daemon software that enables a network interface card to act as an access point and authentication server. There are three implementations: Jouni Malinen's hostapd, OpenBSD's hostapd, and Devicescape's hostapd.

DNS servers used together

Soft AP

Install packages:

sudo apt-get install dnsmasq hostapd

If NetworkManager is installed, /etc/NetworkManager/NetworkManager.conf

[keyfile]
unmanaged-devices=mac:{WLAN MAC 주소}

Using the DHCP service of dnsmasq, /etc/dnsmasq.conf:

interface=wlan0
bind-interfaces
except-interface=lo
dhcp-range=192.168.0.100,192.168.0.150,24h

System settings and firewall settings:

sudo sysctl -w net.ipv6.conf.wlan0.disable_ipv6=1
sudo sysctl -w net.ipv4.ip_forward=1
sudo ifconfig wlan0 192.168.0.1
sudo service dnsmasq restart
sudo iptables -A FORWARD -i wlan0 -o eth0 -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
sudo iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

/etc/hostapd/hostapd.conf for hostapd:

interface=wlan0
driver=nl80211
ssid=SSID
hw_mode=g
channel=10
macaddr_acl=0
auth_algs=3
wpa=2 
wpa_passphrase=비밀번호 
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=TKIP CCMP
sudo hostapd /etc/hostapd/hostapd.conf

See also

Favorite site

author Zer0 sitemap