DHCP協議 原理,配置與驗證

2021-08-09 19:38:07 字數 2507 閱讀 4701

手動配置ip浪費時間,容易出錯,而且毫無擴充套件性

dhcp根據使用者vlan屬性(即閘道器匹配),位址被自動的指定分配

通過和中心位址的關聯,使得整個組織有連續的和層次化的結構

1. s:0.0.0.0  d: 255.255.255.255

2. s:dhcp伺服器 d:255.255.255.255

3. s:0.0.0.0 d255.255.255.255

4. s:s:dhcp伺服器 d:255.255.255.255

1. 交換機配置

sw1(config)#do show run | s pool

ip dhcp pool vlan10

network 10.1.10.0 255.255.255.0

default-router 10.1.10.254

dns-server 114.114.114.114

domain-name marketing

lease 1 12

sw1(config)#ip dhcp excluded-address 10.1.10.250 10.1.10.254

2. 客戶端配置

pc1(config)#default int e0/1

pc1(config)#int e0/1

pc1(config-if)#no shu

pc1(config-if)#ip add dhcp

pc1(config-if)#exit

pc1(config)#no ip routing

pc1(config)#ip default-gateway 10.1.10.254

pc1(config)#exit

1. 交換機端驗證

sw1(config)#do show ip dhcp pool

pool vlan10 :

utilization mark (high/low) : 100 / 0

subnet size (first/next) : 0 / 0

total addresses : 254

leased addresses : 1

excluded addresses : 5

pending event : none

1 subnet is currently in the pool :

current index ip address range leased/excluded/total

10.1.10.3 10.1.10.1 - 10.1.10.254 1 / 5 / 254

sw1#show ip dhcp conflict

ip address detection method detection time vrf

sw1#clear ip dhcp conflict *

2. 客戶端驗證

pc1#debug dhcp

pc1(config)#int e0/1

pc1(config-if)#shu

*sep 22 16:11:41.383: dhcp: deleting entry b1c6f278 10.1.10.1 from list

*sep 22 16:11:41.383: dhcp: client socket is closed

pc1(config)#int e0/1

pc1(config-if)#no shu

*sep 22 15:38:36.439: rac: starting dhcp discover on ethernet0/

*sep 22 15:38:36.453: b'cast on ethernet0/1 inte***ce from 0.0.0.0

*sep 22 15:38:38.461: dhcp: received a bootrep pkt

*sep 22 15:38:38.461: dhcp: offer received from 10.1.10.254

*sep 22 15:38:38.461: dhcp: srequest- server id option: 10.1.10.254

*sep 22 15:38*sep 22 15:38:38.462: dhcp: received a bootrep pkt

*sep 22 15:38:42.486: dhcp: sending notification of assignment:

*sep 22 15:38:42.486: address 10.1.10.2 mask 255.255.255.0

pc1#undebug all

DHCP中繼協議 原理,配置與驗證

dhcp伺服器和終端不在同乙個網路中,終端無法通過廣播到達dhcp伺服器,必須採用dhcp中繼到達dhcp伺服器。中繼的核心問題是dhcp伺服器位址與終端閘道器的單播通訊的問題。sw1 config int vlan 10 sw1 config if ip helper address 172.16...

OSPF協議 原理,配置與驗證

建立鄰居,鄰居互動 通過lsa互動 建立完整拓撲資料庫 spf演算法求最優路徑,建立路由表 area0,骨幹區域 sw1 config router ospf 110 定義ospf程序 sw1 config router router id 1.1 1.1 定義路由器標識 sw1 config ro...

DHCP原理與配置

dhcp dynamic host configuration protocol,動態主機配置協議 由internet工作任務小組設計開發 專門用於為tcp ip網路中的計算機自動分配tcp ip引數的協議 使用dhcp的好處 減少管理員的工作量 避免輸入錯誤的可能 避免ip位址衝突 當更改ip位址...