[Quidway-dhcp-server-group-dhcpgroup1] quit 在VLANIF接口下使能DHCP中继功能。
# 创建VLAN并将GE 1/0/1接口加入到VLAN中。
[Quidway] vlan 100 [Quidway-Vlan100] quit
[Quidway] interface gigabitethernet 1/0/1
[Quidway-GigabitEthernet1/0/1] port link-type trunk
[Quidway-GigabitEthernet1/0/1] port trunk allow-pass vlan 100 [Quidway-GigabitEthernet1/0/1] quit
# 使能全局DHCP功能,并使能VLANIF接口下DHCP中继功能。
[Quidway] dhcp enable
[Quidway] interface vlanif 100
[Quidway-Vlanif100] dhcp select relay [Quidway-Vlanif100] quit
为VLANIF接口绑定指定的DHCP服务器组。 # 为VLANIF接口配置IP地址。
[Quidway] interface vlanif 100
[Quidway-Vlanif100] ip address 20.20.20.1 24 # 为VLANIF接口指定DHCP服务器。
[Quidway-Vlanif100] dhcp relay server-select dhcpgroup1 [Quidway-Vlanif100] quit 配置DHCP服务器。
# 创建VLAN并将GE 1/0/0接口加入到VLAN中。
[Quidway] vlan 20 [Quidway-Vlan20] quit
[Quidway] interface gigabitethernet 1/0/0
[Quidway-GigabitEthernet1/0/0] port link-type trunk
[Quidway-GigabitEthernet1/0/0] port trunk allow-pass vlan 20 [Quidway-GigabitEthernet1/0/0] quit
# 启动DHCP服务,配置接口VLANIF20下的客户端从全局地址池中获取IP地址。
[Quidway] interface vlanif 20
[Quidway-Vlanif20] ip address 100.10.10.1 24 [Quidway-Vlanif20] dhcp select global [Quidway-Vlanif20] quit
# 在DHCP服务器上配置一个20.20.20.0/24网段的IP地址池,并且添加到SwitchA的静态路由,保证DHCP服务器到20.20.20.0/24网段路由可达。
[Quidway] ip pool 1
[Quidway-ip-pool-1] network 20.20.20.0 mask 24 [Quidway-ip-pool-1] gateway-list 20.20.20.1 [Quidway-ip-pool-1] quit
# 将IP地址池网段添加到DHCP中继的静态路由,保证DHCP服务器到
20.20.20.0/24网段路由可达。(略) 验证配置结果。
# 在SwitchA上使用display dhcp relay命令用来查看接口的DHCP中继配置情况。
[Quidway] display dhcp relay interface vlanif100
DHCP relay agent running information of interface Vlanif100 : Server group name : dhcpgroup1 Gateway address in use : 100.10.10.1
# 在SwitchB上使用display ip pool命令用来查看IP地址池配置情况。
[Quidway] display ip pool
----------------------------------------------------------------------- Pool-Name : 1 Pool-No : 0
Position : Local Status : Unlocked Gateway-0 : -
Mask : 255.255.255.0 Vpn instance : -- IP address Statistic Total :250
Used :0 Idle :248
Expired :0 Conflict :0 Disable :2