簡介
本檔案介紹使用時,如何操縱不同的屬性 aggregate-address
命令以及如何影響傳播。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本文件所述內容不限於特定軟體和硬體版本。但是本檔案中的組態已使用Cisco IOS®軟體版本12.2(28)進行測試。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
背景資訊
邊界閘道通訊協定(BGP)允許使用 aggregate-address address mask [as-set] [summary-only] [suppress-map map-name ] [advertise-map map-name ] [attribute-map map-name ]
指令。當您發出 aggregate-address
命令時,不會繼承單個路由屬性(如AS_PATH或community),這會導致粒度損失。本檔案將說明如何在使用 aggregate-address
命令以及如何影響傳播。
網路圖表
網路圖表
不包含 as-set
引數
使用 as-set
引數建立具有自治系統(AS)的數學集的聚合地址。此 as-set
引數彙總了所有單個路由的AS_PATH屬性。通過這些示例配置,您可以檢查此功能以及該引數如何幫助BGP檢測和避免環路。
路由器A |
Current configuration:
hostname RouterA
!
interface Serial1
ip address 10.2.2.2 255.0.0.0
!
interface Loopback0
ip address 10.160.20.11 255.255.0.0
!
router bgp 100
network 10.160.20.0
!--- Router A advertises network 10.160.20.0/16.
neighbor 10.2.2.1 remote-as 300
!
end |
路由器B |
Current configuration:
hostname RouterB
!
interface Serial0
ip address 10.3.3.3 255.0.0.0
!
interface Loopback0
ip address 10.160.10.1 255.255.0.0
!
router bgp 200
network 10.160.10.0
!--- Router B advertises network 10.160.10.0/16.
neighbor 10.3.3.1 remote-as 300
!
end |
路由器C |
Current configuration:
hostname RouterC
!
interface Serial0
ip address 10.2.2.1 255.0.0.0
!
interface Serial1
ip address 10.3.3.1 255.0.0.0
!
interface Serial2
ip address 10.4.4.1 255.0.0.0
!
router bgp 300
neighbor 10.2.2.2 remote-as 100
neighbor 10.3.3.3 remote-as 200
neighbor 10.4.4.4 remote-as 400
aggregate-address 10.160.0.0 255.0.0.0 summary-only
!--- The network is summarized, and Router C only !--- advertises 10.160.0.0/8.
!
end |
路由器D |
Current configuration:
hostname RouterD
!
interface Serial0
ip address 10.4.4.4 255.0.0.0
!
router bgp 400
neighbor 10.4.4.1 remote-as 300
!
end |
路由器C(AS-300)匯聚分別來自AS-100和AS-200的路由10.160.20.0/16和10.160.10.0/16。之所以發生此操作,是因為您已配置 summary-only
路由器C上的引數。路由器C僅向路由器D通告聚合10.160.0.0/8。聚合10.160.0.0/8是無類域間路由(CIDR)路由。更特定的10.160.10.0/16和10.160.20.0/16路由被抑制,如路由器C上的此BGP表所示:
RouterC# show ip bgp
BGP table version is 6, local router ID is 10.4.4.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.160.0.0/8 0.0.0.0 32768 i
s> 10.160.10.0 10.3.3.3 0 0 200 i
s> 10.160.20.0 10.2.2.2 0 0 100 i
以下是路由器D的BGP表。觀察匯聚路由的路徑資訊:
RouterD# show ip bgp
BGP table version is 6, local router ID is 10.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.160.0.0/8 10.4.4.1 0 300 i
聚合路由10.160.0.0/8被認為起源於原始碼IGP的AS-300。該路由丟失了AS-200的單個字首10.160.10.0/16和AS-100的10.160.20.0/16的所有特定AS_PATH資訊。
與 as-set
引數
現在配置 as-set
中的引數 aggregate-address
命令。以下是新組態:
路由器C |
Current configuration:
hostname RouterC
!
interface Serial0
ip address 10.2.2.1 255.0.0.0
!
interface Serial1
ip address 10.3.3.1 255.0.0.0
!
interface Serial2
ip address 10.4.4.1 255.0.0.0
!
router bgp 300
neighbor 10.2.2.2 remote-as 100
neighbor 10.3.3.3 remote-as 200
neighbor 10.4.4.4 remote-as 400
aggregate-address 10.160.0.0 255.0.0.0 summary-only as-set
!--- With the as-set configuration command, the aggregate !--- inherits the attributes of the more-specific routes.
!
end |
NReview此引數對 show ip bgp
router上的輸出:
RouterD# show ip bgp
BGP table version is 2, local router ID is 10.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.160.0.0/8 10.4.4.1 0 300 {200,100} i
使用 as-set
引數,BGP表中聚合路由的路徑資訊更改為包含來自300 {200,100}的集合。此集合表示聚合實際彙總了通過AS-200和AS-100的路由。其 as-set
在避免路由環路方面,資訊非常重要,因為資訊記錄路由的位置。
在任何封閉網路中,此聚合資訊通過BGP傳播並返回到 as-set
清單。此傳播可產生回圈的可能性。BGP的環路檢測行為會記錄其自身的AS編號 as-set
,然後丟棄該聚合。此操作可防止環路。
註: as-set引數包含聚合彙總的每個路由的資訊。單個路由的更改會導致聚合的更新。在本示例中,如果10.160.10.0/16關閉,則聚合的路徑資訊將從300 {200,100}更改為300 {200}。將更新聚合。如果聚合彙總了數十條或數百條路由,並且形成聚合的路由存在問題,則可能會出現持續翻動。
更改聚合路由的屬性
其 與 as-set
引數 一節介紹如何使用 as-set
儲存帶有特定路由的AS_PATH屬性。在某些情況下,可能需要更改聚合路由的屬性。此類屬性的示例包括度量、社群和原點。
影響
本節介紹如何使用 attribute-map
用於操縱的引數 aggregate-address
屬性。在這種情況下,您可使用配置一個或多個特定聚合路由 no-export
community屬性。路由器A設定社群屬性 no-export
到網路10.160.20.0/16並將網路通告給路由器C。本節顯示組態。路由器C繼承community屬性 no-export
而路由器聚合10.160.0.8。因此,沒有向路由器D通告10.160.0.0/8。路由器B、C和D的配置沒有變化。以下是路由器A的新組態:
路由器A |
Current configuration:
hostname RouterA
!
interface Serial1
ip address 10.2.2.2 255.0.0.0
!
router bgp 100
network 10.160.20.0
!--- Router A advertises network 10.160.20.0/16.
neighbor 10.2.2.1 remote-as 300
neighbor 10.2.2.1 send-community
neighbor 10.2.2.1 route-map SET_NO_EXPORT out
!
access-list 1 permit 10.160.20.0 0.0.255.255
route-map SET_NO_EXPORT permit 10
match ip address 1
set community no-export
!--- This sets the community attribute no-export . at Router A for route 10.160.20.0/16 ! end |
以下是10.160.0.0/8路由器C的BGP表:
RouterC# show ip bgp 10.160.0.0
BGP routing table entry for 10.160.0.0/8, version 9
Paths: (1 available, best #1, not advertised to EBGP peer)
Not advertised to any peer
{200,100}, (aggregated by 300 10.4.4.1)
0.0.0.0 from 0.0.0.0 (10.4.4.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-
aggregate, best, ref 2
Community: no-export
社群 no-export
停止路由器C通告到eBGP對等路由器D的聚合路由。路由器D顯示它尚未從路由器C獲知10.160.0.0:
RouterD# show ip bgp 10.160.0.0
% Network not in table
您可以配置 attribute-map
引數來操縱來自的聚合路由的團體屬性 no-export
成長至 none
. 此組態會允許向路由器D通告聚合。
路由器C |
Current configuration:
hostname RouterC
!
interface Serial0
ip address 10.2.2.1 255.0.0.0
!
interface Serial1
ip address 10.3.3.1 255.0.0.0
!
interface Serial2
ip address 10.4.4.1 255.0.0.0
!
router bgp 300
neighbor 10.2.2.2 remote-as 100
neighbor 10.3.3.3 remote-as 200
neighbor 10.4.4.4 remote-as 400
aggregate-address 10.160.0.0 255.0.0.0
as-set summary-only attribute-map Map
!--- Use of the attribute-map argument allows !--- you to change the community of the aggregate.
!
route-map Map permit 10
set community none
!--- This sets the community of the aggregate to none.
end |
現在,檢視路由器C的10.160.0.0/8的BGP表。由於聚合路由沒有團體集,路由器C會向路由器D通告10.160.0.0/8。
RouterC# show ip bgp 10.160.0.0
BGP routing table entry for 10.160.0.0/8, version 6
Paths: (1 available, best #1)
Advertised to non peer-group peers:
10.2.2.2 10.3.3.3 10.4.4.4
{200,100}, (aggregated by 300 10.4.4.1)
0.0.0.0 from 0.0.0.0 (10.4.4.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-
aggregate, best, ref 2
其 show ip bgp 160.0.0.0
路由器D的輸出顯示,路由器D已從路由器C獲知聚合路由10.160.0.0/8。
RouterD# show ip bgp 10.160.0.0
BGP routing table entry for 10.160.0.0/8, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
300 {200,100}, (aggregated by 300 10.4.4.1)
10.4.4.1 from 10.4.4.1 (10.4.4.1)
Origin IGP, localpref 100, valid, external, best
使用 advertise-map
聚合特定路由的子集
如果您可以控制形成聚合路由的單個字首,那麼您可以更容易地決定聚合可以承載哪些屬性。在更改聚合路由的屬性一節的示例中,從聚合路由中排除字首10.160.20.0。在這種情況下,聚合10.160.0.0/8不會繼承社群屬性 no-export
.若要進行此變更,請設定 advertise-map
路由器C的引數。
路由器C |
Current configuration:
hostname RouterC
!
interface Serial0
ip address 10.2.2.1 255.0.0.0
!
interface Serial1
ip address 10.3.3.1 255.0.0.0
!
interface Serial2
ip address 10.4.4.1 255.0.0.0
!
router bgp 300
neighbor 10.2.2.2 remote-as 100
neighbor 10.3.3.3 remote-as 200
neighbor 10.4.4.4 remote-as 400
aggregate-address 10.160.0.0 255.0.0.0
as-set summary-only advertise-map SELECT_SP_ROUTE
!--- You exclude a particular prefix with the !--- use of advertise-map.
!
access-list 1 permit 10.160.10.0 0.0.255.255
!
route-map SELECT_SP_ROUTE permit 10
match ip address 1
!
end |
現在,檢視路由器C的10.160.0.0/8的BGP表:
RouterC# show ip bgp 10.160.0.0
BGP routing table entry for 10.160.0.0/8, version 15
Paths: (1 available, best #1)
Advertised to non peer-group peers:
10.2.2.2 10.4.4.4
200, (aggregated by 300 10.2.2.1)
0.0.0.0 from 0.0.0.0 (10.2.2.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-
aggregate, best, ref 2
只有AS-200是聚合的AS_PATH資訊的一部分;AS-100不是資訊的一部分。此外,該社群沒有繼承 no-export
來自10.160.20.0/16。因此,會向路由器D通告聚合路由。 show ip bgp 160.0.0.0
輸出顯示了公告:
RouterD# show ip bgp 10.160.0.0
BGP routing table entry for 10.160.0.0/8, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
300 200, (aggregated by 300 10.4.4.1)
10.4.4.1 from 10.4.4.1 (10.4.4.1)
Origin IGP, localpref 100, valid, external, atomic-aggregate, best
ip bgp 10.160.0.0
注意:由於聚合as-set僅具有AS-200,因此AS-100中的路由器A接受聚合路由並在路由表中安裝該路由。BGP環路檢測機制導致此路由接受。BGP回圈偵測機制不會在as-set中偵測其自己的AS。
RouterA# show ip bgp
BGP table version is 3, local router ID is 10.160.20.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.160.0.0/8 10.2.2.1 0 300 200 i
*> 10.160.20.0 0.0.0.0 0 32768 i
使用的影響 suppress-map
使用其他配置命令
其 aggregate-address
命令包括其他配置命令,例如 suppress-map
.若要瞭解結合使用所有組態命令的影響,請注意 aggregate-address
僅在您使用 as-set
配置命令。以下屬性的示例: aggregate-address
可以繼承包括 no-export
和 no-advertise
.
-
當您使用 suppress-map
configuration命令以及 summary-only
配置命令, summary-only
configuration命令沒有任何效果。使用 suppress-map
configuration命令, suppress-map
不通告抑制。但是, suppress-map
除了通告聚合路由外,還通告未覆蓋的路由。因此,本節中的說明適用於以下各項的使用 suppress-map
有或沒有 summary-only configuration
指令。
-
使用時 as-set
與 suppress-map
但是,儘管不會通告隱含的路由,但聚合路由會繼承所有隱含路由的屬性。但是可以使用其他配置命令覆蓋繼承的屬性,例如 attribute-map
.更改聚合路由的屬性部分描述了 attribute-map
.
-
當您使用 as-set
和 suppress-map
配置命令 advertise-map
,即聚合表單。聚合僅繼承中選定的路由中的屬性 advertise-map
,無論是 suppress-map
抑制路由。請參見 使用 advertise-map
聚合特定路由的子集 部分。
-
使用時 advertise-map
和 attribute-map
以及 as-set
和其他配置命令, attribute-map
覆蓋在 advertise-map
.
通常,當您使用 advertise-map
,僅 advertise-map
影響集合。如果沒有 advertise-map
,聚合會繼承更具體路由的屬性,包括隱含和未隱含。在這兩種情況下,都可以 attribute-map
配置命令以覆蓋選定的屬性。
相關資訊