Hostapd
Share on:Edit on:Clone the hostapd from official git repository
git clone git://w1.fi/srv/git/hostap.git
cd hostapd/hostapd
Create .config file
cp defconfig .config
Uncomment the following macros in .config file
CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL32=y
Compile the hostapd
make
If any dependency error occured and hostapd compilation terminated, apt-file
package would be useful to find out dependency packages.
sudo apt install apt-file
apt-file update
For example: If the following error displayed,
fatal error: netlink/genl/genl.h: No such file or directory
Then find the dependency using the following command.
apt-file search /netlink/genl/genl.h
This will display the dependency package to be installed like below:
libnl-3-dev: /usr/include/libnl3/netlink/genl/genl.h
Now install the package:
sudo apt install libnl-3-dev
Following packages might also be needed to compile hostapd:
sudo apt install libssl-dev
sudo apt install libnl-genl-3-dev
Releasing wifi interface from network-manager
For hostapd to run successfully, first we need to release wifi interface (ex: wlp4s0
or wifi0
) from network-manager.
sudo nmcli radio wifi off
sudo rfkill unblock wlan
Change interface name if required
On newer Ubuntu based systems the wifi interface name is something like wlp4s0
or wlp6s0
. Replace interface=wlan0
with interface=<your_wifi_interface>
in hostapd.conf file.
Run hostapd
sudo ./hostapd -dd ./hostapd.conf