<>实验目的

掌握eNSP模拟器的基本设置方法
掌握使用eNSP搭建简单的端到端网络的方法

<>实验内容

配置网卡的计算机。
华为eNSP模拟软件。

<>实验原理、步骤及实验结果分析

(1)启动eNSP
eNSP模拟器的启动与初始化界面。 通过模拟器的使用将能够快速学习与掌握TCP/IP的原理知识,熟悉网络中的各种操作。

(2)建立拓扑
添加PC:在左侧面板顶部,单击“ ”图标。在显示的终端设备中,选中“
”图标,把图标拖动到空白界面上,使用相同步骤,拖动三个PC图标到空白界面上,并双击设备名称改名为PC1,PC2,PC3,PC4,PC5。
添加交换机:在左侧面板顶部,单击“ ”图标。在显示的交换机中,选中S5700图标,把图标拖动到空白界面上。

(3)建立物理连接
在左侧面板顶部,单击“”图标。在显示的连接中,选中图标,单击设备选择端口完成连接。设备端连接关系如下。

(4)进入终端系统配置界面
右击一台终端(PC1、PC2、PC3)设备,在弹出的属性菜单中选择“设置”选项,查看该设备系统配置信息。

(5)配置终端系统

选择“基础配置”标签页,在“主机名”文本框中输入主机名称。在“IPv4配置”区域,单击“静态”选项按钮。在“IP地址”文本框中输入IP地址。按照下图所示配置PC1的IP地址及子网掩码。配置完成后,单击窗口右下角的“应用”按钮,再单击“PC1”窗口右上角的关闭该窗口(PC4-PC5相同)。
(6)启动终端系统设备
右击一台设备,在弹出的菜单中,选择“启动”选项或菜单中选项,启动该设备。

(7)生成接口流量
使用ping命令发送ICMP报文。在命令行界面输入ping 命令,其中设置为对端设备的IP地址(PC2 Ping PC3为例)。

注:此测试已提前设置静态IP与以下实验内容无关(其中PC2为192.168.1.5,PC3为192.168.2.3)
(8)捕获接口报文

选中设备PC1并右击,在显示的菜单中单击“数据抓包”选项后,会显示设备上可用于抓包的接口列表。从列表中选择需要被监控的接口。启动Wireshark进行抓包分析

<>实验要求:

1.全网使用192.168.1.0/24网段进行划分,尽量减少路由条目Pc端IP使用pHcP技术进行自动下发
2.使用静态路由达到全网可达程度
3.操作步骤黏贴代码并加以注释

<>实验拓扑图:

Code:
(1) AR1的配置
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) [Huawei]
sysname r1 #修改名字[r1]interface g0/0/0 #对该接口进行相应的配置 [r1-GigabitEthernet0/0/0]ip
address192.168.1.1 26 #给接口添加对应的IP [r1-GigabitEthernet0/0/0]interface g0/0/1
#对该接口进行相应的配置[r1-GigabitEthernet0/0/1]ip address 192.168.1.65 26 #给接口添加对应的IP [r1-
GigabitEthernet0/0/1]q #退出当前模式 [r1]dhcp enable #开启dhcp功能 [r1]ip pool a
#创建一个全局地址池[r1-ip-pool-a]network 192.168.1.0 mask 26 #配置全局地址池分配网段范围 [r1-ip-pool-a
]gateway-list 192.168.1.1 #配置dncp客户端网关地址 [r1-ip-pool-a]dns-list 192.168.1.2
#指定接口下dns服务器[r1-ip-pool-a]q #退出当前模式 [r1]interface g0/0/0 #对该接口进行相应的配置 [r1-
GigabitEthernet0/0/0]dhcp select global #开启接口的dncp功能使用全局地址池为客户端分配地址 [r1-
GigabitEthernet0/0/0]q #退出当前模式 [r1]ip route-static 192.168.1.128 26 192.168.1.66
#配置下一跳路由ip[r1]q #退出当前模式 <r1>save #手动保存当前配置命令 The current configuration will be
written to the device. Are you sure to continue? (y/n)[n]:y
(2)AR2的配置
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) [Huawei]
sysname r2[r2]interface g0/0/0 #对该接口进行相应的配置 [r2-GigabitEthernet0/0/0]ip address
192.168.1.66 26 #给接口添加对应的IP [r2-GigabitEthernet0/0/0]interface g0/0/1
#对该接口进行相应的配置[r2-GigabitEthernet0/0/1]ip address 192.168.1.129 26 #给接口添加对应的IP [r2
-GigabitEthernet0/0/1]q #退出当前模式 [r2]dhcp enable #开启dhcp功能 [r2]ip pool b
#创建一个全局地址池[r2-ip-pool-b]network 192.168.1.128 mask 26 #配置全局地址池分配网段范围 [r2-ip-pool
-b]gateway-list 192.168.1.129 #配置dncp客户端网关地址 [r2-ip-pool-b]dns-list 192.168.1.2
#指定接口下dns服务器[r2-ip-pool-b]interface g0/0/1 #对该接口进行相应的配置 [r2-GigabitEthernet0/0/1
]dhcp select global [r2-GigabitEthernet0/0/1]q #退出当前模式 [r2]ip route-static
192.168.1.0 26 192.168.1.65 #配置下一跳路由ip [r2]q #退出当前模式 <r2>save #手动保存当前配置命令 The
current configuration will be written to the device. Are you sure to continue? (
y/n)[n]:y

<>实验要求:

1、除5的环回地址固定以外,整个其他所有网段基于192.168.1.0/24进行合理的IP地址划分
2、R1-R4每个路由器存在两个环回接口,用于模拟连接pc网段﹔地址也在192.168.1.0/24这个网络范围内
3、R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问
4、全网可达,尽量减少每台路由器,路由表条目数量,避免环路出现5R4与R5间,正常100oA链路通信,故障时自动改为100M

<>实验拓扑图:

Code:
(1) AR1配置
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) [Huawei]
sysname r1[r1]interface g0/0/1 #对该接口进行相应的配置 [r1-GigabitEthernet0/0/1]ip address
192.168.1.5 30 #给接口添加对应的IP [r1-GigabitEthernet0/0/1]interface g0/0/0
#对该接口进行相应的配置[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30 #给接口添加对应的IP [r1-
GigabitEthernet0/0/0]q #退出当前模式 [r1]ip route-static 192.168.1.8 30 192.168.1.2
#配置下一跳路由ip[r1]ip route-static 192.168.1.16 30 192.168.1.2 #配置下一跳路由ip [r1]ip
route-static 192.168.1.20 30 192.168.1.2 #配置下一跳路由ip [r1]ip route-static 192.168
.1.20 30 192.168.1.6 #配置下一跳路由ip [r1]ip route-static 192.168.1.16 30 192.168.1.6
#配置下一跳路由ip[r1]ip route-static 192.168.1.12 30 192.168.1.6 #配置下一跳路由ip [r1]ip
route-static 0.0.0.0 0.0.0.0 192.168.1.6 #配置下一跳路由ip [r1]ip route-static 0.0.0.0
0.0.0.0 192.168.1.2 #配置下一跳路由ip [r1]ip route-static 192.168.1.0 24 NULL0
#配置下一跳路由ip[r1]ip route-static 192.168.1.0 26 NULL0 #配置下一跳路由ip <r1>save
#手动保存当前配置命令 Are you sure tocontinue? (y/n)[n]:y [r1]ping 192.168.1.17 PING
192.168.1.17: 56 data bytes, press CTRL_C to break Reply from 192.168.1.17:
bytes=56 Sequence=1 ttl=254 time=50 ms Reply from 192.168.1.17: bytes=56
Sequence=2 ttl=254 time=30 ms Reply from 192.168.1.17: bytes=56 Sequence=3 ttl=
254 time=40 ms Reply from 192.168.1.17: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from192.168.1.17: bytes=56 Sequence=5 ttl=254 time=30 ms --- 192.168.1.17
ping statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet
loss round-trip min/avg/max = 30/36/50 ms [r1]ping 192.168.1.13 PING 192.168.1
.13: 56 data bytes, press CTRL_C to break Reply from 192.168.1.13: bytes=56
Sequence=1 ttl=255 time=40 ms Reply from 192.168.1.13: bytes=56 Sequence=2 ttl=
255 time=20 ms Reply from 192.168.1.13: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from192.168.1.13: bytes=56 Sequence=4 ttl=255 time=20 ms Reply from
192.168.1.13: bytes=56 Sequence=5 ttl=255 time=20 ms --- 192.168.1.13 ping
statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss
round-trip min/avg/max = 20/24/40 ms
(2)AR2配置,AR3类似
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) [Huawei]
sysname r2[r2]interface g0/0/1 #对该接口进行相应的配置 [r2-GigabitEthernet0/0/1]ip address
192.168.1.9 30 #给接口添加对应的IP [r2-GigabitEthernet0/0/1]interface g0/0/0
#对该接口进行相应的配置[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30 #给接口添加对应的IP [r2]
ip route-static 192.168.1.4 30 192.168.1.1 #配置下一跳路由ip [r2]ip route-static
192.168.1.12 30 192.168.1.10 #配置下一跳路由ip [r2]ip route-static 192.168.1.16 30
192.168.1.10 #配置下一跳路由ip [r2]ip route-static 192.168.1.20 30 192.168.1.10
#配置下一跳路由ip[r2]ip route-static 192.168.1.0 24 NULL0 #配置下一跳路由ip [r2]ip route-
static 192.168.1.0 26 NULL0 #配置下一跳路由ip [r2]ip route-static 0.0.0.0 0.0.0.0
192.168.1.10 #配置下一跳路由ip [r2]q #退出当前模式 <r2>save #手动保存当前配置命令 The current
configuration will be written to the device. Are you sure to continue? (y/n)[n]:
y
(3)AR4配置
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) [Huawei]
sysname r4[r4]interface g0/0/0 #对该接口进行相应的配置 [r4-GigabitEthernet0/0/0]ip address
192.168.1.10 30 #给接口添加对应的IP [r4-GigabitEthernet0/0/0]interface g0/0/1
#对该接口进行相应的配置[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30 #给接口添加对应的IP [r4-
GigabitEthernet0/0/1]interface g0/0/2 #对该接口进行相应的配置 [r4-GigabitEthernet0/0/2]ip
address192.168.1.15 30 #给接口添加对应的IP Error: The specified IP address is invalid. [
r4-GigabitEthernet0/0/2]interface g4/0/0 #对该接口进行相应的配置 [r4-GigabitEthernet4/0/0]
ip address192.168.1.21 30 #给接口添加对应的IP [r4-GigabitEthernet4/0/0]q #退出当前模式 [r4]
interface g0/0/2 #对该接口进行相应的配置 [r4-GigabitEthernet0/0/2]ip address 192.168.1.17
30 #给接口添加对应的IP [r4-GigabitEthernet0/0/2]q #退出当前模式 [r4]display ip interface
brief #对该接口进行相应的配置 The number of interface that is UP in Physical is5 The
number of interface that is DOWN in Physical is0 The number of interface that
is UP in Protocol is5 The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.1.10/30
up up GigabitEthernet0/0/1 192.168.1.14/30 up up GigabitEthernet0/0/2 192.168.1
.17/30 up up GigabitEthernet4/0/0 192.168.1.21/30 up up NULL0 unassigned up up(s
) [r4]ip route-static 192.168.1.0 30 192.168.1.9 #配置下一跳路由 [r4]ip route-static
192.168.1.4 30 192.168.1.13 #配置下一跳路由 [r4]ip route-static 0.0.0.0 0.0.0.0 192.168
.1.18 #配置下一跳路由 [r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61
#配置下一跳路由[r4]ip route-static 192.168.1.0 26 NULL0 #配置下一跳路由 [r4]ip route-static
192.168.1.0 24 NULL0 #配置下一跳路由 [r4]ping 5.5.5.1 PING 5.5.5.1: 56 data bytes,
press CTRL_C tobreak Reply from 5.5.5.1: bytes=56 Sequence=1 ttl=255 time=120
ms Reply from5.5.5.1: bytes=56 Sequence=2 ttl=255 time=40 ms Reply from 5.5.5.1:
bytes=56 Sequence=3 ttl=255 time=20 ms Reply from 5.5.5.1: bytes=56 Sequence=4
ttl=255 time=20 ms Reply from 5.5.5.1: bytes=56 Sequence=5 ttl=255 time=20 ms --
- 5.5.5.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00%
packet loss round-trip min/avg/max = 20/44/120 ms [r4]ping 192.168.1.1 PING
192.168.1.1: 56 data bytes, press CTRL_C to break Request time out Reply from
192.168.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms Reply from 192.168.1.1:
bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 192.168.1.1: bytes=56 Sequence
=4 ttl=254 time=30 ms Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=
30 ms --- 192.168.1.1 ping statistics --- 5 packet(s) transmitted 4 packet(s)
received20.00% packet loss round-trip min/avg/max = 30/35/50 ms
(4)AR5配置
<Huawei>system-view #进入系统视图模式(默认的是用户视图< Huawei >,系统视图是 [ Huawei ]) Enter
system view, return user view with Ctrl+Z. [Huawei]sysname r5 [r5]interface g0/0
/0 #对该接口进行相应的配置 [r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30 #给接口添加对应的IP
[r5-GigabitEthernet0/0/0]interface g0/0/1 #对该接口进行相应的配置 [r5-GigabitEthernet0/0/1]
ip address192.168.1.22 30 #给接口添加对应的IP [r5-GigabitEthernet0/0/1]interface g0/0/2
#对该接口进行相应的配置[r5-GigabitEthernet0/0/2]ip address 5.5.5.1 24 #给接口添加对应的IP [r5]ip
route-static 0.0.0.0 0.0.0.0 192.168.1.21 preference 61 #配置下一跳路由 [r5]ip route-
static 0.0.0.0 0.0.0.0 192.168.1.17 #配置下一跳路由 [r5]ping 192.168.1.5 PING 192.168.1
.5: 56 data bytes, press CTRL_C to break Request time out Request time out
Reply from192.168.1.5: bytes=56 Sequence=3 ttl=253 time=30 ms Reply from 192.168
.1.5: bytes=56 Sequence=4 ttl=253 time=50 ms Reply from 192.168.1.5: bytes=56
Sequence=5 ttl=253 time=40 ms --- 192.168.1.5 ping statistics --- 5 packet(s)
transmitted3 packet(s) received 40.00% packet loss round-trip min/avg/max = 30/
40/50 ms [r5]ping 192.168.1.9 PING 192.168.1.9: 56 data bytes, press CTRL_C to
break Reply from 192.168.1.9: bytes=56 Sequence=1 ttl=254 time=40 ms Reply from
192.168.1.9: bytes=56 Sequence=2 ttl=254 time=30 ms Reply from 192.168.1.9:
bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 192.168.1.9: bytes=56 Sequence
=4 ttl=254 time=30 ms Reply from 192.168.1.9: bytes=56 Sequence=5 ttl=254 time=
30 ms --- 192.168.1.9 ping statistics --- 5 packet(s) transmitted 5 packet(s)
received0.00% packet loss round-trip min/avg/max = 30/32/40 ms <r5>save
#手动保存当前配置命令 The current configuration will be written to the device. Are you
sure tocontinue? (y/n)[n]:y

<>附录

(1) 192.168.1.0/24划分为4个子网,写出每个子网可用ip地址范围:

192.168.1.0/26 可用范围:192.168.1.1-192.168.1.62
192.168.1.64/26 可用范围:192.168.1.65-192.168.1.126
192.168.1.128/26 可用范围:192.168.1.129-192.168.1.190
192.168.1.192/26 可用范围:192.168.1.193-192.168.1.254

(2)172.16.0.0/15 划分为4个网段,并写出每个网段的可用地址范围:

172.16.0.0/17 可用范围:172.16.0.1-172.16.127.254
172.16.128.0/17 可用范围172.16.128.1-172.16.255.254
172.17.0.0/17 可用范围172.17.0.1-172.17.128.254
172.17.128.0/17 可用范围172.17.128.1-172.17.255.254

(3)进行子网汇总;
172.16.33.0/24
172.16.44.0/24
172.16.55.0/24
172.16.63.0/24

结果:172.16.32.0/19

技术
今日推荐
PPT
阅读数 131
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信