SW1命令
ip dhcp pool ruijie
hardware-address 5000.0002.0001 #指定客户端的MAC地址
host 192.168.1.188 255.255.255.0 #指定分配的IP地址
default-router 192.168.1.1 #指定网关
报错问题:
Ruijie(dhcp-config)#hardware-address 5000.0002.0001
% This command can not be used with dynamic pools.翻译:此命令不能与动态池一起使用
解析:锐捷 network 命令与 hardware-address 不可同时使用,默认情况下这两条命令冲突,network表示配置动态地址池,而hardware-address命令表示创建静态地址池
事例:
Ruijie(dhcp-config)#sh thi
Building configuration...
!
hardware-address 5000.0002.0001 #此时是静态地址池
host 192.168.1.188 255.255.255.0
default-router 192.168.1.1
!
end
Ruijie(dhcp-config)#network 192.168.1.0 255.255.255.0 #当输入network出现报错
% This command can not be used with static pools. #此命令不能与静态池一起使用
问题:客户端获取不到指定地址
DHCP服务器端配置静态地址池配置
客户端获取IP情况
发现物理接口并没有获取到地址192.168.1.188,而vlan1接口自动获取到了192.168.1.2,从而导致g0/0接口获取地址冲突
报错提示:*Apr 23 13:07:45: %DHCP_CLIENT-4-ADDRESS_CONFLICT: DHCP address 192.168.1.188 mask 255.255.255.0 conflicted with the address on interface VLAN 1
解决:将客户端的vlan1中的自动获取IP指定命令删除,并shutdown 关闭接口
Ruijie(config)#int vlan 1
Ruijie(config-if-VLAN 1)#no ip address mix dhcpRuijie(config-if-VLAN 1)#shutdown
过了一会可以发现已经自动获取了地址
弹出提示:*Apr 23 13:11:40: %DHCP_CLIENT-6-ADDRESS_ASSIGN: Interface GigabitEthernet 0/0 assigned DHCP address 192.168.1.188, mask 255.255.255.0.