I use kali-rolling on a virutal machine and I try to set up a fake access point using airbase-ng
, but my devices won't connect to it whatsoever. My steps are:
I put my wirless adapter in monitor mode with airmon-ng
and then run airbase-ng
to clone my original AP, then I set up the configuration for the dhcp server in /etc/dhcp/dhcpd.conf
as follows:
authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0
{
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8;
option routers 192.168.1.1;
range 192.168.1.10 192.168.1.100;
}
Interfaces in /etc/default/isc-dhcp-server
:
INTERFACESv4="at0"
INTERFACESv6=""
I then fire up the interface at0
:
ifconfig at0 up
ifconfig at0 192.168.2.1 netmask 255.255.255.0
route add default gw 192.168.1.1 at0
And to give my clients network access I set up iptables
to forward traffic sent to my fake AP to the interface eth0
which is bridged to the ethernet interface of my host machine.
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD -j ACCEPT --in-interface at0
echo 1 > /proc/sys/net/ipv4/ip_forward
After that, I try to connect to this AP from any device, and none is able to connect to it, just says "Obtaining IP address" and that the AP is saved and then nothing. Could someone help me figure out what is going wrong?