動態主機配置協議
數據庫
dhcp:廣播包
服務器
幫助地址:ide
解決一個dhcp服務器爲不一樣網段提供服務測試
當只有一個dhcp服務器時,如何知足爲多個網段提供dhcp服務(穿過廣播域)==幫助地址
debug
幫助地址:將廣播轉換爲單播地址,到達dhcp服務器router
配置在接收廣播地址的接口
server
int e0
blog
ip add 144.253.1.100 255.255.255.0
dns
ip helper-address 144.253.2.1
接口
ip helper-address 144.253.2.2
ip helper-address 144.253.2.3
- 可轉接目標地址爲UDP廣播的數據包
- 把目標地址從廣播轉變爲單播
全局:ip forward-protocol {udp [port]}
//指定轉發端口號
- sho ip dhcp database //顯示已經激活的dhcp數據庫
- sho ip dhcp server statistics //顯示當前信息以及參數以及消息發送和接收的狀況
- sho ip dhcp binding //顯示分配了的地址
- sho ip route dhcp //顯示經過dhcp服務來添加到路由表裏的信息
- debug ip dhcp server {events | packets | linkage}
R1:
ip dhcp pool test
network 10.1.1.0 255.255.255.0
default-router 10.1.1.1
dns-server 8.8.8.8
exi
ip dhcp excluded-address 10.1.1.1 10.1.1.99
R3: R4模擬PC
int f0/0
ip add dhcp //路由器經過dhcp獲取地址
no shu
R5:此時R5是沒法收到R1的dhcp的。全部須要在R2的f1/0配置 幫助地址
R2:int f1/0
ip add 20.1.1.2 255.255.255.0
int f1/0
ip help-address 11.1.1.1 (任何可達R1的地址就行)
保證可達,R1 R2配置路由協議
router ei 10
no auto
net 12.1.1.0
net 20.1.1.0
R1:int lo10
ip add 11.1.1.10 255.255.255.0
router ei 10
no auto
net 12.1.1.0
net 11.1.1.0
R1須要配置 匹配 R2 R5上20網段的地址池,才能給R5分配地址
ip dhcp test1
network 20.1.1.1 255.255.255.0
default 201.1.1.1
exi
ip dhcp-ex 20.1.1.1 20.1.1.99
R5:測試
sho ip int bri