锐捷

您所在的位置:网站首页 静态路由配置要点 锐捷

锐捷

2024-07-02 01:34| 来源: 网络整理| 查看: 265

功能介绍:

当网络中存在多条相同路由器时,会优先选取AD值(路由可信度、值越小,路由越优先)小的路由为主用路由,AD值大的路由为备份路由。当主用路由的下一跳不可达,主用路由器消失,备用路由器生效切换为主用。当网络中有多条路径到达目的网络时,可以通过配置多条静态路由,修改静态路由的AD值,来实现主备链路的备份,该功能即为浮动路由。 建议在以太网链路,配置静态路由的时候,配置为出接口+下一跳地址 若是在PPP、HDLC广域网链路,静态路由配置为本地出接口和下一跳IP地址均可以,因为PPP、HDLC为点到点链路,不涉及二层地址解析。

应用场景:

企业有两个出口线路,需要实现两个出口线路一主一备,正常情况下从主用线路上网,当主用线路出现故障时,能够自动切换到备份线路,保证网络正常运行,此时可以在路由器上启用浮动静态路由。

组网需求:

路由器的两条路径可以到达目的网络 当主线路(示例主用线路为F0/0)失效时(接口down或线路断开),备用线路切换为主用。

组网拓扑:

在这里插入图片描述

配置要点: 配置路由器R1接口IP配置路由器R2接口IP配置路由器R1静态路由配置路由器R2静态路由配置验证 配置步骤: 配置路由器R1接口IP Ruijie>enable //进入全局模式 Ruijie#configure terminal //进入特权模式 Ruijie(config)#interface fastethernet 0/2 //进入接口 Ruijie(config-if-FastEthernet 0/2)#ip address 192.168.4.1 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/2)#interface fastethernet 0/1 //进入接口 Ruijie(config-if-FastEthernet 0/1)#ip address 192.168.1.254 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/1)#interface fastethernet 0/0 //进入接口 Ruijie(config-if-FastEthernet 0/0)#ip address 192.168.3.1 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/0)#exit //退出到特权模式 配置路由器R2接口IP Ruijie>enable //进入全局模式 Ruijie#configure terminal //进入特权模式 Ruijie(config)#interface fastethernet 0/2 //进入接口 Ruijie(config-if-FastEthernet 0/2)#ip address 192.168.4.2 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/2)#interface fastethernet 0/1 //进入接口 Ruijie(config-if-FastEthernet 0/1)#ip address 192.168.2.254 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/1)#interface fastethernet 0/0 //进入接口 Ruijie(config-if-FastEthernet 0/0)#ip address 192.168.3.2 255.255.255.0 //配置IP地址 Ruijie(config-if-FastEthernet 0/0)#exit //退出到特权模式 配置路由器R1静态路由 Ruijie(config)#ip route 192.168.2.0 255.255.255.0 fastethernet 0/0 192.168.3.2 //目的地址是192.168.2.0/24的数据包,转发给192.168.3.2 Ruijie(config)#ip route 192.168.2.0 255.255.255.0 fastethernet 0/2 192.168.4.2 10 //目的地址是192.168.2.0/24的数据包,转发给192.168.4.2,管理距离是10(默认管理距离为1,越小越优先) 配置路由器R2静态路由 Ruijie(config)#ip route 192.168.1.0 255.255.255.0 fastethernet 0/0 192.168.3.1 //目的地址是192.168.1.0/24的数据包,转发给192.168.3.1 Ruijie(config)#ip route 192.168.1.0 255.255.255.0 fastethernet 0/2 192.168.4.1 10 //目的地址是192.168.1.0/24的数据包,转发给192.168.4.1,管理距离是10(默认管理距离为1,越小越优先) 配置验证 R1上当主用线路(F0/0)正常时,使用命令 RuiJie# show ip route 查看路由 Ruijie#show ip route Codes: C - connected, S - static, R - RIP, B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is no set S 192.168.2.0/24 [1/0] via 192.168.3.2, FastEthernet 0/0 //去往192.168.2.0 走主用线路F0/0,下一跳为192.168.3.2 C 192.168.1.0/24 is directly connected, FastEthernet 0/1 C192.168.1.254/32 is local host. C 192.168.3.0/24 is directly connected, FastEthernet 0/0 C 192.168.3.1/32 is local host. C 192.168.4.0/24 is directly connected, FastEthernet 0/2 C 192.168.4.1/32 is local host. R1上拔掉R1主用线路(F0/0接口)的线缆,确定路由是否切换到备份线路,使用命令 RuiJie# show ip route 查看路由 Ruijie#sho ip route Codes: C - connected, S - static, R - RIP, B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is no set S 192.168.2.0/24 [10/0] via 192.168.4.2 ,FastEthernet 0/2 //去往192.168.2.0走备用线路F0/2,下一跳192.168.4.2,主备线路正常切换 C 192.168.1.0/24 is directly connected, FastEthernet 0/1 C 192.168.1.254/32 is local host. C 192.168.4.0/24 is directly connected, FastEthernet 0/2 C 192.168.4.2/32 is local host.

在这里插入图片描述



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3