如何调试未释放其 DHCP IP 的服务器?

如何调试未释放其 DHCP IP 的服务器?

看起来我的服务器一直在请求 DHCP 地址,但却不释放旧地址。以前,它直接连接到我的 ISP,并且持有数千个 DHCP 租约(这可能导致全市范围的 DoS)。

服务器仍可访问互联网。此问题不会导致服务器出现连接问题,但其他人无法使用已声明的 IP 地址。

为了找出问题所在,我将其连接到 LAN。不出所料,它耗尽了路由器的 IP 池。所有 IP 地址都可以从本地主机访问(我可以 ping 它,延迟小于 1ms),但不能从外部访问。

dhclient我对服务器如何处理获取/释放 IP 地址没有太多经验。/etc/network/interfaces未经修改,除了allow-hotplug ens5

问题可能始于我

  • 替换sendmailpostfixapt-get install postfix,没有其他内容)
  • 运行apt-get upgrade(更新了内核和一些 PHP 模块,没有其他内容)

我在服务器上没有任何自定义脚本。dmesg很干净。这是一个网络服务器,我所做的大部分工作都是在服务器上nginx或现场进行的(Wordpress)。

我该如何开始调试这个问题?我以前从未遇到过这样的事情。

root@placeholder-not-actual-hostname:~# uname -a
Linux placeholder-not-actual-hostname 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

输出ip a

root@placeholder-not-actual-hostname:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether e0:cb:4e:48:4e:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.249.2/24 brd 255.255.255.255 scope global ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.3/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.4/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.5/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.6/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.7/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.8/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.9/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.10/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.11/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.12/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.13/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.14/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.15/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.16/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.17/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.18/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.19/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.20/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.21/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.22/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.23/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.24/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.25/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.26/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.27/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.28/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.29/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.30/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.31/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.32/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.33/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.34/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.35/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.36/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.37/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.38/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.39/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.40/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.41/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.42/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.43/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.44/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.45/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.46/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.47/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.48/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.49/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.50/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.51/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.52/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.53/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.54/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.55/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.56/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.57/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.58/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.59/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.60/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.61/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.62/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.63/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.64/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.65/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.66/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.67/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.68/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.69/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.70/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.72/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.73/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.74/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.75/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.76/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.77/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.78/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.79/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.80/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.81/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.82/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.83/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.84/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.85/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.86/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.87/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.88/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.89/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.90/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.91/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.92/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.93/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.94/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.95/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.96/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.97/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.98/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.99/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.100/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.101/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.102/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.103/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.104/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.105/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.106/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.107/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.108/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.109/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.110/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.111/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.112/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.113/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.114/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.115/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.116/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.117/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.118/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.119/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.120/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.121/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.122/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.123/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.124/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.125/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.126/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.127/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.128/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.129/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.130/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.131/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.132/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.133/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.134/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.135/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.136/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.137/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.138/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.139/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.140/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.141/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.142/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.143/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.144/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.145/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.146/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.147/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.148/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.149/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.150/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.151/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.152/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.153/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.154/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.155/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.156/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.157/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.158/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.159/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.160/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.161/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.162/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.163/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.164/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.165/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.166/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.167/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.168/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.169/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.170/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.171/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.172/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.173/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.174/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.175/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.176/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.177/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.178/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.179/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.180/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.181/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.182/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.183/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.184/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.185/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.186/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.187/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.188/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.189/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.190/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.191/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.192/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.193/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.194/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.195/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.196/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.197/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.198/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.199/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.200/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.254/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet 192.168.249.71/24 brd 255.255.255.255 scope global secondary ens5
       valid_lft forever preferred_lft forever
    inet6 fe80::e2cb:4eff:fe48:4e28/64 scope link
       valid_lft forever preferred_lft forever
3: wls1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:25:d3:cd:e0:4f brd ff:ff:ff:ff:ff:ff
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none
    inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::f3c8:a059:15d5:5ec7/64 scope link flags 800
       valid_lft forever preferred_lft forever

/etc/network/interfaces.的全部内容/etc/network/interfaces.d/为空。

root@placeholder:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens5
allow-hotplug ens5
iface ens5 inet dhcp

答案1

我已经解决了这个问题。

我在我的回答中指出,获取 IP 地址可以正常工作,但释放租约却不起作用。

我已经检查过了/etc/dhcp/,发现了两个有趣的目录:

root@placeholder:~# ls -lah /etc/dhcp/
total 744K
drwxr-xr-x   4 root root 4.0K Feb 17 08:00 .
drwxr-xr-x 104 root root 720K Feb 18 11:57 ..
-rw-r--r--   1 root root 1.4K Nov 26  2016 debug
drwxr-xr-x   2 root root 4.0K Aug 21  2010 dhclient-enter-hooks.d
drwxr-xr-x   2 root root 4.0K Feb 17 13:46 dhclient-exit-hooks.d
-rw-r--r--   1 root root 1.7K Dec 25 22:41 dhclient.conf

我刚刚发现,dhclient实际上有针对 1.) 获取 DHCP 租约和 2.) 释放 DHCP 租约的钩子。.d目录包含在触发上述事件时运行的 bash 脚本。

由于服务器在释放 DHCP 租约时遇到问题,我检查了dhclient-exit-hooks.d。果然,有一个错误的脚本。sendmail那里有一个脚本尽管返回 0(缺少目录,因为sendmail已卸载),但始终失败。

相关内容