网工必会实验:DHCP配置(中继)!

1. 实验目的

  1. 熟悉DHCP中继的应用场景
  2. 掌握DHCP中继的配置方法

2. 实验拓扑

DHCP中继配置实验拓扑如图所示:

                     

3. 实验步骤

  1. IP地址的配置

AR1的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname AR1

AR2的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname AR2

[AR2]interface g0/0/1

[AR2-GigabitEthernet0/0/1]ip address 192.168.1.2 24

[AR2-GigabitEthernet0/0/1]quit

[AR2]interface g0/0/0

[AR2-GigabitEthernet0/0/0]ip address 23.1.1.2 24

[AR2-GigabitEthernet0/0/0]quit

AR3的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname AR3

[AR3]interface g0/0/1

[AR3-GigabitEthernet0/0/1]ip address 23.1.1.3 24

[AR3-GigabitEthernet0/0/1]quit

[AR3]ip route-static 192.168.1.0 24 23.1.1.2

  1. DHCP的配置

AR1的配置

[AR1]dhcp enable   //开启DHCP服务

[AR1]interface g0/0/0  //进入到接口g0/0/0

[AR1-GigabitEthernet0/0/0]ip address dhcp-alloc   //地址通过DHCP分配

[AR1-GigabitEthernet0/0/0]quit

AR2的配置

[AR2]dhcp enable  //开启DHCP服务

[AR2]dhcp server group joinlabs  //创建DHCP服务器组名字叫joinlabs

[AR2-dhcp-server-group-joinlabs]dhcp-server 23.1.1.3  //DHCP服务器成员

[AR2-dhcp-server-group-joinlabs]quit

[AR2]interface g0/0/1

[AR2-GigabitEthernet0/0/1]dhcp  select relay   //在接口下开启DHCP中继功能

[AR2-GigabitEthernet0/0/1]dhcp relay server-select joinlabs

[AR2-GigabitEthernet0/0/1]quit

AR3的配置

[AR3]dhcp enable

[AR3]ip pool joinlabs

[AR3-ip-pool-joinlabs]network 192.168.1.0 mask 24

[AR3-ip-pool-joinlabs]gateway-list 192.168.1.2

[AR3-ip-pool-joinlabs]quit

[AR3]interface g0/0/1

[AR3-GigabitEthernet0/0/1]dhcp  select global

[AR3-GigabitEthernet0/0/1]quit

4. 实验调试

  1. 在AR1上查看接口IP地址

<AR1>display ip int b

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 2

The number of interface that is DOWN in Physical is 2

The number of interface that is UP in Protocol is 2

The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  

GigabitEthernet0/0/0              192.168.1.254/24     up         up        

GigabitEthernet0/0/1              unassigned           down       down      

通过以上输出可以看到,AR1的g0/0/0接口获得一个192.168.1.254的地址

  1. 让AR1重新获取IP地址,然后在AR2的g0/0/0抓包分析:

第一个包:Discover

Discover的包文结构如图所示:

                     

第二个包:Offer

Offer的包文结构如图所示:

  

第三个包:Request

Request的包文结构如图所示:

 

第四个包:ACK

ACK的包文结构如图所示:

更多实验拓扑资料可领取(部分示意)

关注+点赞后,私信找我领取!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值