实验拓扑图

首先为每台设备接口配置IP地址。

PC1

PC2

AR1配置:

system-view

[Huawei]sysname AR1

[AR1]interface GigabitEthernet 0/0/0

[AR1-GigabitEthernet0/0/0]ip address 192.168.1.1 24

[AR1-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1

[AR1-GigabitEthernet0/0/1]ip address 10.10.1.1 24

[AR1]ip route-static 10.168.1.0 24 10.10.1.2 //下一跳地址

AR2配置:

system-view

[Huawei]sysname AR2

[AR2]interface GigabitEthernet 0/0/0

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

[AR2-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1

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

[AR2]ip route-static 10.168.1.0 24 20.20.1.2 //下一跳地址。

[AR2]ip route-static 192.168.1.0 24 10.10.1.1 //回包、下一跳地址。

AR3配置:

system-view

[Huawei]sysname AR3

[AR3]interface GigabitEthernet 0/0/0

[AR3-GigabitEthernet0/0/0]ip address 20.20.1.2 24

[AR3-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1

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

[AR3]ip route-static 192.168.1.0 24 20.20.1.1 //回包,下一跳地址。

PC1测试:

PC1

PC2测试:

PC2