實驗3: DHCP 基本配置


實驗3-1: DHCP 基本配置

      實驗目的
通過本實驗可以掌握:
(1)DHCP 的工作原理和工作過程
(2)DHCP 服務器的基本配置和調試
(3)客戶端配置

      拓撲結構

 

實驗步驟
n    步驟1:配置路由器R1 提供DHCP 服務
R1(config)#int f0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config)#service dhcp //開啟DHCP 服務
R1(config)#ip dhcp pool liming //定義地址池
R1(dhcp-config)#network 192.168.1.0 /24
 //DHCP 服務器要分配的網絡和掩碼
R1(dhcp-config)#default-router 192.168.1.1
//默認網關,這個地址要和相應網絡所連接的路由器的以太口地址相同
R1(dhcp-config)#dns-server 192.168.1.4      //DNS 服務器
R1(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.5
//排除的地址段

n    步驟2:設置windows 客戶端(路由器模擬PC)
Router(config)#host PC2
PC2(config)#no ip routing
PC2(config)#int f0/0
PC2(config-if)#no sh
PC2(config-if)#ip address dhcp

//出現如下提示信息:
*Mar  1 00:53:00.735: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.6, mask 255.255.255.0, hostname PC2

Router(config)#host PC3
PC3(config)#no ip routing
PC3(config)#int f0/0
PC3(config-if)#no sh
PC3(config-if)#ip address dhcp

出現如下提示信息:
*Mar  1 00:57:24.779: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.7, mask 255.255.255.0, hostname PC2

     實驗調試
n    show ip dhcp pool    //該命令用來查看DHCP 地址池的信息。
R1#show ip dhcp pool
Pool liming :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 2
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range             Leased addresses
 192.168.1.8          192.168.1.1      - 192.168.1.254     2
//下一個將要分配的地址、地址池的范圍以及分配出去的地址的個數

n    show ip dhcp binding  //該命令用來查看DHCP 的地址綁定情況。
R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
192.168.1.6         0063.6973.636f.2d63.    Mar 02 2002 12:53 AM    Automatic
                    6330.312e.3134.6530.
                    2e30.3030.302d.4661.
                    302f.30
192.168.1.7         0063.6973.636f.2d63.    Mar 02 2002 12:57 AM    Automatic
                    6330.322e.3134.6530.
                    2e30.3030.302d.4661.
                 



DHCP中繼

 

 R1:
interface FastEthernet0/0
 ip address dhcp
 duplex auto
 speed auto

R2:
interface FastEthernet0/0
 ip address 10.1.1.1 255.255.255.0
 ip helper-address 13.1.1.3
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 13.1.1.1 255.255.255.0
 duplex auto
 speed auto
!
!
router eigrp 100
 network 10.1.1.1 0.0.0.0
 network 13.1.1.1 0.0.0.0
 no auto-summary


R3


ip dhcp excluded-address 10.1.1.1
!
ip dhcp pool tech
   network 10.1.1.0 255.255.255.0
   default-router 10.1.1.1
   dns-server 100.1.1.1
   lease 10

!
interface FastEthernet0/1
 ip address 13.1.1.3 255.255.255.0
 duplex auto
 speed auto
!
!
router eigrp 100
 network 13.1.1.3 0.0.0.0
 no auto-summary

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM