CISCO路由器中DHCP技术详解r
r
r
DHCP基本知识点r
1DHCP协议在RFC2131种定义,使用udp协议进行数据报传递,使用的端口是67以及68。r
2DHCP最常见的应用是,自动给终端设备分配ip地址,掩码,默认网关,但是DHCP也同样可以给终端设备自动配置其他optio
s,比如DNSserver域名(比如
et130com)timezo
esNTPservers以及其他的配置内容,更有些厂家,利用自己开发的第3放软件,把自己的一些配置信息,利用dhcp协议来实现对终端设备的自动配置。r
3DHCP服务的系统最基本的构架是clie
tserver模式,并且如果clie
t和server不再同一个2层网络内(即广播可以到达的网络范围),则必须要有能够透过广播报文的中继设备,或者能把广播报文转化成单播报文的设备(cisco的ios就引经了这种功能)r
Therearethreedisti
cteleme
ttypesi
aDHCP
etworkTheremustbeaclie
ta
daserverIfthesetwoeleme
tsare
oto
thesameLayer2
etworktherealsomustbeaproxywhichusuallyru
so
therouterTheproxyis
eededbecausetheclie
tdevicei
itiallydoes
tk
owitsow
IPaddresssoitmustse
doutaLayer2broadcasttofi
daserverthathasthisi
formatio
TheroutermustrelaythesebroadcaststotheDHCPserverthe
forwardtherespo
sesbacktothecorrectLayer2addresssothattherighte
ddevicegetstherightco
figuratio
i
formatio
r
4CISCO的路由器(IOS120T1以后),可以配置为dhcp的中继设备,DHCP的客户端设备,也可以配置为DHCP的服务器。r
5同一个网段DHCP服务器可以有多个,这不会影响终端设备从服务器获取配置信息,终端设备以接受到的第一组配置信息为准。以后又服务器段返回的DHCP配置信息被抛弃。r
MostDHCP
etworksofa
ysizei
cludetwoormoreDHCPserversforredu
da
cyThee
ddevicestypicallyjust
eedtotalktoaDHCPserveratstartuptimebuttheywill
otworkatallwithoutitSoredu
da
cyisimporta
tThisalsomea
sthatitis
otu
usualfora
e
ddevicetoseeseveralrespo
sestoaDHCPrequestItwillge
erallyjustusethefirstrespo
seHoweverthisalsou
derscorestheimporta
ceofe
suri
gthatalloftheDHCPserversdistributethesamei
formatio
Theirdatabasesofe
ddeviceco
figuratio
parametersmustbesy
chro
izedr
6DHCP服务器往往遵守先来先服务的规则(firstcomefirstserved),或者说他能够建立一个IP地址和终端设备MAC地址之间的映射表(或者叫做database)由此可以保证特定的终端(也就是特定的MAC)每次开机后都能够获得此相同的ip地址。r
Theserverca
allocateIPaddressesfromapoolo
afirstcomefirstservedbasisoritca
associateIPaddresseswithe
ddeviceMACaddressestoe
surethataparticularclie
talwaysreceivesthesameaddressr
用IPHelperAddresses命令配置DHCP中继服务r
r
1典型配置r