【Switch2004采用全局地址池方式分配地址相关配置】
1.[Switch2004]vlan 10创建(进入)VLAN10
2.[Switch2004-vlan10]port Ethernet 1 0/1将E0/1加入到VLAN10
3.[Switch2004]interface Vlan-interface 10创建(进入)VLAN接口10
4.为VLAN接口10配置IP地址
[Switch2004-Vlan-interface10]ip address 192.168.10.1 255.255.255.0
5.在VLAN接口10上选择全局地址池方式分配IP地址
[Switch2004-Vlan-interface10]dhcp select server global-pool
6.创建全局地址池,并命名为”vlan10”
[Switch2004]dhcp server ip-pool vlan10
7.配置vlan10地址池给用户分配的地址范围以及用户的网关地址
[Switch2004-dhcp-vlan10]network 192.168.10.0 mask 255.255.255.0 [Switch2004-dhcp-vlan10]gateway-list 192.168.10.1
8.禁止将PC机的网关地址分配给用户
[Switch2004]dhcp server forbidden-ip 192.168.10.1
1.[Switch2004]vlan 20创建(进入)VLAN20
2.[Switch2004-vlan20]port Ethernet 0/1将E0/1加入到VLAN20
3.[Switch2004]interface Vlan-interface 20创建(进入)VLAN接口20
4.为VLAN接口20配置IP地址
[Switch2004-Vlan-interface20]ip address 192.168.20.1 255.255.255.0
5.在VLAN接口20上选择全局地址池方式分配IP地址
[Switch2004-Vlan-interface20]dhcp select server global-pool
6.创建全局地址池,并命名为”vlan20”
[Switch2004]dhcp server ip-pool vlan20
7.配置vlan20地址池给用户分配的地址范围以及用户的网关地址
[Switch2004-dhcp-vlan20]network 192.168.20.0 mask 255.255.255.0 [Switch2004-dhcp-vlan20]gateway-list 192.168.20.1
8.禁止将PC机的网关地址分配给用户
[Switch2004]dhcp server forbidden-ip 192.168.20.1
2002
[2002]int range e1/0/1 to e1/0/24
[2002-range]port link-type ac
[2002-range]port ac vlan 10
2003
[2003]int range e1/0/1 to e1/0/24
[2003]-range]port link-type ac
[2003-range]port ac vlan 20。