静态路由的配置
第一步,PC设置IP地址和网关
第二步,路由器配置接口地址
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 202.101.12.1 24
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 202.101.12.2 24
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 202.101.23.2 24
[Huawei]sys R3
[R3]
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[R3-GigabitEthernet0/0/0]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 202.101.23.3 24
进行直连的ping测试
第三步,配置静态路由
R1:
ip route-static 192.168.2.0 255.255.255.0 202.101.12.2
ip route-static 192.168.3.0 255.255.255.0 202.101.12.2
ip route-static 202.101.23.0 255.255.255.0 202.101.12.2
R2:
ip route-static 192.168.1.0 255.255.255.0 202.101.12.1
ip route-static 192.168.3.0 255.255.255.0 202.101.23.3
R3:
[R3]ip route-s 192.168.1.0 24 202.101.23.2
[R3]ip route-s 192.168.2.0 24 202.101.23.2
[R3]ip route-s 202.101.12.0 24 202.101.23.2
[R2]ip route-s 192.168.1.0 24 202.101.12.1