动态主机配置协议DHCP配置案例.docx
- 文档编号:27439296
- 上传时间:2023-07-01
- 格式:DOCX
- 页数:8
- 大小:172.75KB
动态主机配置协议DHCP配置案例.docx
《动态主机配置协议DHCP配置案例.docx》由会员分享,可在线阅读,更多相关《动态主机配置协议DHCP配置案例.docx(8页珍藏版)》请在冰豆网上搜索。
动态主机配置协议DHCP配置案例
动态主机配置协议DHCP配置案例
需求:
1、AR1为DHCP服务器,为其他设备分配IP地址
2、AR2的G0/0/1接口充当DHCP客户端,IP地址将通过R1
DHCP服务器接口地址池动态获取,排除192.168.2.200
-192.168.2.254网段
3、PC1和PC2能够获取到DHCP服务器全局aaa地址池提供的
IP地址,排除192.168.1.2-192.168.1.99
4、AR2为一台DHCP中继代理,PC3能够获取到DHCP服务器
bbb地址池提供的IP地址
5、全网实现互通
主要配置命令行
接口地址池配置:
R1:
dhcpenable
interfaceGigabitEthernet0/0/1
ipaddress192.168.2.1255.255.255.0
dhcpselectinterface
dhcpserverexcluded-ip-address192.168.2.200192.168.2.253
dhcpserverdns-list202.102.152.3192.168.4.6
验证:
[R1-GigabitEthernet0/0/1]displayippoolinterfaceGigabitEthernet0/0/1
Pool-name:
GigabitEthernet0/0/1
Pool-No:
2
Lease:
1Days0Hours0Minutes
Domain-name:
-
DNS-server0:
202.102.152.3
DNS-server1:
192.168.4.6
NBNS-server0:
-
Netbios-type:
-
Position:
InterfaceStatus:
Unlocked
Gateway-0:
192.168.2.1
Mask:
255.255.255.0
VPNinstance:
--
-----------------------------------------------------------------------------
StartEndTotalUsedIdle(Expired)ConflictDisable
-----------------------------------------------------------------------------
192.168.2.1192.168.2.2542531198(0)054
-----------------------------------------------------------------------------
R2配置:
interfaceGigabitEthernet0/0/1
ipaddressdhcp-alloc
验证:
[R2]displayipinterfacebrief
*down:
administrativelydown
^down:
standby
(l):
loopback
(s):
spoofing
ThenumberofinterfacethatisUPinPhysicalis3
ThenumberofinterfacethatisDOWNinPhysicalis1
ThenumberofinterfacethatisUPinProtocolis3
ThenumberofinterfacethatisDOWNinProtocolis1
InterfaceIPAddress/MaskPhysicalProtocol
GigabitEthernet0/0/0192.168.3.1/24upup
GigabitEthernet0/0/1192.168.2.254/24upup
GigabitEthernet0/0/2unassigneddowndown
NULL0unassignedup
全局地址池配置:
R1:
ippoolaaa
gateway-list192.168.1.1
network192.168.1.0mask255.255.255.0
excluded-ip-address192.168.1.2192.168.1.99
dns-list202.102.152.3192.168.4.6
[R2]displayipinterfacebrief
*down:
administrativelydown
^down:
standby
(l):
loopback
(s):
spoofing
ThenumberofinterfacethatisUPinPhysicalis3
ThenumberofinterfacethatisDOWNinPhysicalis1
ThenumberofinterfacethatisUPinProtocolis3
ThenumberofinterfacethatisDOWNinProtocolis1
InterfaceIPAddress/MaskPhysicalProtocol
GigabitEthernet0/0/0192.168.3.1/24upup
GigabitEthernet0/0/1192.168.2.254/24upup
GigabitEthernet0/0/2unassigneddowndown
NULL0unassignedup
验证:
打开PC1和PC2,选择DHCP,查看是否能够获取到IP地址
DHCP中继实验
R1配置:
interfaceGigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]undodhcpselectinterface
[R1-GigabitEthernet0/0/1]dhcpselectglobal
[R1-GigabitEthernet0/0/1]quit
ippoolbbb
gateway-list192.168.3.1
network192.168.3.0mask255.255.255.0
dns-list202.102.152.3192.168.4.6
[AR1]iproute-static192.168.3.024192.168.2.2非常重要
AR2使用的源地址为配置中继代理的接口IP,目标IP地址为DHCP服务器的地址,而AR2去往192.168.2.1时,使用直连路由即可。
当AR1在返回报文的时候,目标地址即为接收到的这个DHCP报文的源地址,但AR1并没有去往192.168.3.1的路由,所以AR1上必须要添加以上这条静态路由。
R2配置:
[R2]interfaceg0/0/1
[R2-GigabitEthernet0/0/1]undoipaddressdhcp-alloc
[R2-GigabitEthernet0/0/1]ipaddress192.168.2.224
[R2-GigabitEthernet0/0/1]quit
interfaceGigabitEthernet0/0/0
ipaddress192.168.3.1255.255.255.0
dhcpselectrelay
dhcprelayserver-ip192.168.2.1
验证正常获取到IP地址:
全网互通需要在R2添加一条到192.168.1.0网段的路由条目,做到数据包有去有回
AR2:
iproute-static192.168.1.024192.168.2.1
验证测试成功:
PC1>ping192.168.3.254
Ping192.168.3.254:
32databytes,PressCtrl_Ctobreak
From192.168.3.254:
bytes=32seq=1ttl=126time=32ms
From192.168.3.254:
bytes=32seq=2ttl=126time=47ms
From192.168.3.254:
bytes=32seq=3ttl=126time=31ms
From192.168.3.254:
bytes=32seq=4ttl=126time=31ms
From192.168.3.254:
bytes=32seq=5ttl=126time=16ms
---192.168.3.254pingstatistics---
5packet(s)transmitted
5packet(s)received
0.00%packetloss
round-tripmin/avg/max=16/31/47ms
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 动态 主机 配置 协议 DHCP 案例