手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网络知识>Cisco技术>列表

Cisco IOS Cookbook 中文精简版第五章IP路由

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

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页,当前在第11 2 3

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!