策略路由,route-policy
笔记来源,b站,fishqueen100
1. 拓扑
要求如下:
- 教学区流量走电信;
- 办公区流量走联通;
- 当出口路由器的上行链路故障时,自动切换链路。例如,当教学区的无法通过电信网络上网时,这时自动切换为联通网络上网;
2. 解决
解决步骤如下:
- 搭建拓扑图并配置各设备的IP地址;
- 配置网络的联通性;
- 配置路由策略:
(1)匹配流量acl; (2)流分类traffic classifier (3)流行为traffic behavior (4)流策略traffic policy (5)应用traffic-policy 流策略名 inbound/outbound
这里的主要问题是路由协议的问题,我们可以通过直接配置路由策略解决该问题。
acl number 2000
rule 5 permit source 192.168.1.0 0.0.0.255
rule 10 permit source 192.168.2.0 0.0.0.255
acl number 2010
rule 5 permit source 192.168.1.0 0.0.0.255
acl number 2020
rule 5 permit source 192.168.2.0 0.0.0.255
traffic classifier jiaoxue
if-match acl 2010
traffic classifier work
if-match acl 2020
traffic behavior lian
redirect ip-nexthop 13.1.1.2
traffic behavior dianxin
redirect ip-nexthop 12.1.1.2
traffic policy p2
classifier work behavior lian
traffic policy p1
classifier jiaoxue behavior dianxin
interface GigabitEthernet0/0/0
traffic-policy p1 inbound
interface GigabitEthernet0/0/1
traffic-policy p2 inbound
|