?DHCP
C/S架構(gòu)
Client (UDP 68) /Server(UDP 67)
1,客戶端首次獲取IP
4個過程
2,客戶端第二次獲取IP
2個過程
DHCP工作流程圖
DHCP DISCOVER(廣播)
DHCP OFFER(單播或廣播)
DHCP REQUEST(廣播)
租期—1 day
T1時間… 租期的50% — 12小時
續(xù)租:使用單播的形式發(fā)送DHCP-Resquest
T2時間… 租期的87.5% ― 21小時
續(xù)租:使用廣播的形式發(fā)送DHCP-Resquest
DHCP-Release — DHCP客戶端主動釋放IP地址使用的數(shù)據(jù)包
?拓?fù)鋱D
?基本步驟
1,首先要分析pc都需要啥?(ip,子網(wǎng)掩碼,網(wǎng)關(guān))
2,其次要配置接口ip(g/0/0/0, g0/0/1),并將其當(dāng)做為pc的網(wǎng)關(guān)
3,在路由器上打開dhcp服務(wù)(dhcp enable)
4,創(chuàng)建IP池
5,配置IP池(IP地址,子網(wǎng)掩碼,網(wǎng)關(guān))
6,接口上選擇全局配置
7,pc端打開dhcp并且應(yīng)用
ipconfig進(jìn)行查看即可
?R2配置代碼
改名就不用說了
<Huawei>sys
[Huawei]sys r2?
開啟路由器的dhcp服務(wù)
[r2]dhcp enable?
Info: The operation may take a few seconds. Please wait for a moment.done.
[r2]dhcp enable
創(chuàng)建ip池
[r2]ip pool 1
Info: It's successful to create an IP address pool.
[-ip-pool-1]network 192.168.1.0 mask 24 ——配置ip池的范圍,以及掩碼
[r2-ip-pool-1]gateway-list 192.168.1.1——配置網(wǎng)關(guān)地址(地址與出接口地址一致)
[r2-ip-pool-1]dns-list 114.114.114.114 8.8.8.8——配置dns服務(wù)器地址(由于這里沒有電dns服務(wù)器所以就隨便寫了兩個,前邊首選,后邊備選)
進(jìn)入接口,配置出接口ip地址
[r2]int g 0/0/0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
[r2-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Feb 27 2023 20:20:54-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP?
on the interface GigabitEthernet0/0/0 has entered the UP state.?
[r2-GigabitEthernet0/0/0]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0
?ip address 192.168.1.1 255.255.255.0?
#
并且打開出接口的dhcp全局配置
[r2-GigabitEthernet0/0/0]dhcp select global?
[r2-GigabitEthernet0/0/0]int g 0/0/1
配置0/0/0接口ip地址
[r2-GigabitEthernet0/0/1]ip add 192.168.2.1 24
[r2-GigabitEthernet0/0/1]dis this——不放心了可以查看一下
[V200R003C00]
#
interface GigabitEthernet0/0/1
?ip address 192.168.2.1 255.255.255.0?
R3配置代碼
R3配置基本和R2一致,所以就省略文字了。
<Huawei>sys
[Huawei]sys r3
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]dhcp enable
[r3]ip pool 2
[r3-ip-pool-2]network 192.168.3.0 mask 24
[r3-ip-pool-2]gateway-list 192.168.3.1 ????????
[r3-ip-pool-2]dns-list 114.114.114.114 8.8.8.8
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]dhcp select global
[r3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.2.2 24
Feb 27 2023 20:28:06-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP文章來源:http://www.zghlxwxcb.cn/news/detail-459452.html
on the interface GigabitEthernet0/0/1 has entered the UP state.?文章來源地址http://www.zghlxwxcb.cn/news/detail-459452.html
到了這里,關(guān)于一分鐘教你配置DHCP服務(wù),超級簡單一看就會?。。。?!的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!