CCIE之路——路由过滤命令详解
来源:优易学  2011-12-1 21:34:12   【优易学:中国教育考试门户网】   资料下载   IT书店

 

  两种方案效果相同。与接口联用的方案在抑制route feedback上效果比较好;与路由进程联用的方案在抑制route feedback时,由于在过滤时,相应的路由条目已经进行了路由表,所以失效。

  <1> 与接口联用

router ospf 25
   redistribute rip metric 100
   network 172.16.1.254 0.0.0.0 area 25
   network 172.16.8.254 0.0.0.0 area 25
   network 172.16.50.254 0.0.0.0 area 25
   distribute-list 3 in Ethernet0/0
   distribute-list 3 in Ethernet0/1
   distribute-list 3 in Ethernet0/2
!
router rip
   redistribute ospf 25 metric 5
   passive-interface Ethernet0/0
   passive-interface Ethernet0/1
   passive-interface Ethernet0/2
   network 192.16.0.0
   distribute-list 1 in Ethernet0/3
   distribute-list 1 in Ethernet2/0
   distribute-ilst 1 in Ethernet2.1
!
ip classless
access-list 1 permit 172.16.128.0 0.0.127.255
access-iist 3 permit 172.16.0.0 0.0.127.255

  <2> 与路由进程联用:

router ospf 25
   redistribute rip metric 100
   network 172.16.1.254 0.0.0.0 area 25
   network 172.16.8.254 0.0.0.0 area 25
   network 172.16.50.254 0.0.0.0 area 25
   distribute-list 10 out rip
!
router rip
   redistribute ospf 25 metric 5
   passive-interface Ethernet0/3
   passive-interface Ethernet2/0
   passive-interface Ethernet2/1
   network 172.16.0.0
   distribute-list 20 out ospf 25
!
ip classless
access-list 10 permit 172.16.130.0
access-list 10 permit 172.16.145.0
access-list 10 permit 172.16.240.0
access-list 20 permit 172.16.23.0
access-list 20 permit 172.16.9.0
access-list 20 permit 172.16.75.0

  (三) Prefix-list

  功能:

  过滤特定路由协议分发的Routes,主要用与BGP.

  特性:

  与ACL相比,具有相对较强的灵活性。在掩码匹配上,也比较容易理解。

  Case Study: Standard Syntax

  ip prefix-list {list-name | list-number} [seq number] {deny network/length | permit network/length} [ge ge-length] [le le-length]

  no ip prefix-list {list-name | list-number} [seq number] {deny network/length | permit network/length} [ge ge-length] [le le-length]

  注:

  <1> ip prefix-list使用最长匹配规则。

  <2> 如果不指定seq number,则默认为5,且每增加一个条目自动增加5.

  即如果你指定第一条目seq number为2,则下一个不指定seq number的条目的seq number自动变为7.

  <3>自动增加seq number功能可以用命令:no ip prefix-list sequence-number取消。

  <4> length < ge-length < le-length <= 32

  <5> ip prefix-list不能与Route Maps的match ip next-hop语句联用;只以与match ip address语句联用。

  Case Study: ip prefix-list description

  Syntax:

ip prefix-list list-name description text
Case Study: Configuration Example
router bgp 3
   no synchronization
   neighbor 172.16.1.2 remote-as 3
   neighbor 172.16.20.1 remote-as 1
   neighbor 172.16.29.1 prefix-list 1 out
   no auto-summary
!
ip prefix-list 1 seq 5 deny 192.68.10.0/24
ip prefix-list 1 seq 10 permit 0.0.0.0/32

 (四) ip as-path access-list

  功能:

  根据BGP的AS-PATH属性过滤BGP的分发路由条目。

  Case Study: Syntax

  ip as-path access-list acl-number permit | deny regexp

  no ip as-path access-list acl-number

  注:acl-number有效值为0 ~ 500.

  Case Study: Configuration Guide

  <1> 过滤所有的私有AS的Routes更新

  ip as-path access-list 1 deny (_64[6-9][0-9][0-9]_|_65[0-9][0-9][0-9]_)

  ip as-path access-list 1 permit .*

  <2> 应用实例

router bgp 3
   no synchronization
   neighbor 172.16.1.2 remote-as 3
   neighbor 172.16.20.1 remote-as 1
   neighbro 172.16.20.1 filter-list 1 out
   no auto-summary
!
ip as-path access-lsit 1 permit ^$

  (五) 以上过滤命令的执行顺序:

  <1> inbound

  route-map->filter-list->prefix-list,distribute-list

  <2> outbound

  prefix-list,distribute-list->filter-list-> route-map

  prefix-list,distribute-list用于邻居在一个方向上每次只能用其中的一个

  ————————————————————————————————————————

  总结:

  其实这些过滤命令都不是太难,关键是一个过滤的理念。

  它们都是很灵活的东西,运用的好,它会有很大的作用;运用得不好,也有可能会有反作用的。

  所以说,在配置这些过滤命令的时候,要仔细的斟酌。每一个过滤都要思考一下,当安放到现有的网络会有什么样的效用,这样才不至于等到安放到路由器上以后才认识到过滤的漏洞,才不至于引发安全隐患。

上一页  [1] [2] [3] 

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训