1. 程式人生 > 實用技巧 >配置ISO DHCP服務

配置ISO DHCP服務

配置ISODHCP服務

實驗目的

掌握路由器上DHCP配置方法

實驗過程

1.R1的配置

Router>

Router>en

Router#configt

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#noipdomain-lookup

Router(config)#hostR1

R1(config)#lineconsole0

R1(config-line)#noexec-timeout

R1(config-line)#logginsyn

R1(config-line)#exit

R1(config)#ipdhcppoolccnp

//配置一個DHCP地址池,名稱為ccnp

R1(dhcp-config)#network192.168.0.0/24//192.168.0.0後邊一定要有一個空格

R1(dhcp-config)#default-router192.168.0.1//配置預設閘道器為192.168.0.1

R1(dhcp-config)#dns-server61.134.1.4//配置DNS伺服器地址為61.134.1.4

R1(dhcp-config)#domain-namecisco.com//配置域名為cisco.com

R1(dhcp-config)#leaseinfinite//配置地址租期無限

R1(dhcp-config)#exit

R1(config)#ipdhcpexcluded-address192.168.0.1//配置DHCP不要分發192.168.0.1這個IP地址

R1(config)#interfacef0/0

R1(config-if)#noshut

R1(config-if)#ipadd192.168.0.1255.255.255.0//新增路由器的閘道器地址

R1(config-if)#end

R1#

2.R5配置

Router>

Router>en

Router#configt

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#noipdomain-lookup

Router(config)#lineconsole0

Router(config-line)#noexec-timeout

Router(config-line)#logginsyn

Router(config-line)#exit

Router(config)#interfacef0/0

Router(config-if)#noshut

Router(config-if)#ipaddressdhcp//路由器上開啟dhcp獲取ip地址

Router(config-if)#exit

Router(config)#end

Router#

3.R6配置

Router>

Router>en

Router#configt

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#noipdomain-lookup

Router(config)#lineconsole0

Router(config-line)#noexec-timeout

Router(config-line)#logginsyn

Router(config-line)#exit

Router(config)#interfacef0/0

Router(config-if)#noshut

Router(config-if)#ipaddressdhcp//路由器上開啟dhcp獲取ip地址

Router(config-if)#exit

Router(config)#end

Router#

4.驗證

R1#showipdhcpbinding

BindingsfromallpoolsnotassociatedwithVRF:

IPaddressClient-ID/LeaseexpirationType

Hardwareaddress/

Username

192.168.0.20063.6973.636f.2d63.InfiniteAutomatic

6330.342e.3037.3563.

2e30.3030.302d.4661.

302f.30

192.168.0.30063.6973.636f.2d63.InfiniteAutomatic

6330.352e.3037.3563.

2e30.3030.302d.4661.

302f.30

R1#

Router#showipintbr

InterfaceIP-AddressOK?MethodStatusProtocol

FastEthernet0/0192.168.0.2YESDHCPupup

Router#

Router#showipintbr

InterfaceIP-AddressOK?MethodStatusProtocol

FastEthernet0/0192.168.0.3YESDHCPupup

Router#

轉載於:https://blog.51cto.com/mxn19871215/466045