# 配置DHCP Server功能,并配置使用Option82信息進行地址分配。 Switch> enable Switch(config)# configure terminal Enter Configuration commands, one per line. End with CNTL/Z. Switch(config)# service dhcp Switch(config)# ip dhcp use class
# 為從Snooping設備的Ethernet2/0/12端口接入的客戶端建立DHCP分類,并配置匹配的Option82信息為Circuit ID 子選中的端口編號,無需匹配的內容可以使用通配符“*”代替。 Switch(config)# ip dhcp class office1 Switch(dhcp-class)# relay agent information hex 0106000400010011* Swtich(dhcp-class)# exit
# 為從Snooping設備的Etherent2/0/13端口接入的客戶端配置分類和匹配信息,方法與上面命令相似,只將Option82信息中的端口標識由11改為12。 Switch(config)# ip dhcp class office2 Switch(dhcp-class)# relay agent information hex 0106000400010012*
# 創(chuàng)建Office地址池,并為兩個DHCP分類分別指定地址范圍。 Switch(config)# ip dhcp pool office Switch(dhcp-pool)# network 192.168.10.0 Switch(dhcp-pool)# class office1 Switch(dhcp-pool-class)# address range 192.168.10.2 192.168.10.25 Switch(dhcp-pool-class)# exit Switch(dhcp-pool)# class office2 Switch(dhcp-pool-class)# address range 192.168.10.100 192.168.10.110 Switch(dhcp-pool-class)# exit