DHCP的配置与分析 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

由路由R1,R2,R3,把R1当作DHCP服务器,让R2的R3从它上面自动获得IP地址,分析一下为什么他们获得的不一样(不是R3获得的不是R1地址池中的地址)。

R1上DHCP服务器的配置

 

Router(config)#host R1

R1(config)#no ip do

R1(config)#no ip domain-lo

R1(config)#service dhcp   定为DHCP服务器

R1(config)#no ip dhcp conflict logging  没有地址冲突

R1(config)#ip dhcp excluded-address 12.1.1.1  排除一个地址

R1(config)#ip dhcp pool cisco  做一个地址池

R1(dhcp-config)#network 12.1.1.0 255.255.255.0  地址为

R1(dhcp-config)#default-router 12.1.1.1  默认路由

R1(dhcp-config)#dns-server 192.168.1.1   DNS服务器地址

R1(dhcp-config)#domain-name  [url]www.pzhnetclass.com[/url]      域名为

R1(dhcp-config)#lease 1   租用期限

R1(dhcp-config)#int fa0/0

R1(config-if)#ip add 12.1.1.1 255.255.255.0

R1(config-if)#no shu

R2上的配置:

Router(config)#host R2

R2(config)#no ip domain-lo

R2(config)#int fa0/0

R2(config-if)#ip add dhcp host R1  从R1上的DHCP服务器上获得IP地址

R2(config-if)#no shu

R2(config-if)#end

R2#show ip int br

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            12.1.1.2        YES DHCP   up                    up      

Serial1/0                  unassigned      YES unset  administratively down down    

Serial1/1                  unassigned      YES unset  administratively down down    

Serial1/2                  unassigned      YES unset  administratively down down    

Serial1/3                  unassigned      YES unset  administratively down down 

R3上的配置

Router(config)#host R3

R3(config)#no ip domain-lo

R3(config)#int fa0/0 

R3(config-if)#ip address dhcp (从DNS服务器上获得地址了)

R3(config-if)#no shu

R3(config-if)#end

R3#show ip int br

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            192.168.1.105   YES DHCP   up                    up      

Serial1/0                  unassigned      YES unset  administratively down down    

Serial1/1                  unassigned      YES unset  administratively down down    

Serial1/2                  unassigned      YES unset  administratively down down    

Serial1/3                  unassigned      YES unset  administratively down down