路由器不响应DHCP中继设备的Discover导致终端设备无法获取IP地址
我的路由器是H3C MSR3600-28
交换机是华为CE6850-48T6Q-HI
网络拓扑图如下:
这是MSR3600-28路由器的版本信息:
H3C Comware Software, Version 7.1.064, Release 6728P26
Copyright (c) 2004-2023 New H3C Technologies Co., Ltd. All rights reserved.
H3C MSR3600 uptime is 0 weeks, 0 days, 2 hours, 52 minutes
Last reboot reason : Power on
Boot image: flash:/msr3600-cmw710-boot-r6728p26.bin
Boot image version: 7.1.064P80, Release 6728P26
Compiled Mar 15 2023 15:00:00
System image: flash:/msr3600-cmw710-system-r6728p26.bin
System image version: 7.1.064, Release 6728P26
Compiled Mar 15 2023 15:00:00
CPU ID: 0x1
1G bytes DDR3 SDRAM Memory
2M bytes Flash Memory
PCB Version: 2.0
CPLD Version: 2.0
Basic BootWare Version: 1.83
Extended BootWare Version: 1.83
[SLOT 0]AUX (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]GE0/0 (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]GE0/1 (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]GE0/2 (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]24GSW (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]SFP0/27 (Hardware)2.0, (Driver)1.0, (CPLD)2.0
[SLOT 0]CELLULAR0/0 (Hardware)2.0, (Driver)1.0, (CPLD)2.0
MSR3600开启了DHCP,并且创建了IP地址池。
交换机CE6850上开启了DHCP relay且创建了DHCP relay server-group并指向了MSR3600(10.1.1.1)。
MSR3600的配置是这样的:
<ROUTER-MSR3600-28>dis dhcp server pool dhcp-ipv4-pool-vlan20
Pool name: dhcp-ipv4-pool-vlan20
Network: 10.10.20.0 mask 255.255.255.0
dns-list 10.10.1.254
expired day 1 hour 0 minute 0 second 0
gateway-list 10.10.20.254
然后CE6850的配置是这样的:
<SWITCH-CE6850-48T6Q-H1>dis dhcp relay interface Vlanif 20
DHCP relay agent running information of interface Vlanif20 :
Server group name : dhcp-h3c-msr3600-28
Gateway address in use : 10.1.1.1
Gateway address configured : 10.1.1.1
Gateway switch enable
[~SWITCH-CE6850-48T6Q-H1]int Vlanif 20
[~SWITCH-CE6850-48T6Q-H1-Vlanif20]dis this
#
interface Vlanif20
ip address 10.10.20.254 255.255.255.0
dhcp select relay
dhcp relay binding server group dhcp-h3c-msr3600-28
dhcp relay gateway-switch enable
#
return
终端设备完全获取不到IP地址(但是连接在MSR3600其他vlanif上的设备是可以自动获取到IP的,比如vlan1、vlan10。总之就是走DHCP中继的设备不行)
然后我发现一个信息:
这是我在CE6850和MSR3600上清理后多次对比的统计数据,感觉原因基本可以确定是MSR3600没有响应客户机的Discover导致的,不知道是没能解析DHCPDiscover广播数据呢还是什么原因。具体估计得抓包查看了,但是我不会在交换机上抓包啊
<SWITCH-CE6850-48T6Q-H1>dis dhcp relay statistics
DHCP packets received from clients : 111
DISCOVER packets : 111
REQUEST packets : 0
RELEASE packets : 0
INFORM packets : 0
DECLINE packets : 0
DHCP packets sent to clients : 0
Unicast packets : 0
Broadcast packets : 0
DHCP packets received from servers : 0
OFFER packets : 0
ACK packets : 0
NAK packets : 0
DHCP packets sent to servers : 111
DHCP Bad packets received : 0
Local DHCP RELEASE packets sent to servers : 0
<ROUTER-MSR3600-28>dis dhcp server statistics
Pool number: 7
Pool utilization: 0.26%
Bindings:
Automatic: 3
Manual: 1
Expired: 0
Conflict: 0
Messages received: 110
DHCPDISCOVER: 110
DHCPREQUEST: 0
DHCPDECLINE: 0
DHCPRELEASE: 0
DHCPINFORM: 0
BOOTPREQUEST: 0
Messages sent: 0
DHCPOFFER: 0
DHCPACK: 0
DHCPNAK: 0
BOOTPREPLY: 0
Bad Messages: 0
这俩统计数据差1是因为先清理的CE6850,在清理MSR3600过程中已经有一个DHCPDiscover广播到达机器了
(0)
debug dhcp all 看下保文交互
(1)
你好哇。 没有这个命令,有debug dhcp server all和debug dhcp relay all这俩命令,但是都没任何输出
哇。 有输出了 Feb 4 03:27:32:126 2024 ROUTER-MSR3600-28 DHCPS/7/PACKET: From 10.10.23.254 port 67, interface Route-Aggregation1 Message type: REQUEST (1) Hardware type: 1, Hardware address length: 6 Hops: 1, Transaction ID: 385317861 Seconds: 5753, Broadcast flag: 0 Client IP address: 0.0.0.0 Your IP address: 0.0.0.0 Server IP address: 0.0.0.0 Relay agent IP address: 10.1.1.1 Client hardware address: fe2f-dec1-fe23 Server host name: not configured Boot file name: not configured DHCP message type: DHCPDISCOVER (1) *Feb 4 03:27:32:127 2024 ROUTER-MSR3600-28 DHCPS/7/EVENT: Receive a DHCPDISCOVER message from 10.1.1.1. *Feb 4 03:27:32:127 2024 ROUTER-MSR3600-28 DHCPS/7/EVENT: No matching network for the client. *Feb 4 03:27:32:127 2024 ROUTER-MSR3600-28 DHCPS/7/EVENT: Lease 10.10.1.3 does not match the network. *Feb 4 03:27:32:127 2024 ROUTER-MSR3600-28 DHCPS/7/EVENT: No matching network for the client.
哇。 多谢大神。 我会debug了
因为我设置了多个IP地址池,看来是把10.10.1.3分配给了10.10.20.254上的设备,网段不匹配,没有成功。下面是我的所有地址池 [ROUTER-MSR3600-28]dis dhcp server pool Pool name: dhcp-ipv4-pool-vlan20 Network: 10.10.20.0 mask 255.255.255.0 dns-list 10.10.1.254 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.20.254 Pool name: dhcp-ipv4-pool-vlan21 Network: 10.10.21.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.21.254 Pool name: dhcp-ipv4-pool-vlan22 Network: 10.10.22.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.22.254 Pool name: dhcp-ipv4-pool-vlan23 Network: 10.10.23.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.23.254 Pool name: lan1 Network: 10.10.1.0 mask 255.255.255.0 address range 10.10.1.1 to 10.10.1.253 dns-list 192.168.1.1 223.5.5.5 223.6.6.6 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.1.254 Pool name: Vlan-interface10 Network: 10.10.10.0 mask 255.255.255.128 address range 10.10.10.1 to 10.10.10.125 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.10.126 Pool name: Vlan-interface11 Network: 10.10.10.128 mask 255.255.255.128 address range 10.10.10.129 to 10.10.10.253 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.10.254 static bindings: ip-address 10.10.10.129 mask 255.255.255.252 hardware-address 346a-c2bc-0f20 ethernet
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
因为我设置了多个IP地址池,看来是把10.10.1.3分配给了10.10.20.254上的设备,网段不匹配,没有成功。下面是我的所有地址池 [ROUTER-MSR3600-28]dis dhcp server pool Pool name: dhcp-ipv4-pool-vlan20 Network: 10.10.20.0 mask 255.255.255.0 dns-list 10.10.1.254 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.20.254 Pool name: dhcp-ipv4-pool-vlan21 Network: 10.10.21.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.21.254 Pool name: dhcp-ipv4-pool-vlan22 Network: 10.10.22.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.22.254 Pool name: dhcp-ipv4-pool-vlan23 Network: 10.10.23.0 mask 255.255.255.0 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.23.254 Pool name: lan1 Network: 10.10.1.0 mask 255.255.255.0 address range 10.10.1.1 to 10.10.1.253 dns-list 192.168.1.1 223.5.5.5 223.6.6.6 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.1.254 Pool name: Vlan-interface10 Network: 10.10.10.0 mask 255.255.255.128 address range 10.10.10.1 to 10.10.10.125 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.10.126 Pool name: Vlan-interface11 Network: 10.10.10.128 mask 255.255.255.128 address range 10.10.10.129 to 10.10.10.253 expired day 1 hour 0 minute 0 second 0 gateway-list 10.10.10.254 static bindings: ip-address 10.10.10.129 mask 255.255.255.252 hardware-address 346a-c2bc-0f20 ethernet