【eNSP 华为模拟器】DHCP中继的配置与抓包分析

【eNSP 华为模拟器】DHCP中继的配置与抓包分析

  • 一、实验概述
  • 二、实验过程
    • 2.1 DHCP服务器(AR3)的配置
    • 2.2 AR2的配置
    • 2.3 AR1 (中继器)的配置
  • 三、实验结果
  • 四、抓包分析

一、实验概述

拓扑图
【eNSP 华为模拟器】DHCP中继的配置与抓包分析_第1张图片

二、实验过程

2.1 DHCP服务器(AR3)的配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable 
Info: Information center is disabled.
[Huawei]sysname R3

[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 172.16.1.20 24

[R3]ospf
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255

[R3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
//建立地址池
[R3]ip pool p1
[R3-ip-pool-p1]gateway-list 192.168.1.100
[R3-ip-pool-p1]network 192.168.1.0 mask 24
//在服务器接口处开启全局DHCP
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global 

2.2 AR2的配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable 
Info: Information center is disabled.

[Huawei]sysname R2
[R2]dhcp enable
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip address 172.16.1.10 24
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip addres 10.0.2.1 24
[R2]ospf
[R2-ospf-1]a 0	
[R2-ospf-1-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255

2.3 AR1 (中继器)的配置

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]undo info-center enable 
Info: Information center is disabled.

[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip ad	
[R1-GigabitEthernet0/0/1]ip address 10.0.2.2 24
[R1-GigabitEthernet0/0/0]ip address 192.168.1.100 24

[R1]ospf
[R1-ospf-1]a 0
[R1-ospf-1-area-0.0.0.0]network 10.0.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

[R1]dhcp enable //启用DHCP
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]dhcp server group p1    //在中继设备上设置DHCP组
Info:It's successful to create a DHCP server group.

//在组中添加DHCP服务器
[R1-dhcp-server-group-p1]dhcp-server 172.16.1.20 //服务器接口的IP

//在本地接口启动DHCP中继 同时映射该中继至DHCP组
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select relay
[R1-GigabitEthernet0/0/0]dhcp relay server-select p1

三、实验结果

PC1和PC2成功获取到DHCP下发的IP地址,DHCP中继成功。
【eNSP 华为模拟器】DHCP中继的配置与抓包分析_第2张图片

四、抓包分析

终端与DHCP中继组之间交互用的是广播形式
【eNSP 华为模拟器】DHCP中继的配置与抓包分析_第3张图片
DHCP中继组以单播的形式与DHCP服务器交互
【eNSP 华为模拟器】DHCP中继的配置与抓包分析_第4张图片

参考博客:
DHCP中继配置(华为ensp中所配置)
DHCP八种报文详解

你可能感兴趣的:(路由与交换)