新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 网络应用 > 路由技术 > 正文:思科路由过滤命令详细解说

思科路由过滤命令详细解说

新客网 XKER.COM 2007-09-26 来源: 收藏本文

  (一) Route Maps

  特性:

  Route Maps类似于access lists,不同之处在于Route Maps可以改变Packets/Routes的部分属性。

  用途:

  Route Maps主要用于Redistribution和Policy Routing及BGP的实现。

  实现:

  Policy Routing发送Packets到Route Maps实现策略路由转发。

  Redistribution发送Routes到Route Maps实现路由条目的过滤。

  配置说明:

  Route Maps如果没有指定Action及Sequence Number属性,默认:

  Action:   permit

  Sequence Number:   10

  且Sequence Number不会自动增加。

  即如果在使用Route Maps语句时不指定Sequence Number,则覆盖Sequence Number为10的默认条目。

  Route Maps Deny Action:

  Redistribution: 特定路由条目不会被重分布。

  Policy Routing: 特定的Packets不会按策略路由转发,但会梗概正常的路由表条目转发。

  Case Study:Policy Routing

  注:(1)Policy Routing只影响入流量。

  (2)可以使用Standard及Extended ACL.

  (3)全局配置ip local policy route-map sense可将策略路由应用于Router本身发送的Packets.

  <1> Standard ACL

interface Serial 0
   ip address 172.16.5.1 255.255.255.0
   ip policy route-map sense
!
access-list 1 permit 172.16.6.0 0.0.0.255
access-list 2 permit 172.16.7.0 0.0.0.255
!
route-map sense permit 10
   match ip address 1
   set ip next-hop 172.16.4.2
!
route-map sense permit 20
   match ip address 2
   set ip next-hop 172.16.4.3

  <2> Extended ACL

interface Ethernet 0
   ip address 172.16.1.4 255.255.255.0
   ip policy route-map sense
!
access-list 105 permit tcp 172.16.1.0 0.0.0.255 eq ftp any
access-list 105 permit tcp 172.16.1.0 0.0.0.255 eq ftp-data any
access-list 106 permit tcp 172.16.1.0 0.0.0.255 eq telnet any
!
route-map sense permit 10
   match ip address 105
   set ip next-hop 172.16.2.1
!
route-map sense permit 20
   match ip address 106
   set ip next-hop 172.16.3.1

  <3> Length of the Packets

interface Ethernet0
   ip address 172.16.1.4 255.255.255.0
   ip policy route-map sense
!
route-map sense permit 10
   match length 1000 1600
   set ip next-hop 172.16.2.1
!
route-map sense permit 20
   match length 0 400
   set ip next-hop 172.16.3.1

  <4> Router's Packets

interface Ethernet0
   ip address 172.16.1.4 255.255.255.0
   ip policy route-map sense
!
ip local policy route-map sense
!
access-list 120 permit ip any 172.16.1.0 0.0.0.255
access-list 120 permit ospf any any
!
route-map sense permit 10
   match ip address 120
!
route-map sense permit 20
   match length 1000 1600
   set ip next-hop 172.16.2.1
!
route-map sense permit 30
   match length 0 400
   set ip next-hop 172.16.3.1

  注:如果没有第一个route-map条目,router本身的Packets及OSPF的Packets都会由于后两个route-map语句被转发到错误的地址。

收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐