如何调试 DHCP 故障?

如何调试 DHCP 故障?

我在 Windows 11 上的 VMware Player 17 上安装了 Ubuntu 22.04.2 的新虚拟机。使用静态 IP 一切正常,但我无法让 DHCP 工作,因为北向似乎已收到回复。

mat@devbox:~$ sudo dhclient -v
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/ens33/00:0c:29:9a:27:bb
Sending on   LPF/ens33/00:0c:29:9a:27:bb
Sending on   Socket/fallback
DHCPDISCOVER on ens33 to 255.255.255.255 port 67 interval 3 (xid=0xe24e363f)
DHCPDISCOVER on ens33 to 255.255.255.255 port 67 interval 3 (xid=0xe24e363f)
^C

tcpdump显示数据包,但没有返回任何内容

mat@devbox:~$ sudo tcpdump -i ens33 port 67 or port 68 -e -n -vv
tcpdump: listening on ens33, link-type EN10MB (Ethernet), snapshot length 262144 bytes
11:38:23.059861 00:0c:29:9a:27:bb > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:9a:27:bb, length 300, xid 0x77a96118, Flags [none] (0x0000)
      Client-Ethernet-Address 00:0c:29:9a:27:bb
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message (53), length 1: Discover
        Hostname (12), length 6: "devbox"
        Parameter-Request (55), length 13: 
          Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
          Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
          Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
          NTP (42)

Windows 主机上的 Wireshark 显示我的 VM 没有收到任何流量,但当我打开另一台主机时工作正常:

No.    Time        Source       Destination      Protocol  Length  Info
139    9.071516    0.0.0.0      255.255.255.255  DHCP      342     DHCP Discover - Transaction ID 0x77a96118
140    9.071526    0.0.0.0      255.255.255.255  DHCP      342     DHCP Discover - Transaction ID 0x77a96118
...
12202  369.907494  0.0.0.0      255.255.255.255  DHCP      344     DHCP Discover - Transaction ID 0x3a951626
12233  370.931839  192.168.1.1  255.255.255.255  DHCP      342     DHCP Offer    - Transaction ID 0x3a951626
12236  371.034456  0.0.0.0      255.255.255.255  DHCP      370     DHCP Request  - Transaction ID 0x3a951626
12237  371.034456  192.168.1.1  255.255.255.255  DHCP      342     DHCP ACK      - Transaction ID 0x3a951626

我的 OPNsense DHCP 服务器显示它发送了DHCPOFFER

2023-04-16T11:38:24 dhcpd[68501]    DHCPOFFER on 192.168.1.25 to 00:0c:29:9a:27:bb (devbox) via vtnet3_vlan101   
2023-04-16T11:38:23 dhcpd[68501]    DHCPDISCOVER from 00:0c:29:9a:27:bb via vtnet3_vlan101

我该如何进一步调试它?

答案1

如何调试?不要一下子改变一切。但如果这样做,请准备好花一天左右的时间检查所有内容。

事实证明 VMware 17.0.1 在网络桥接方面存在错误,请参阅Workstation Pro/Player 最新更新 17.0.1 破坏了网桥连接。降级到 17.0.0 解决了这个问题!(虽然我的安装文件是,但VMware-workstation-full-17.0.0-20800274.exe它肯定很快就自行更新了,因为重新安装该文件已经解决了这个问题)。

它不是:

  • OPNsense 防火墙
  • Windows 防火墙
  • 无线网络接入点
  • 皮孔

相关内容