5.6. 基于源地址的策略路由
提问 根据源地址的不同选择不同的路径
回答
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#access-list 1 permit 10.15.35.0 0.0.0.255
Router(config)#access-list 2 permit 10.15.36.0 0.0.0.255
Router(config)#interface Ethernet0
Router(config-if)#ip address 10.15.22.7 255.255.255.0
Router(config-if)#ip policy route-map Engineers
Router(config-if)#ip route-cache policy
Router(config-if)#exit
Router(config)#route-map Engineers permit 10
Router(config-route-map)#match ip address 1
Router(config-route-map)#set ip next-hop 10.15.27.1
Router(config-route-map)#exit
Router(config)#route-map Engineers permit 20
Router(config-route-map)#match ip address 2
Router(config-route-map)#set interface Ethernet1
Router(config-route-map)#end
Router#
注释 缺省情况下route map的最后一句都是deny all,这样不符合route map规则的数据包都会按照正常的路由表进行转发。set ip next-hop verify-availability命令提供了对下一跳的验证,不过是基于CDP的,所以如果使用此命令需要打开CDP,最好同时调整时长,毕竟缺省是180秒。在使用策略路由时会在排错时增加难度,因为缺省对于本路由器发出的数据包可以绕过route map这样会造成错觉。
本新闻共3页,当前在第1页 1 2 3
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




