继续交换机的配置实验http://blog.chinaunix.net/u/12479/showart_1967521.html
我做了两个测试,一是一台服务器做dhcp服务器,另一个是一台交换机做DHCP服务器
一、DHCP服务器为一台Windows2003,IP为:10.129.20.9
三个scope:
1、10.129.9.10-10.129.5.253,vlan1的主机获得该网段IP
2、10.129.10.10-10.129.10.253,vlan10的主机获得该网段IP
3、10.129.20.10-10.129.20.253,VLAN20的主机获得该网段IP
两台交换机的配置方法相同,以switch01为例在每个vlan设置ip help-server
switch01>en
switch01#config terminal
switch01(config)#interface Vlan1
switch01(config-if)#ip helper-address 10.129.20.9 #指定dhcp服务器地址
switch01(config-if)#exit
switch01(config)#interface Vlan10
switch01(config-if)#ip helper-address 10.129.20.9
switch01(config-if)#exit
switch01(config)#interface Vlan20
switch01(config-if)#ip helper-address 10.129.20.9
switch01(config-if)#exit
switch01(config)#exit
switch01#wr
二、交换机switch01做DHCP服务器
首先switch01和switch02都恢复到测试一之前的状态,只需配置switch01
switch01>en
switch01#config terminal
switch01(config)#no ip dhcp conflict logging
switch01(config)#ip dhcp excluded-address 10.129.5.1 10.129.5.9 #排除10.129.5.1 到10.129.5.9
switch01(config)#ip dhcp excluded-address 10.129.10.1 10.129.10.9
switch01(config)#ip dhcp excluded-address 10.129.20.1 10.129.20.9
switch01(config)#ip dhcp excluded-address 10.129.5.254 #排除10.129.5.254
switch01(config)#ip dhcp excluded-address 10.129.10.254
switch01(config)#ip dhcp excluded-address 10.129.20.254
switch01(config)#ip dhcp pool 1
switch01(dhcp-config)#network 10.129.5.0 255.255.255.0
switch01(dhcp-config)#dns-server 10.129.5.1
switch01(dhcp-config)#default-router 10.129.5.254
switch01(dhcp-config)#exit
switch01(config)#ip dhcp pool 10
switch01(dhcp-config)#network 10.129.10.0 255.255.255.0
switch01(dhcp-config)#default-router 10.129.10.254
switch01(dhcp-config)#dns-server 10.129.5.1
switch01(dhcp-config)#exit
switch01(config)#ip dhcp pool 20
switch01(dhcp-config)#network 10.129.20.0 255.255.255.0
switch01(dhcp-config)#default-router 10.129.20.254
switch01(dhcp-config)#dns-server 10.129.5.1
switch01(dhcp-config)#exit
switch01(config)#exit
switch01#wr
阅读(1330) | 评论(0) | 转发(0) |