DHCP 服务器提供错误的 IP 地址和 DHCP 服务器失败 Apipa 正在使用

网络工程 dhcp 数据包追踪器
2021-08-01 01:23:42

我的问题是,当我尝试使用 DHCP 服务器提供 IP 地址时,它提供的 IP 地址是 DHCP 服务器的默认网关,它只向一台 PC 提供 IP 地址,其余的 PC 我得到了错误 DHCP 失败 APIPA 正在使用

非常感谢所有帮助将不胜感激

在此处输入图片说明

路由器配置:

Current configuration : 2394 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname HQ
!
!
!
enable secret 5 $1$mERr$GvDaTJK9lhdXRUPWKA74O0
!
!
!
!
!
!
no ip cef
ipv6 unicast-routing
!
no ipv6 cef
!
!
!
username isp password 0 isppassword
!
!
!
!
!
!
!
!
ip ssh version 2
ip domain-name ccnars.com
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.9
 encapsulation dot1Q 9
 ip address 172.16.1.41 255.255.255.248
!
interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 172.16.1.33 255.255.255.248
!
interface FastEthernet0/0.15
 encapsulation dot1Q 15
 ip address 172.16.1.17 255.255.255.240
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 172.16.1.1 255.255.255.240
!
interface FastEthernet0/0.25
 encapsulation dot1Q 25
 ip address 172.16.0.241 255.255.255.240
!
interface FastEthernet0/0.30
 encapsulation dot1Q 30
 ip address 172.16.0.225 255.255.255.240
!
interface FastEthernet0/0.40
 encapsulation dot1Q 40
 ip address 172.16.0.193 255.255.255.224
!
interface FastEthernet0/0.45
 encapsulation dot1Q 45
 ip address 172.16.0.161 255.255.255.224
!
interface FastEthernet0/0.50
 encapsulation dot1Q 50
 ip address 172.16.0.129 255.255.255.224
!
interface FastEthernet0/0.55
 encapsulation dot1Q 55
 ip address 172.16.0.97 255.255.255.224
 ip helper-address 172.16.0.99
!
interface FastEthernet0/0.60
 encapsulation dot1Q 60
 ip address 172.16.0.65 255.255.255.224
 ip helper-address 172.16.0.99
!
interface FastEthernet0/0.65
 encapsulation dot1Q 1 native
 ip address 172.16.0.1 255.255.255.192
 ip helper-address 172.16.0.99
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 no ip address
 clock rate 2000000
 shutdown
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Serial0/1/0
 ip address 122.49.0.129 255.255.255.224
 ipv6 address 2000:ACAD:2017:0:7A31::129/94
 ipv6 enable
!
interface Serial0/1/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 122.49.0.130 
!
ip flow-export version 9
!
ipv6 route ::/0 2000:ACAD:2017:0:7A31::130
!
!
!
!
!
!
line con 0
 password password
 login
!
line aux 0
!
line vty 0 3
 login local
line vty 4
 login
!
!
!
end

连接到路由器的 L3 交换机的配置:

Current configuration : 2126 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/3
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/4
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/5
 duplex full
 speed 100
!
interface FastEthernet0/6
 duplex full
 speed 100
!
interface FastEthernet0/7
 duplex full
 speed 100
!
interface FastEthernet0/8
 duplex full
 speed 100
!
interface FastEthernet0/9
 duplex full
 speed 100
!
interface FastEthernet0/10
 duplex full
 speed 100
!
interface FastEthernet0/11
 duplex full
 speed 100
!
interface FastEthernet0/12
 duplex full
 speed 100
!
interface FastEthernet0/13
 duplex full
 speed 100
!
interface FastEthernet0/14
 duplex full
 speed 100
!
interface FastEthernet0/15
 duplex full
 speed 100
!
interface FastEthernet0/16
 duplex full
 speed 100
!
interface FastEthernet0/17
 duplex full
 speed 100
!
interface FastEthernet0/18
 duplex full
 speed 100
!
interface FastEthernet0/19
 duplex full
 speed 100
!
interface FastEthernet0/20
 duplex full
 speed 100
!
interface FastEthernet0/21
 duplex full
 speed 100
!
interface FastEthernet0/22
 duplex full
 speed 100
!
interface FastEthernet0/23
 duplex full
 speed 100
!
interface FastEthernet0/24
 duplex full
 speed 100
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan50
 mac-address 0090.0cb3.9901
 ip address 172.16.0.132 255.255.255.224
!
ip default-gateway 172.16.0.129
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

L2交换机中间的L3交换机配置:

Building configuration...

Current configuration : 2065 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/3
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/4
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/5
 duplex full
 speed 100
!
interface FastEthernet0/6
 duplex full
 speed 100
!
interface FastEthernet0/7
 duplex full
 speed 100
!
interface FastEthernet0/8
 duplex full
 speed 100
!
interface FastEthernet0/9
 duplex full
 speed 100
!
interface FastEthernet0/10
 duplex full
 speed 100
!
interface FastEthernet0/11
 duplex full
 speed 100
!
interface FastEthernet0/12
 duplex full
 speed 100
!
interface FastEthernet0/13
 duplex full
 speed 100
!
interface FastEthernet0/14
 duplex full
 speed 100
!
interface FastEthernet0/15
 duplex full
 speed 100
!
interface FastEthernet0/16
 duplex full
 speed 100
!
interface FastEthernet0/17
 duplex full
 speed 100
!
interface FastEthernet0/18
 duplex full
 speed 100
!
interface FastEthernet0/19
 duplex full
 speed 100
!
interface FastEthernet0/20
 duplex full
 speed 100
!
interface FastEthernet0/21
 duplex full
 speed 100
!
interface FastEthernet0/22
 duplex full
 speed 100
!
interface FastEthernet0/23
 duplex full
 speed 100
!
interface FastEthernet0/24
 duplex full
 speed 100
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan50
 mac-address 0001.647d.b301
 ip address 172.16.0.132 255.255.255.224
!
ip default-gateway 172.16.0.129
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

L2 交换机的配置:

urrent configuration : 2999 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 switchport mode trunk
 duplex full
 speed 100
!
interface FastEthernet0/2
 switchport access vlan 65
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/3
 switchport access vlan 60
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/4
 switchport access vlan 60
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/5
 switchport access vlan 50
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/6
 switchport access vlan 50
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/7
 switchport access vlan 45
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/8
 switchport access vlan 45
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/9
 switchport access vlan 40
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/10
 switchport access vlan 40
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/11
 switchport access vlan 30
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/12
 switchport access vlan 30
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/13
 switchport access vlan 25
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/14
 switchport access vlan 25
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/15
 switchport access vlan 20
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/16
 switchport access vlan 20
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/17
 switchport access vlan 15
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/18
 switchport access vlan 15
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/19
 switchport access vlan 10
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/20
 switchport access vlan 10
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/21
 switchport access vlan 9
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/22
 switchport access vlan 9
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/23
 switchport access vlan 55
 switchport mode access
 duplex full
 speed 100
!
interface FastEthernet0/24
 switchport access vlan 55
 switchport mode access
 duplex full
 speed 100
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan50
 mac-address 00d0.ba6d.a901
 ip address 172.16.0.129 255.255.255.224
!
interface Vlan65
 mac-address 00d0.ba6d.a902
 no ip address
!
ip default-gateway 172.16.0.129
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
end
2个回答

您的某些端口似乎位于路由器上没有 ip 帮助程序地址的 VLAN 中。他们不会从您的服务器获取地址。

在 dhcp 端,只需验证您的范围是否正确。

确保您可以从交换机 ping ip helper 命令中的 dhcp 服务器。我已经看到 ip helper 所在的位置,但是 dhcp 所在的网络没有正确路由。

验证作为网关的 vlan 接口是否具有指向正确服务器/服务器的 ip 帮助程序地址。

如果一切正常,请使用 Wireshark 进行一些故障排除。

要查看哪些服务器正在回复,请使用过滤器运行 Wireshark,捕获流量并释放更新您的地址,以便它请求一个地址。

  1. 将计算机插入网络。等待接口处于活动状态。根据生成树,它可能接近一分钟。

  2. 启动 Wireshark 并选择正确的界面。

  3. 释放更新您的IP地址。在 Windows 上打开命令提示符并运行此命令。

这将同时发布和更新。

Ipconfig /release & & Ipconfig /renew
  1. 大约 30 到 60 秒后停止 Wireshark 捕获并在过滤器窗口中放入过滤器以查看 dhcp 流量。

我用...

bootp.option.type == 53

您也可以使用它,但它不会像上面的过滤器那样显示所有的 dhcp 和 bootp...

udp port 68 or port 67

这些捕获将显示响应的内容。您可以多次执行此过程,以查看是否有错误的服务器正在响应。有时,如果出现问题或多个问题,如果您有配置错误、流氓 dhcp 服务器或如果您运行两个 dhcp 服务器(可能一半范围在一台服务器上,另一半范围作为另一台服务器),您将看不到任何响应冗余的形式。在这种情况下,第一个响应“获胜”的人,但您很可能会看到他们都响应)。