router4 策略路由

 

1 、策略路由
1 )策略路由对象:用户数据
2 策略路由优先于正常路由
3 )配置顺序
1 )匹配数据 --->acl
2 设置策略 --->route-map
3 应用策略 数据入口 --->
4 根据源 IP 做策略路由
R2(config)#access-list 1 permit 1.1.0.0 0.0.3.255
 
R2(config)#route-map to-R3 per 10
R2(config-route-map)#match ip add 1
R2(config-route-map)#set ip next-hop 23.1.1.3
 
R2(config)#int s1/0
R2(config-if)#ip policy route-map to-R3
 
R2#debug ip policy
IP: s=1.1.1.1 (Serial1/0), d=3.3.3.3, len 100, FIB policy match
IP: s=1.1.1.1 (Serial1/0), d=3.3.3.3, g=23.1.1.3, len 100, FIB policy routed
5) 本身的数据进行策略路由
R3(config)#access-list 1 per 3.3.3.0 0.0.0.255
 
R3(config)#route-map to-R1 per 10
R3(config-route-map)#match ip add 1 
R3(config-route-map)#set ip next-hop 23.1.1.2
 
R3(config)#int lo 0
R3(config-if)#ip policy route-map to-R1
 
R3(config)#ip local policy route-map to-R1 
6) 匹配报文大小进行策略路由
access-list 2 permit 1.1.4.0 0.0.0.255
route-map to-R3 permit 20
 match ip address 2
 match length 0 200  二个 match 是与的关系
 set ip next-hop 23.1.1.3
如果不匹配的数据就正常路由
7) 匹配应用
R2(config)#access-list 100 per tcp 1.1.5.0 0.0.0.255 host 3.3.3.3 eq 80
 
R2(config)#route-map to-R3 per 30
R2(config-route-map)#match ip add 100
R2(config-route-map)#set ip next-hop 23.1.1.3
 
R3(config)#ip http server
R1#telnet 3.3.3.3 80 /source-interface loopback 1
8 、思考
R2(config-route-map)#set default interface
R2(config-route-map)#set ip default next-hop
R2(config-route-map)#set ip next-hop
SLA
 
 
 

本文出自 “npp爱网络” 博客,转载请与作者联系!

你可能感兴趣的:(用户,职场,路由,休闲,policy)