拓扑图如下:
条件:
需要两台AR1220路由设备
需要两台S3700交换机
两台pc机:
pc1: 192.168.1.2 255.255.255.0
pc2: 192.168.3.2 255.255.255.0
========================================
修改主机名 设置IP地址和子网掩码
AR-1:
<Huawei>system-view //进系统视图
[Huawei]sysname AR-1 //修改主机名为AR-1
[AR-1]int g0/0/0 //进g0/0/0接口
[AR-1-GigabitEthernet0/0/0]ip address 192.168.1.1 24 //设置IP地址和子网掩码
[AR-1-GigabitEthernet0/0/0]int g0/0/1 //g0/0/0切换到g0/0/1接口
[AR-1-GigabitEthernet0/0/1]q //从接口视图退到系统视图
[AR-1]dis ip int brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up 重点查看这里
GigabitEthernet0/0/1 192.168.2.1/24 up up 重点查看这里
NULL0 unassigned up up(s)
==========================================================================================
AR-2:
<Huawei>system-view //进系统视图
[Huawei]sysname AR-2 //修改主机名为:AR-2
[AR-2]int g0/0/0 //进g0/0/0接口
[AR-2-GigabitEthernet0/0/0]ip address 192.168.3.1 24 //设置IP地址和子网掩码
[AR-2-GigabitEthernet0/0/0]int g0/0/1 //从g0/0/0切换到g0/0/1接口
[AR-2-GigabitEthernet0/0/1]ip address 192.168.2.2 24 //设置IP地址和子网掩码
[AR-2-GigabitEthernet0/0/1]q //从接口视图退到系统视图
[AR-2]dis ip int bri //查看IP地址和子网掩码
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.3.1/24 up up 重点查看这里
GigabitEthernet0/0/1 192.168.2.2/24 up up 重点查看这里
NULL0 unassigned up up(s)
=====================================================================================================
在AR-1上配置默认路由 下一条是2.2的IP地址 配置如下:
[AR-1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2 配置静态路由
在AR-2上配置默认路由 下一条是2.1的IP地址 配置如下:
[AR-2]ip route-static 0.0.0.0 0.0.0.0 192.168.2.1 配置静态路由
========================================================================================================
抓包操作如下:
这是1.2 去ping3.2 是可以ping通的
如果发生黑色下面的就说明没有这个包,如何解决?
=================================================================================================
解决方法如下命令:
先在AR-2上面undo 掉 2.1
[AR-2]undo ip route-static 0.0.0.0 0.0.0.0 192.168.2.1
加入从1.0网段去往2.1的路由命令如下:
[AR-2]ip route-static 192.168.1.0 24 192.168.2.1
=============================================================================================
在次ping 包 并打开AR1 g0/0/0的抓包
ping 192.168.4.1 如果出现这样的提示 说明实验完成