DHCP 服务器未知租约。设备显示“无法获取 IP”

DHCP 服务器未知租约。设备显示“无法获取 IP”

因此,我尝试使用 airbase-ng 设置一个假 AP。我已经设置了 dhcp 服务器,它似乎在工作,但我的外部设备cannot obtain IP address来自我新创建的接入点。

我正在使用 ubuntu 18.10。我的 dhcp.conf 是

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;
}

我的isc-dhcp-server内容:

INTERFACESv4="wlp3s0"
INTERFACESv6=""

我的网络/接口是:

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

当我跑步时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.

我认为问题在于上面的 dhcp 状态中的未知租约。这可能是我的三星无法连接的原因。但我不知道如何解决这个问题。

任何帮助将非常感激。

答案1

您的配置中有两个子网声明,但只有一个接口。在某些情况下可能会用到,但通常您会匹配一些客户端标识符或类似的鉴别符,以允许 dhcpd 知道要使用哪个子网。

据我所知,您没有任何此类鉴别器,因此 dhcpd 不知道要使用哪个子网。这通常会导致出现不太准确的错误消息,即这是未知租约。

删除您不使用的子网声明,根据您的日志和配置,其含义如下:

subnet 192.168.3.0 netmask 255.255.255.0 {
  range 192.168.3.10 192.168.3.20;
}

只需将其删除或注释掉(在每行前面加上#注释),然后重新启动 dhcpd 并再次测试。

相关内容