0

I have created a rogue access point using airbase-ng, but I can't connect to it using my android phones (note II, S4), when I tap on the access point all I get is: Obtaining IP address...', than disconnects and it tries again and again. I would really appreciate some help, I am quite new to linux...:(

In the terminal I see the same output:

10:43:58  Created tap interface at0
10:43:58  Trying to set MTU on at0 to 1500
10:43:58  Trying to set MTU on wlan0 to 1800
10:43:58  Access Point with BSSID 7A:44:AF:F6:04:C8 started.
10:46:03  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"
10:46:13  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"
10:46:23  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"
10:46:34  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"
10:46:49  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"
10:46:49  Client 5C:F8:A1:40:5F:F0 associated (unencrypted) to ESSID: "default"

steps I am doing:

1.) create the fake WiFi access point using airbase-n:

airbase-ng  wlan0

2.) alocating IP and Subnet:

ifconfig at0 192.168.1.1 netmask 255.255.255.0
ifconfig add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1

3.) start DHCP server

service isc-dhcp-server start

my dhcpd.conf contains the following:

authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.5.0 netmask 255.255.255.0
{
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.5.255;
        option routers 192.168.5.1;
        option domain-name-servers 8.8.8.8;
        range 192.168.5.1 192.168.5.100;
}

systemctl status isc-dhcp-server.service tells the following:

    isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2016-03-03 12:32:51 EET; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3803 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

Mar 03 12:32:49 kali dhcpd[3813]: ** Ignoring requests on wlan1.  If this is not what
Mar 03 12:32:49 kali dhcpd[3813]:    you want, please write a subnet declaration
Mar 03 12:32:49 kali dhcpd[3813]:    in your dhcpd.conf file for the network segment
Mar 03 12:32:49 kali dhcpd[3813]:    to which interface wlan1 is attached. **
Mar 03 12:32:51 kali isc-dhcp-server[3803]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Mar 03 12:32:51 kali isc-dhcp-server[3803]: failed!
Mar 03 12:32:51 kali systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Mar 03 12:32:51 kali systemd[1]: Failed to start LSB: DHCP server.
Mar 03 12:32:51 kali systemd[1]: isc-dhcp-server.service: Unit entered failed state.
Mar 03 12:32:51 kali systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.

interfaces:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.152.187.1
    netmask 255.255.255.0

auto wlan1
  iface wlan1 inet static
    address 192.168.1.0
    netmask 255.255.255.0
1

The answer is right in the logs:

Mar 03 12:32:49 kali dhcpd[3813]: ** Ignoring requests on wlan1.  If this is not what
Mar 03 12:32:49 kali dhcpd[3813]:    you want, please write a subnet declaration
Mar 03 12:32:49 kali dhcpd[3813]:    in your dhcpd.conf file for the network segment
Mar 03 12:32:49 kali dhcpd[3813]:    to which interface wlan1 is attached. **

Your wlan1 interface is on 192.168.1.0 network, and you are trying to start a DHCP server on 192.168.5.0. Change that and it will work.

You are learning Linux, so remember this: ALWAYS read the logs. They will (usually) tell you what is wrong, what was expected and what you should change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.