静态路由配置
网络拓扑:
PC1:
ip:192.168.1.2 /24
gateway:192.168.1.1
PC2:
ip:192.168.2.2 /24
gateway :192.168.2.1
R1配置:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] undo info-center enable
Info: Information center is disabled.
[Huawei] sysname R1
[R1] interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0] ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0] interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.1.1.1 24
[R1-GigabitEthernet0/0/1] quit
[R1] ip route-static 192.168.2.0 24 10.2.2.2
[R1] ip route-static 192.168.2.0 24 10.1.1.2
R2配置:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] undo info-center enable
Info: Information center is disabled.
[Huawei] sysname R1
[R2] interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 10.1.1.2 24
[R2-GigabitEthernet0/0/1] interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2] ip address 10.2.2.1 24
[R2-GigabitEthernet0/0/2] quit
[R2] ip route-static 192.168.2.0 24 10.2.2.2
[R2] ip route-static 192.168.1.0 24 10.1.1.1
R3配置:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] undo info-center enable
Info: Information center is disabled.
[Huawei] sysname R3
[R3] interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2] ip address 10.2.2.2 24
[R3-GigabitEthernet0/0/2] interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0] ip address 192.168.2.1 24
[R3-GigabitEthernet0/0/0] quit
[R3] ip route-static 192.168.1.0 24 10.2.2.1