计算机网络 数据链路层 使用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.1

  • AR2 Serial 2/0/1 使用10.0.0.0/24网段的第二个地址  10.0.0.2
  • AR2 Serial 2/0/0 使用11.0.0.0/24网段的第一个地址  11.0.0.1

  • AR3 Serial 2/0/1 使用11.0.0.0/24网段的第二个地址  11.0.0.2
  • AR3 GE 0/0/0 使用192.168.2.0/24网段的第一个地址  192.168.2.1,也就是PC2的网关地址

AR1配置如下

<Huawei>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 配置如下:

<Huawei>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 配置如下: 

<Huawei>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 24
Oct  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配置路由

<R1>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配置路由 

<R2>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配置路由 

<R3>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可以通了

 现在数据包有去有回

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值