I have created a hotspot following a previous post . In this post I explain how I avoided the errors and succussfully created the hotspot on Kali Linux.
- If you have a fresh installation of Kali Linux, first ensure the internet connection. If you are connected to Wi-Fi and still having no internet, then use the following command.
sudo dhclient eth0 or sudo dhclient wlan0
- Next, install hostapd(hotspot server) and dnsmasq (dns dhcp server).
apt-get install hostapd dnsmasq
- Prevent the installed services starting at the start up
sudo service hostapd stop sudo service dnsmasq stop sudo update-rc.d hostapd disable sudo update-rc.d dnsmasq disable
- Setup the configuration file of dnsmasq.
gedit /etc/dnsmasq.conf
# Bind to only one interface bind-interfaces interface=wlan0 dhcp-range=192.168.150.2,192.168.150.10
- Setup the configuration file of hostapd.
gedit /etc/hostapd.conf
interface=wlan0 driver=nl80211 ssid=myhotspot # Set access point harware mode to 802.11n hw_mode=g ieee80211n=1 channel=6
- Create hotspot.sh.
#!/bin/bash # Start sudo ifconfig wlan0 192.168.150.1 sudo service dnsmasq restart sudo sysctl net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o eth0-j MASQUERADE sudo hostapd /etc/hostapd.conf sudo iptables -D POSTROUTING -t nat -o eth0-j MASQUERADE sudo sysctl net.ipv4.ip_forward=0 sudo service dnsmasq stop sudo service hostapd stop
- Now, execute the shell script
sh <path to hotspot.sh>
Error:
nl80211: Could not configure driver mode nl80211: deinit infname=wlan0 disabled_lib_rates=0....
Solution:
airmon-ng check killall wpa_supplicant sh <path to hotspot.sh>
A device is connected to the hotspot!!
Cheers !! 🙂
Thanks, this is very helpful. I followed all this and was able to connect to the hotspot from another PC but the internet connection was not shared through the hotspot. Internet is working on Kali PC on eth0.
LikeLike
Turned out to be a problem on Windows PC connecting to hotspot – it had a fixed IP, worked fine when I changed it to DHCP.
LikeLike
can`t create hotspot on parrot
LikeLike
New to linux 😦 However, I followed the instructions, as well as the referenced earlier guide. I get no errors when I enter ‘# ./hotspot.sh’, but I get no messages at all. I also get no hot spot. Any suggestions? Thank you.
LikeLike