华为运营商级路由器配置示例 | IPv4浮动静态路由
2023-09-14 09:09:07 时间
组网需求
路由器各接口及主机的IP地址和掩码如图1所示。在DeviceA上配置两条去往10.1.5.0/24的IPv4静态路由,其中优先级较高的主静态路由经过DeviceB,浮动静态路由经过DeviceC。
图1 配置IPv4浮动静态路由组网图
配置思路
- 首先配置各路由器各接口的IPv4地址。
- 在DeviceB和DeviceC上配置到目的地址10.1.5.0/24的IPv4静态路由。
- 在DeviceA上配置去往10.1.3.0/24和10.1.4.0/24的IPv4静态路由。
- 在DeviceA上配置两条去往10.1.5.0/24的优先级不同的IPv4静态路由。
- 为了使各路由器能够互通,在DeviceD上配置去往10.1.1.0/24和10.1.2.0/24的IPv4静态路由。
操作步骤
1.配置各接口的IP地址请参见配置文件
2.配置IPv4静态路由
# 在DeviceB上配置IPv4静态路由。
[~DeviceB] ip route-static 10.1.5.0 24 10.1.3.2
[*DeviceB] commit
# 在DeviceC上配置IPv4静态路由。
[~DeviceC] ip route-static 10.1.5.0 24 10.1.4.2
[*DeviceC] commit
# 在DeviceA上配置IPv4静态路由。
[~DeviceA] ip route-static 10.1.3.0 24 10.1.1.2
[*DeviceA] ip route-static 10.1.4.0 24 10.1.2.2
[*DeviceA] ip route-static 10.1.5.0 24 10.1.1.2
[*DeviceA] ip route-static 10.1.5.0 24 10.1.2.2 preference 100
[*DeviceA] commit
# 在DeviceD上配置IPv4静态路由。
[~DeviceD] ip route-static 10.1.1.0 24 10.1.3.1
[*DeviceD] ip route-static 10.1.2.0 24 10.1.4.1
[*DeviceD] commit
3.查看配置结果
# 查看DeviceA上IP路由表中的静态路由信息。
<DeviceA> display ip routing-table protocol static
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
_public_ Routing Table : Static
Destinations : 3 Routes : 3 Configured Routes : 3
Static routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.3.0/24 Static 60 0 RD 10.1.1.2 GigabitEthernet1/0/1
10.1.4.0/24 Static 60 0 RD 10.1.2.2 GigabitEthernet1/0/2
10.1.5.0/24 Static 60 0 RD 10.1.1.2 GigabitEthernet1/0/1
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
# 在DeviceA上使用tracert命令验证连通性。
<DeviceA> tracert 10.1.5.1
traceroute to 10.1.5.1(10.1.5.1), max hops: 30 ,packet length: 40
1 10.1.1.2 90 ms 1 ms 1 ms
2 10.1.5.1 4 ms 1 ms 2 ms
# 在DeviceA的GE1/0/1接口下执行shutdown命令,模拟出现链路故障。
[~DeviceA] interface GigabitEthernet 1/0/1
[~DeviceA-GigabitEthernet1/0/1] shutdown
[~DeviceA-GigabitEthernet1/0/1] commit
# 查看DeviceA上IP路由表中的静态路由信息,可以看到去往10.1.5.0/24的路由切换到了下一跳为10.1.2.2的浮动静态路由上。
[~DeviceA-GigabitEthernet1/0/1] quit
[~DeviceA] quit
<DeviceA> display ip routing-table protocol static
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
_public_ Routing Table : Static
Destinations : 2 Routes : 2 Configured Routes : 2
Static routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.4.0/24 Static 60 0 RD 10.1.2.2 GigabitEthernet1/0/2
10.1.5.0/24 Static 100 0 RD 10.1.2.2 GigabitEthernet1/0/2
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
# 在DeviceA上使用tracert命令验证连通性。
<DeviceA> tracert 10.1.5.1
traceroute to 10.1.5.1(10.1.5.1), max hops: 30 ,packet length: 40
1 10.1.2.2 100 ms 1 ms 1 ms
2 10.1.5.1 5 ms 1 ms 2 ms
相关文章
- ubuntu添加静态路由表_Ubuntu配置静态ip
- 华为静态路由配置[通俗易懂]
- 静态路由的基本配置实验总结_三个路由器配置静态路由
- VirtualBox 下 CentOS7 静态 IP 的配置 → 多次踩坑总结,蚌埠住了!
- 为你的Nginx配置免费SSL证书
- nginx rewrite伪静态配置参数详解
- konga配置Basic Auth
- 【Groovy】Groovy 扩展方法 ( 静态扩展方法配置 | 扩展方法示例 | 编译静态扩展类 | 打包静态扩展类字节码到 jar 包中 | 测试使用 Thread 静态扩展类 )
- Linux基础:Linux 下的 httpd静态网页配置教程
- centos 6.5下安装oracle 11gR2与Oracle自动启动的配置
- 详解Centos8 配置静态IP的实现
- 开发环境配置Linux实现PHP开发环境(linux配置php)
- MySQL Variables collation_database 数据库 参数变量解释及正确配置使用
- 配置Oracle组件配置:初步探究.(oracle组件)
- Oracle静态监听配置指南(oracle静态监听配置)
- Linux设置静态IP实现稳定连网(配置静态iplinux)
- Oracle动态监听配置指南(oracle动态监听配置)
- IIS6中.net项目伪静态重写路径的配置方法
- mssql数据库服务器硬件配置要求(mssql硬件要求)
- MySQL认证连接配置指南(c mysql认证连接串)
- ms基于Redis实现RDBMS数据库的配置(redis配置支持rdb)
- iis6伪静态重写路径的配置步骤(.net项目)
- eclipse配置tomcat开发DynamicWebProject环境图解