• <sub id="h4knl"><ol id="h4knl"></ol></sub>
    <sup id="h4knl"></sup>
      <sub id="h4knl"></sub>

      <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
      1. <strong id="h4knl"></strong>

      2. Cisco路由的過濾命令

        時間:2024-06-04 05:35:00 思科認(rèn)證 我要投稿
        • 相關(guān)推薦

        Cisco路由的過濾命令

          cisco路由器過濾命令是什么?怎樣配置呢?下面跟yjbys小編一起來學(xué)習(xí)一下吧!

          (一) Route Maps

          特性:

          Route Maps類似于Access lists,不同之處在于Route Maps可以改變Packets/Routes的部分屬性。

          用途:

          Route Maps主要用于Redistribution和Policy Routing及BGP的實現(xiàn)。

          實現(xiàn):

          Policy Routing發(fā)送Packets到Route Maps實現(xiàn)策略路由轉(zhuǎn)發(fā)。

          Redistribution發(fā)送Routes到Route Maps實現(xiàn)路由條目的過濾。

          配置說明:

          Route Maps假如沒有指定Action及Sequence Number屬性,默認(rèn):

          Action: permit

          Sequence Number: 10

          且Sequence Number不會自動增加。

          即假如在使用Route Maps語句時不指定Sequence Number,則覆蓋Sequence Number為10的默認(rèn)條目。

          Route Maps Deny Action:

          Redistribution: 特定路由條目不會被重分布。

          Policy Routing: 特定的Packets不會按策略路由轉(zhuǎn)發(fā),但會梗概正常的路由表條目轉(zhuǎn)發(fā)。

          Case Study:Policy Routing

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

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

          (3)全局配置ip local policy route-map sense可將策略路由應(yīng)用于Router本身發(fā)送的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語句被轉(zhuǎn)發(fā)到錯誤的地址。

          Case Study: Policy Routing and Quality of Service Routing

          Policy Routing結(jié)合ip包頭的Precedence和Type of Service(TOS)可以實現(xiàn)基于QOS的策略路由。

          注:Precedence和TOS的配置既可使用Number字段,也可以使用KeyWord.

          set ip precedence

          -------------------------------------

          Bits Number Keyword

          000 0 routine

          001 1 priority

          010 2 immediate

          011 3 flash

          100 4 flash-override

          101 5 critical

          110 6 internet

          111 7 network

          -------------------------------------

          set ip tos

          -------------------------------------

          Bits Number Keyword

          0000 0 normal

          0001 1 min-monetary-cost

          0010 2 max-reliability

          0100 4 max-throughput

          1000 8 min-delay

          -------------------------------------

          interface Serial0

          ip address 10.1.18.67 255.255.255.252

          ip policy route-map sense

          !

          interface Serial1

          ip address 10.34.16.83.255.255.255.252

          ip policy route-map sense

          !

          access-list 1 permit 172.16.0.0 0.0.255.255

          access-list 110 permit tcp any eq www any

          !

          route-map sense permit 10

          match ip address 1 110

          set ip precedence critical

          !

          route-map sense permit 20

          set ip tos 10

          set ip precedence priority

          Case Study: Route Tagging

          用途:

          用于雙向重分布時標(biāo)識特定Domain的路由,以防路由被重分布回起源Domain.

          使用方案:

          通告路由條目的邊緣Router在重分布時給路由條目加上Tag標(biāo)識,做為Transit Network的Domain,不需要使用和識別Tag,僅僅需要將它傳遞到它的外部網(wǎng)絡(luò)即可。

          路由協(xié)議相關(guān):

          Support: RIPv2,EIGRP,IS-IS,OSPF,BGP

          Not Support: RIPV1,IGRP

          Packets Format:

          RIPv2: 支持16-bit tags 表示為十進(jìn)制:0 ~ 65535

          EIGRP external route TLVs: 支持32-bit tags 表示為十進(jìn)制:0 ~ 4294967295

          OSPF type 5 LSAs: 支持32-bit tags 表示為十進(jìn)制:0 ~ 4294967295

          配置實例:

          router ospf 1

          redistribute igrp 1 metric 10 subnets tag 1

          redistribute rip metric 10 subnets route-map sense

          network 10.100.200.1 0.0.0.0 area 0

          !

          router rip

          network 10.0.0.0

          !

          router igrp 1

          network 10.0.0.0

          !

          access-list 1 permit 10.1.2.3

          access-list 2 permit 10.1.2.4

          !

          route-map sense permit 10

          match ip route-source 1

          set tag 2

          !

          route-map sense permit 20

          match ip route-source 2

          set tag 3

          (二) Distribute-list

          作用:

          <1> 控制路由條目的分發(fā),及路由的重分布。

          <2> 建立一個"route firewall"

          關(guān)于路由協(xié)議: www.it165.net

          Distance Vector Routing Protocol: Route Filtering可以控制其通告/接收的路由條目,及重分布的路由條目。

          Link-State Routing Protocol: Route Filtering只可以控制其在重分布時的路由條目。

          注: LS Routing Protocol的一個基本的要求就是在一個area內(nèi)所有Routers的Link State Database必須一致,所以假如Route Filtering能過濾掉LS Routing Protocol的LSA通告,就違反了LS Routing Protocol的規(guī)范。

          Case Study: Filtering Specific Routes

          router rip

          version 2

          network 192.168.75.0

          distribute-list 1 in Serial1

          !

          ip classless

          access 1 permit 0.0.0.0

          Case Study: Route Filtering and Redistribution

          注:

          distribute-list 命令用于Link-State Routing Protocol時:

          與接口聯(lián)用: 只能使用in參數(shù)

          與路由進(jìn)程聯(lián)用: 只能使用out參數(shù)

          兩種方案效果相同。與接口聯(lián)用的方案在抑制route feedback上效果比較好;與路由進(jìn)程聯(lián)用的方案在抑制route feedback時,由于在過濾時,相應(yīng)的路由條目已經(jīng)進(jìn)行了路由表,所以失效。

          <1> 與接口聯(lián)用

          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> 與路由進(jìn)程聯(lián)用:

          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

          功能:

          過濾特定路由協(xié)議分發(fā)的Routes,主要用與BGP.

          特性:

          與ACL相比,具有相對較強(qiáng)的靈活性。在掩碼匹配上,也比較輕易理解。

          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使用最長匹配規(guī)則。

          <2> 假如不指定seq number,則默認(rèn)為5,且每增加一個條目自動增加5.

          即假如你指定第一條目seq number為2,則下一個不指定seq number的條目的seq number自動變?yōu)?.

          <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語句聯(lián)用;只以與match ip address語句聯(lián)用。

          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

          功能:

          根據(jù)BGP的AS-PATH屬性過濾BGP的分發(fā)路由條目。

          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> 應(yīng)用實例

          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 ^$

          (五) 以上過濾命令的執(zhí)行順序:

          <1> inbound

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

          <2> outbound

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

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

          總結(jié):

          其實這些過濾命令都不是太難,要害是一個過濾的理念。

          它們都是很靈活的東西,運(yùn)用的好,它會有很大的作用;運(yùn)用得不好,也有可能會有反作用的。

          所以說,在配置這些過濾命令的時候,要仔細(xì)的斟酌。每一個過濾都要思考一下,當(dāng)安放到現(xiàn)有的網(wǎng)絡(luò)會有什么樣的效用,這樣才不至于等到安放到路由器上以后才熟悉到過濾的漏洞,才不至于引發(fā)安全隱患。

        《&.doc》
        将本文的Word文档下载到电脑,方便收藏和打印
        推荐度:
        点击下载文档

        【Cisco路由的過濾命令】相關(guān)文章:

        Cisco路由器配置命令大全06-12

        Cisco路由器安全配置命令03-04

        CISCO路由器配置命令詳解設(shè)置試題08-28

        Cisco路由器安全配置命令有哪些03-30

        CISCO路由器配置命令廣域網(wǎng)協(xié)議設(shè)置試題03-07

        cisco常用命令大全02-26

        CISCO路由器CHAP認(rèn)證配置06-17

        華為路由器命令匯集03-29

        華為路由器配置命令04-10

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码
      3. <sub id="h4knl"><ol id="h4knl"></ol></sub>
        <sup id="h4knl"></sup>
          <sub id="h4knl"></sub>

          <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
          1. <strong id="h4knl"></strong>

          2. 午夜AV不卡网站在线播放 | 色婷婷六月亚洲婷婷6月 | 亚洲欧美日韩一区精品中文字幕 | 综合视频精品第一区 | 午夜性999性久久久久 | 天天摸在线视频免费看 |

            Cisco路由的過濾命令

              cisco路由器過濾命令是什么?怎樣配置呢?下面跟yjbys小編一起來學(xué)習(xí)一下吧!

              (一) Route Maps

              特性:

              Route Maps類似于Access lists,不同之處在于Route Maps可以改變Packets/Routes的部分屬性。

              用途:

              Route Maps主要用于Redistribution和Policy Routing及BGP的實現(xiàn)。

              實現(xiàn):

              Policy Routing發(fā)送Packets到Route Maps實現(xiàn)策略路由轉(zhuǎn)發(fā)。

              Redistribution發(fā)送Routes到Route Maps實現(xiàn)路由條目的過濾。

              配置說明:

              Route Maps假如沒有指定Action及Sequence Number屬性,默認(rèn):

              Action: permit

              Sequence Number: 10

              且Sequence Number不會自動增加。

              即假如在使用Route Maps語句時不指定Sequence Number,則覆蓋Sequence Number為10的默認(rèn)條目。

              Route Maps Deny Action:

              Redistribution: 特定路由條目不會被重分布。

              Policy Routing: 特定的Packets不會按策略路由轉(zhuǎn)發(fā),但會梗概正常的路由表條目轉(zhuǎn)發(fā)。

              Case Study:Policy Routing

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

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

              (3)全局配置ip local policy route-map sense可將策略路由應(yīng)用于Router本身發(fā)送的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語句被轉(zhuǎn)發(fā)到錯誤的地址。

              Case Study: Policy Routing and Quality of Service Routing

              Policy Routing結(jié)合ip包頭的Precedence和Type of Service(TOS)可以實現(xiàn)基于QOS的策略路由。

              注:Precedence和TOS的配置既可使用Number字段,也可以使用KeyWord.

              set ip precedence

              -------------------------------------

              Bits Number Keyword

              000 0 routine

              001 1 priority

              010 2 immediate

              011 3 flash

              100 4 flash-override

              101 5 critical

              110 6 internet

              111 7 network

              -------------------------------------

              set ip tos

              -------------------------------------

              Bits Number Keyword

              0000 0 normal

              0001 1 min-monetary-cost

              0010 2 max-reliability

              0100 4 max-throughput

              1000 8 min-delay

              -------------------------------------

              interface Serial0

              ip address 10.1.18.67 255.255.255.252

              ip policy route-map sense

              !

              interface Serial1

              ip address 10.34.16.83.255.255.255.252

              ip policy route-map sense

              !

              access-list 1 permit 172.16.0.0 0.0.255.255

              access-list 110 permit tcp any eq www any

              !

              route-map sense permit 10

              match ip address 1 110

              set ip precedence critical

              !

              route-map sense permit 20

              set ip tos 10

              set ip precedence priority

              Case Study: Route Tagging

              用途:

              用于雙向重分布時標(biāo)識特定Domain的路由,以防路由被重分布回起源Domain.

              使用方案:

              通告路由條目的邊緣Router在重分布時給路由條目加上Tag標(biāo)識,做為Transit Network的Domain,不需要使用和識別Tag,僅僅需要將它傳遞到它的外部網(wǎng)絡(luò)即可。

              路由協(xié)議相關(guān):

              Support: RIPv2,EIGRP,IS-IS,OSPF,BGP

              Not Support: RIPV1,IGRP

              Packets Format:

              RIPv2: 支持16-bit tags 表示為十進(jìn)制:0 ~ 65535

              EIGRP external route TLVs: 支持32-bit tags 表示為十進(jìn)制:0 ~ 4294967295

              OSPF type 5 LSAs: 支持32-bit tags 表示為十進(jìn)制:0 ~ 4294967295

              配置實例:

              router ospf 1

              redistribute igrp 1 metric 10 subnets tag 1

              redistribute rip metric 10 subnets route-map sense

              network 10.100.200.1 0.0.0.0 area 0

              !

              router rip

              network 10.0.0.0

              !

              router igrp 1

              network 10.0.0.0

              !

              access-list 1 permit 10.1.2.3

              access-list 2 permit 10.1.2.4

              !

              route-map sense permit 10

              match ip route-source 1

              set tag 2

              !

              route-map sense permit 20

              match ip route-source 2

              set tag 3

              (二) Distribute-list

              作用:

              <1> 控制路由條目的分發(fā),及路由的重分布。

              <2> 建立一個"route firewall"

              關(guān)于路由協(xié)議: www.it165.net

              Distance Vector Routing Protocol: Route Filtering可以控制其通告/接收的路由條目,及重分布的路由條目。

              Link-State Routing Protocol: Route Filtering只可以控制其在重分布時的路由條目。

              注: LS Routing Protocol的一個基本的要求就是在一個area內(nèi)所有Routers的Link State Database必須一致,所以假如Route Filtering能過濾掉LS Routing Protocol的LSA通告,就違反了LS Routing Protocol的規(guī)范。

              Case Study: Filtering Specific Routes

              router rip

              version 2

              network 192.168.75.0

              distribute-list 1 in Serial1

              !

              ip classless

              access 1 permit 0.0.0.0

              Case Study: Route Filtering and Redistribution

              注:

              distribute-list 命令用于Link-State Routing Protocol時:

              與接口聯(lián)用: 只能使用in參數(shù)

              與路由進(jìn)程聯(lián)用: 只能使用out參數(shù)

              兩種方案效果相同。與接口聯(lián)用的方案在抑制route feedback上效果比較好;與路由進(jìn)程聯(lián)用的方案在抑制route feedback時,由于在過濾時,相應(yīng)的路由條目已經(jīng)進(jìn)行了路由表,所以失效。

              <1> 與接口聯(lián)用

              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> 與路由進(jìn)程聯(lián)用:

              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

              功能:

              過濾特定路由協(xié)議分發(fā)的Routes,主要用與BGP.

              特性:

              與ACL相比,具有相對較強(qiáng)的靈活性。在掩碼匹配上,也比較輕易理解。

              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使用最長匹配規(guī)則。

              <2> 假如不指定seq number,則默認(rèn)為5,且每增加一個條目自動增加5.

              即假如你指定第一條目seq number為2,則下一個不指定seq number的條目的seq number自動變?yōu)?.

              <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語句聯(lián)用;只以與match ip address語句聯(lián)用。

              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

              功能:

              根據(jù)BGP的AS-PATH屬性過濾BGP的分發(fā)路由條目。

              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> 應(yīng)用實例

              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 ^$

              (五) 以上過濾命令的執(zhí)行順序:

              <1> inbound

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

              <2> outbound

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

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

              總結(jié):

              其實這些過濾命令都不是太難,要害是一個過濾的理念。

              它們都是很靈活的東西,運(yùn)用的好,它會有很大的作用;運(yùn)用得不好,也有可能會有反作用的。

              所以說,在配置這些過濾命令的時候,要仔細(xì)的斟酌。每一個過濾都要思考一下,當(dāng)安放到現(xiàn)有的網(wǎng)絡(luò)會有什么樣的效用,這樣才不至于等到安放到路由器上以后才熟悉到過濾的漏洞,才不至于引發(fā)安全隱患。