Cisco route-map 源地址路由配置的案例
案例:公司内部使用的是一条拨号光纤和一条固定光纤,默认是指向拨号光纤出口那个网关出去,现在2网段有一台OA服务器映射到公网,让外部来访问。
办公区因工作需要,经常拨号换IP地址,是作为普通用户上网用,走拨号光纤出口。由于OA服务器需要一个固定的IP地址,走移动固定光纤的出口;为保证OA系统的运行正常,保证业务连续性,采用route-map做策略路由。
参考:
route-map策略路由设置
router(config)#route-map Engineers [permit|deny] [序号] //定义标记为Engineers的route-map。
router(config-route-map)#match ip address [访问列表号] //设置访问列表定义的匹配条件
router(config-route-map)#set ip next-hop 0.0.0.0 //匹配后设置下一跳地址
router(config-if)#ip policy route-map Engineers //在接口上应用Engineers.
方案如下:
1. 设置route-map
router(config)#route-map test permit 10 //定义标记为test的route-map 名称为:test
router(config-route-map)#match ip address 100 //设置访问列表定义的匹配条件
router(config-route-map)#set ip next-hop 192.168.8.254 //匹配后设置下一跳地址
router(config-route-map)#exit
router(config)#int f0/1.1 //在接口上应用
router(config-if)#ip policy route-map test
router(config-if)# http://www.luyouqiwang.com/14458/ exit
2.将设置了ip policy的vlan中的部分地址加入到access-list(访问列表中)中
router(config)#access-list 100 permit ip host 192.168.2.10 any //access-list 标号 permit 源地址
router(config)#snmp-server community public RO //配置本路由器的只字串为public RO/RW(只读/读写)