静态路由命令及配置【华为】

       静态路由由网络管理员手动配置,配置方便,对系统要求低,适用于拓扑结构简单并且稳定的小型网络。
       缺点是不能自动适应网络拓扑的变化,需要人工干预。

配置命令

1、关联下一跳IP的方式

[Huawei] ip route-static ip-address { mask | mask-length } nexthop-address

2、关联出接口的方式

[Huawei] ip route-static ip-address { mask | mask-length } interface-type interface-number

3、关联出接口和下一跳IP方式

[Huawei] ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ]

在创建静态路由时,可以同时指定出接口和下一跳。对于不同的出接口类型,也可以只指定出接口或只指定下一跳。

对于点到点接口(如串口),必须指定出接口。

配置举例

 
RTA RTC 上配置静态路由,实现 10.0.0.0/24 20.1.1.0/24 的互通。
因为报文 是逐跳转发 的, 所以 每一跳 路由 设备上都需要 配置到达相应 目的地址的路由。
另外需要注意通信是双向的 ,针对通信过程中的往返流量,都需关注途径设备上的路由配置。

RTA

system-view
sysname RTA
interface GigabitEthernet 0/0/0
ip address 10.0.0.1 255.255.255.0
quit
ip route-static 20.1.1.0 255.255.255.0 10.0.0.2 

 

RTB

system-view
sysname RTB
interface GigabitEthernet 0/0/0
ip address 10.0.0.2 255.255.255.0
interface GigabitEthernet 0/0/1
ip address 20.1.1.2 255.255.255.0

 

RTC

system-view
sysname RTC
interface GigabitEthernet 0/0/1
ip address 20.1.1.1 255.255.255.0
quit
ip route-static 10.0.0.0 255.255.255.0 20.1.1.2

  • 5
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值