计算机网络 数据链路层 使用eNSP搭建学习数据链路层环境

网友投稿 1023 2022-11-30

计算机网络 数据链路层 使用eNSP搭建学习数据链路层环境

计算机网络 数据链路层 使用eNSP搭建学习数据链路层环境

红线框出来的是以太网的接口,就是接计算机网卡的接口

现在搞个广域网的接口

现在将所有的设备启动

启动之后规划网段

PC1和PC2处于不同的网端

规划好不同的网端,给计算机PC1配置地址

给计算机PC2配置地址

PC2的网关就是AR3路由器的出口GE 0/0/0

现在来配置路由器接口的地址:

AR1 GE 0/0/0 使用192.168.1.0/24网端的192.168.1.1地址,也就是PC1的网关地址AR1 Serial 2/0/0 使用10.0.0.0/24网段的第一个地址  10.0.0.1AR2 Serial 2/0/1 使用10.0.0.0/24网段的第二个地址  10.0.0.2AR2 Serial 2/0/0 使用11.0.0.0/24网段的第一个地址  11.0.0.1AR3 Serial 2/0/1 使用11.0.0.0/24网段的第二个地址  11.0.0.2AR3 GE 0/0/0 使用192.168.2.0/24网段的第一个地址  192.168.2.1,也就是PC2的网关地址

AR1配置如下

system-view --进入系统视图[Huawei]sysname R1 -- 更改设备名称[R1]interface GigabitEthernet 0/0/0 --进入以太网即可[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24 --给接口配置IP地址Oct 9 2021 16:07:45-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.[R1-GigabitEthernet0/0/0]quit --退出接口[R1]interface Serial 2/0/0 --进入广域网接口[R1-Serial2/0/0]ip address 10.0.0.1 24 --给接口配置IP地址

AR2 配置如下:

system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R2[R2]interface Serial 2/0/1[R2-Serial2/0/1]ip address 10.0.0.2 24[R2-Serial2/0/1]Oct 9 2021 16:18:10-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial2/0/1 has entered the UP state.[R2-Serial2/0/1]quit[R2-Serial2/0/0]ip address 11.0.0.1 24

AR3 配置如下:

system-view [Huawei]sysname R3[R3-Serial2/0/1]ip add [R3-Serial2/0/1]ip address 11.0.0.2 24[R3-Serial2/0/1][R3-Serial2/0/1]Oct 9 2021 16:22:44-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial2/0/1 has entered the UP state.[R3-Serial2/0/1]quit [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 192.168.2.1 24Oct 9 2021 16:25:19-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.

现在测试PC1->AR1   AR1->AR2     AR2->AR3      AR3->PC2通不通

PC1->AR1  ping网关 可以看到是通的

AR1->AR2

AR2->AR3

AR3->PC2

现在需要配置路由表将整个网络配通

要想让pc1和pc2通信,就要经过不同的链路,总共有四条链路,不同的链路帧封装的格式是不一样的。

现在pc1是和pc2不通的,因为路由器没有配置路由规则,在路由器上添加规则告诉这个路由器,到pc2网段给的是哪个路由器。

在返回数据包的时候还要配置路由规则,得配置去的路由规则和返回的路由规则。这样数据包可以出去也能够返回。

去时候的路由

AR1配置路由

system-view Enter system view, return user view with Ctrl+Z.[R1]ip route-static 192.168.2.0 24 10.0.0.2

AR2配置路由

system-view Enter system view, return user view with Ctrl+Z.[R2]ip route-static 192.168.2.0 24 11.0.0.2

配置回来的路由

AR3配置路由

system-view Enter system view, return user view with Ctrl+Z.[R3]ip route-static 192.168.1.0 24 11.0.0.1

AR2配置路由

[R2]ip route-static 192.168.1.0 24 10.0.0.1

现在PC1应该可以和PC2可以通了

现在数据包有去有回

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:数据链路层 抓包观察 以太网 PPP HDLC数据链路层封装
下一篇:Prometheus 监控 CoreDNS
相关文章

 发表评论

暂时没有评论,来抢沙发吧~