Checking for compatible drivers as defined at http://w1.fi/hostapd/
lsmod | grep mac80211
What 802.11
standards is the device able to talk? N
or G
?
lshw -c network | egrep 'product|802.11'
Setting up an IP for that AP service on Slackware
vi /etc/rc.d/rc.inet1 ifconfig wlan0 x.x.x.254/24 up
or Ubuntu w/o netplan
vi /etc/network/interfaces auto wlan0 iface wlan0 inet static address x.x.x.254/24 dns-nameservers 208.67.222.222 208.67.220.220 dns-search as7lab.lan
Slackware
slackpkg search hostapd
Ubuntu
apt install hostapd apt install isc-dhcp-server
I guess we are choosing g
here, but n
might also be fine,
cp /usr/share/doc/hostapd/examples/hostapd.conf /etc/hostapd/hostapd.conf.dist vi /etc/hostapd/hostapd.conf interface=wlan0 #driver=nl80211 #hw_mode=n hw_mode=g #channel=1 ssid=as7lab wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_passphrase=12345678
tail -n0 -F /var/log/*
Slackware
/etc/rc.d/rc.hostapd stop /etc/rc.d/rc.hostapd start
Ubuntu
systemctl unmask hostapd systemctl status hostapd systemctl start hostapd
Setting up the network for that purpose
sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE mv /etc/dhcpd.conf /etc/dhcpd.conf.dist vi /etc/dhcpd.conf #mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.dist #vi /etc/dhcp/dhcpd.conf option domain-name "as7lab.lan"; option domain-search "as7lab.lan"; option domain-name-servers 208.67.222.222, 208.67.220.220; default-lease-time 600; max-lease-time 7200; ddns-update-style none; authoritative; subnet x.x.x.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers x.x.x.254; range x.x.x.100 x.x.x.199; }
Slackware
pkill dhcpd dhcpd -q wlan0
Ubuntu
vi /etc/default/isc-dhcp-server INTERFACESv4="wlan0" INTERFACESv6="wlan0" systemctl restart isc-dhcp-server