0

So I am trying to set up a fake AP using airbase-ng. I have set up the dhcp sever and it seems to be working but my outside devices cannot obtain IP address from my newly created Access Point.

I am using ubuntu 18.10. My dhcp.conf is

ddns-update-style none;

# option definitions common to all supported networks...
#option domain-name "example.org";-------------------
#option domain-name-servers ns1.example.org, ns2.example.org;-------------------

default-lease-time 600;
max-lease-time 7200;

authoritative;
log-facility local7;

subnet 192.168.3.0 netmask 255.255.255.0 {
  range 192.168.3.10 192.168.3.20;
}


#subnet 10.254.239.32 netmask 255.255.255.224 {
#  range dynamic-bootp 10.254.239.40 10.254.239.60;
#  option broadcast-address 10.254.239.31;
#  option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
subnet 192.168.88.0 netmask 255.255.255.0 {
 range 192.168.88.100 192.168.88.200;
 #option domain-name-servers ns1.internal.example.org;
 #option domain-name "internal.example.org";
 option subnet-mask 255.255.255.0;
 option routers 192.168.88.255;
 option broadcast-address 192.168.88.255;
 default-lease-time 600;
 max-lease-time 7200;
}

My isc-dhcp-server content:

INTERFACESv4="wlp3s0"
INTERFACESv6=""

And my network/interfaces are:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

When I run sudo systemctl status isc-dhcp-server:

  Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-12-09 16:56:43 +03; 10min ago
     Docs: man:dhcpd(8)
 Main PID: 7789 (dhcpd)
    Tasks: 1 (limit: 4915)
   Memory: 10.3M
   CGroup: /system.slice/isc-dhcp-server.service
           └─7789 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf

Dec 09 16:56:43 vitsuji-N501VW sh[7789]: Sending on   Socket/fallback/fallback-net
Dec 09 16:56:43 vitsuji-N501VW dhcpd[7789]: Sending on   LPF/wlp3s0/7c:b0:c2:64:79:90/192.168.88.0/24
Dec 09 16:56:43 vitsuji-N501VW dhcpd[7789]: Sending on   Socket/fallback/fallback-net
Dec 09 16:56:43 vitsuji-N501VW dhcpd[7789]: Server starting service.
Dec 09 16:57:43 vitsuji-N501VW dhcpd[7789]: DHCPREQUEST for 192.168.88.220 from 7c:b0:c2:64:79:90 via wlp3s0: unknown lease 192.168.88.220.
Dec 09 16:57:54 vitsuji-N501VW dhcpd[7789]: DHCPDISCOVER from 24:18:1d:73:b0:fe via wlp3s0
Dec 09 16:57:54 vitsuji-N501VW dhcpd[7789]: DHCPREQUEST for 192.168.88.223 (192.168.88.1) from 24:18:1d:73:b0:fe via wlp3s0: unknown lease 192.168.88.223.
Dec 09 16:57:55 vitsuji-N501VW dhcpd[7789]: DHCPOFFER on 192.168.88.100 to 24:18:1d:73:b0:fe (Galaxy-S9) via wlp3s0
Dec 09 17:01:57 vitsuji-N501VW dhcpd[7789]: DHCPREQUEST for 192.168.88.220 from 7c:b0:c2:64:79:90 via wlp3s0: unknown lease 192.168.88.220.
Dec 09 17:06:22 vitsuji-N501VW dhcpd[7789]: DHCPREQUEST for 192.168.88.220 from 7c:b0:c2:64:79:90 via wlp3s0: unknown lease 192.168.88.220.

I think the problem is the unknown lease in the dhcp status above. That may be why my Samsung couldn't connect. But I do not know how to solve the issue.

Any help would be really appreciated.

3
  • 1
    Why do you have two subnets defined without any client-matching?
    – vidarlo
    Dec 9, 2018 at 14:33
  • I don't understand.
    – Hakorou
    Dec 9, 2018 at 20:33
  • You have two subnet declarations, one for 192.168.3.0/24 and one for 192.168.88.0/24. Why do you have two subnet declarations on one interface?
    – vidarlo
    Dec 9, 2018 at 20:47

1 Answer 1

0

You have two subnet declarations in your configuration, but only one interface. This may be used in some instances, but usually you would match on some client identifier or similar discriminator to allow dhcpd to know which subnet to use.

You do not have any such discriminators as far as I can tell, and thus dhcpd does not know which subnet to use. This commonly leads to the somewhat imprecise error message that it's an unknown lease.

Remove the subnet declaration you do not use, which, according to your logs and configuration, is this:

subnet 192.168.3.0 netmask 255.255.255.0 {
  range 192.168.3.10 192.168.3.20;
}

Simply remove it or comment it out (prepend each line with # to comment it out), and restart dhcpd and test again.

1
  • Thanks for the suggestion I did that but there still seems to be an error. My device is not connecting to the dhcp server and dhcp status gives this in red: in your dhcpd.conf file for the network segment Dec 13 14:00:31 vitsuji-N501VW dhcpd[14901]: to which interface docker0 is attached. **
    – Hakorou
    Dec 13, 2018 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .