0
点赞
收藏
分享

微信扫一扫

Cisco PBR 中的 next-hop 多种设置实验

1:起因

在配置PBR中设置next-hop的时候对后面的一些参数不明白,研究清楚,刚好在网上找到这个帖子:

​​http://www.doczj.com/doc/f99682692.html​​ 万分感谢!!!!

命令总结:

1: set ip next-hop {ip-address| recursive ip-address} , 如果一个route-map 中的同一个序列中

同时使用了 ip next-hop 跟ip next-hop recursive 时, 则ip next-hop 有效,同时一个route-map序列只允许配置一个 ip next-hop recursive

2: set ip next-hop verify-availability {next-hop-address sequence track object}

如果单存使用set ip next-hop verify-availability 这个命令不跟track的话,需要两端设备开启cdp 协议


2:实验拓扑:


Cisco PBR 中的 next-hop 多种设置实验_连通性


实验要求,R3去往R1 优先走ISP2, 当ISP2跟R2之间有网路故障时,切到ISP1,同时R2上不配置任何默认路由及去往111.111.111.111的路由

3:ISP1,ISP2,R1,R3配置无特殊不罗列出来

4:PBR命令配置 先在PBR中设置set ip next-hope ip1, ip2 ,不开启next-hop verify-availability检测

4.1: R2 PBR配置

ip access-list extended R1

permit ip any host 111.111.111.111  


route-map PBR permit 10

match ip address R1

set ip next-hop 12.1.1.1 11.1.1.1


interface Ethernet0/2

ip address 13.1.1.1 255.255.255.0

ip policy route-map PBR


4.2:测试R3-R1连通性及路径情况 
4.2.1:ISP2-R2,ISP1-R2都正常的情况,测试正常


Cisco PBR 中的 next-hop 多种设置实验_html_02

4.2.2:ISP2-R2线路故障,R2的e0/1口up, ISP2 E0/1接口down掉情况, ISP1-R2正常 ,测试不通

Cisco PBR 中的 next-hop 多种设置实验_连通性_03

4.2.3:ISP2-R2线路故障,R2的e0/1口down, ISP2 E0/1接口up掉情况, ISP1-R2正常,测试可以切换到ISP1


Cisco PBR 中的 next-hop 多种设置实验_html_04

5:PBR命令配置 先在PBR中设置set ip next-hope ip1, ip2 ,并开启next-hop verify-availability检测 (两边设备需要开启cdp)

5.1:R2配置

ip access-list extended R1

permit ip any host 111.111.111.111  


route-map PBR permit 10

match ip address R1

set ip next-hop 12.1.1.1 11.1.1.1

set ip next-hop verify-availability


interface Ethernet0/2

ip address 13.1.1.1 255.255.255.0

ip policy route-map PBR


5.2:测试R3-R1连通性及路径情况 
5.2.1:ISP2-R2线路故障,R2的e0/1口up, ISP2 E0/1接口down掉情况, ISP1-R2正常 ,测试可以切换


Cisco PBR 中的 next-hop 多种设置实验_序列号_05

5.2.2:ISP2-R2线路故障,R2的e0/1口down, ISP2 E0/1接口up掉情况, ISP1-R2正常 ,测试可以切换


Cisco PBR 中的 next-hop 多种设置实验_序列号_06


6:PBR命令配置 先在PBR中设置set ip next-hop verify-availability next-hop-address sequence track object  

6.1:R2配置

ip sla 12

icmp-echo 12.1.1.1 source-ip 12.1.1.2

threshold 3000

timeout 3000

frequency 3


ip sla schedule 12 life forever start-time now


track 12 ip sla 12 reachability

delay down 25 up 9


ip access-list extended R1

permit ip any host 111.111.111.111  


route-map PBR permit 10

match ip address R1

set ip next-hop verify-availability 12.1.1.1 30 track 12   //这里面的30代表当track12down掉后,自动将下一跳12.1.1.1 调整到序列为30的,从而让11.1.1.1更优

set ip next-hop 11.1.1.1 //多个下一跳必须写在route-map同一个序列号中



Cisco PBR 中的 next-hop 多种设置实验_连通性_07



interface Ethernet0/2

ip address 13.1.1.1 255.255.255.0

ip policy route-map PBR


该环境中ISP2设备也要开启SLA探测,实际可不用


6.2:测试R3-R1连通性及路径情况 
6.2.1:ISP2-R2线路故障,不管是R2,还是ISP2那边的接口down掉, ISP1-R2正常 ,测试可以切换


Cisco PBR 中的 next-hop 多种设置实验_序列号_08


Cisco PBR 中的 next-hop 多种设置实验_html_09

6.2.2: ISP2-R2线路恢复,切回


Cisco PBR 中的 next-hop 多种设置实验_连通性_10


Cisco PBR 中的 next-hop 多种设置实验_序列号_11


7:总结

1:PBR命令配置 先在PBR中设置set ip next-hope ip1, ip2 ,不开启next-hop verify-availability检测的时候,如果是远端路由器接口down掉,本地路由器依旧是up

的话,是不会切换到下个ip2,只有当本地路由器接口down掉的时候才会切到下个ip2


2:PBR命令配置 先在PBR中设置set ip next-hope ip1, ip2 ,并开启next-hop verify-availability检测 (两边设备需要开启cdp协议)


3:PBR命令配置 先在PBR中设置set ip next-hop verify-availability next-hop-address sequence track object  时候,备用的下一跳地址必须放在route-map同一个序列号中



举报

相关推荐

0 条评论