system-view
[Quidway] dhcp server group dhcpgroup1
# 为DHCP服务器组添加DHCP服务器。
[Quidway-dhcp-server-group-dhcpgroup1] dhcp-server 100.10.10.1
[Quidway-dhcp-server-group-dhcpgroup1] quit
在VLANIF接口下使能DHCP中继功能。
# 创建VLAN并将Eth 0/0/1接口加入到VLAN中。
[Quidway] vlan 100
[Quidway-Vlan100] quit
[Quidway] interface ethernet 0/0/1
[Quidway-Ethernet0/0/1] port link-type trunk
[Quidway-Ethernet0/0/1] port trunk allow-pass vlan 100
[Quidway-Ethernet0/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并将Eth 0/0/1接口加入到VLAN中。
[Quidway] vlan 20
[Quidway-Vlan20] quit
[Quidway] interface ethernet 0/0/1
[Quidway-Ethernet0/0/1] port link-type trunk
[Quidway-Ethernet0/0/1] port trunk allow-pass vlan 20
[Quidway-Ethernet0/0/1] quit
# 启动DHCP服务,配置接口VLANIF20下的客户端从全局地址池中获取IP地址。
system-view
[Quidway] dhcp enable
[Quidway] interface vlanif 20
[Quidway-Vlanif20] ip address 100.10.10.1 24
[Quidway-Vlanif20] dhcp select global