1、静态路由
静态路由的路由项需要手动添加,而非动态路由,其是固定的,不会改变。
2、静态路由配置实例
(1)实验拓扑如下图所示:
(2)配置命令
AR1配置命令:
<Huawei>system-view #进入系统界面
[Huawei]interface GigabitEthernet 0/0/0 # 进入G端口
[Huawei-GigabitEthernet0/0/0]ip addr 10.1.1.1 24 # 配置G端口的IP地址和子网掩码
[Huawei-GigabitEthernet0/0/0]quit # 返回上一界面
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip addr 1.1.1.1 24
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]ip route-static 20.1.1.0 30 1.1.1.2 # 配置添加静态路由信息 目标网络,掩码,下一跳
<Huawei>display ip interface brief # 查看接口与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 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 10.1.1.1/24 up up
GigabitEthernet0/0/1 1.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
AR2配置命令:
<Huawei>system-view
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip addr 1.1.1.2 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip addr 20.1.1.1 30
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]ip route-static 10.1.1.0 30 1.1.1.1
来源:https://www.cnblogs.com/cyz123/p/11275977.html