25.策略路由

简介:

策略路由:根据定义的策略让路由选择下一跳位置。

策略路由的作用:当内网去访问公网的路有两条,但是在同一路由器上我们就需要借助策略路由来指路,控制网段的流量走向,指定流量的方向。

思科策略路由相关命令:

基于接口:

命令

描述

(config)#route-map ren permit 10

定义策略

(config-route-map)#match interface f0/0

当来自接口F0/0的流量

(config-route-map)#set ip next-hop 1.1.1.1 

则指定下一跳地址为

(config-if)#ip policy route-map ren   

将策略用于入口

基于网段:

命令

描述

(config)#access-list 1 permit 192.168.1.0 0.0.0.255

创建ACL定义网段

(config-route-map)#match ip address  1  

调用ACL

(config-route-map)#set ip next-hop 1.1.1.1

则指定下一跳地址为

(config-if)#ip policy route-map ren   

将策略用于入口

华为H3C策略路由相关命令:

基于ACL

命令

描述

[huawei] acl 2000

创建并进入ACL

[huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255

标准ACL

[huawei] route-policy ren permit node 10

创建策略路由

[huawei-route-policy] if-match acl 2000

调用ACL

[huawei-route-policy] apply ip-address next-hop 1.1.1.1

则指定下一跳地址为

[huawei] ip local policy-based-route ren

应用本地策略

[huawei] dispaly route-policy

查看路由策略


本文转自   触动的风   51CTO博客,原文链接:http://blog.51cto.com/10978134/1904197
相关文章
|
4月前
|
网络协议
使用MPLS LDP解决BGP路由黑洞的问题
MPLS LDP默认不为BGP路由分配标签
|
1月前
|
网络架构
|
7月前
|
网络架构
路由器和静态路由的配置
路由器和静态路由的配置
130 0
|
7月前
|
网络虚拟化 网络架构
单臂路由和三层交换
单臂路由和三层交换
51 0
|
运维 Shell 网络架构
静态路由详细讲解
静态路由详细讲解
194 0
静态路由详细讲解
|
NoSQL Redis 网络架构
BGP邻居路由黑洞+mpls ip
文章目录 要求: 拓扑: 命令:
75 0
BGP邻居路由黑洞+mpls ip
|
网络协议 算法 数据库
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
295 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(上)
|
网络协议 网络架构 iOS开发
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
文章目录 系列文件 概述 BGP AS BGP 邻居 BGP 更新源 BGP TTL BGP路由表 BGP 同步
350 0
概述、 BGP AS 、BGP 邻居、 BGP 更新源 、BGP TTL 、BGP路由表、 BGP 同步(下)
|
网络协议 网络架构
|
iOS开发 网络架构