簡介
本檔案介紹邊界閘道通訊協定(BGP)local-AS功能,該功能最初在Cisco IOS®軟體版本12.0(5)S中提供。
必要條件
需求
本檔案需要瞭解BGP路由通訊協定及其運作。有關詳細資訊,請參閱Examine Border Gateway Protocol案例研究。
採用元件
本檔案中的資訊適用於以下軟體和硬體版本:
-
Cisco IOS 軟體版本 12.2(28)
-
Cisco 2500系列路由器
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
背景資訊
本地AS功能允許路由器看起來是第二個自治系統(AS)的成員以及它的實際AS。此功能只能用於真正的eBGP對等體。不能對屬於不同聯盟子AS的兩個對等體使用此功能。
如果ISP-A購買ISP-B,但ISP-B客戶不想修改任何對等安排或配置,則本地AS功能非常有用。本地AS功能允許ISP-B中的路由器成為ISP-A AS的成員。同時,這些路由器對客戶來說似乎是為了保留其ISP-B AS編號。
在圖1中,ISP-A尚未購買ISP-B。在圖2中,ISP-A已購買ISP-B,而ISP-B使用本地AS功能。
在圖2中,ISP-B屬於AS 100,ISP-C屬於AS 300。與ISP-C對等時,ISP-B使用命令將AS 200用作其AS編 neighbor ISP-C local-as 200 號。在從ISP-B傳送到ISP-C的更新中,AS_PATH屬性中的AS_SEQUENCE包含「200 100」。由於為ISP-C配置了命令,ISP-B local-as 200 在「200」之前新增了ISP-B。
通常,組合的ISP-A/B會將ISP-B中的路由器重新編號為AS 100的一部分。如果ISP-C無法使用ISP-B更改其eBGP配置,該怎麼辦?在本地AS功能之前,組合ISP-A/B必須維護兩個AS編號。該 local-as命令允許ISP-A/B在物理上為AS,而對於ISP-C則顯示為兩個AS。
指令語法
此清單顯示本檔案中的組態所使用命令的語法:
-
neighbor x.x.x.x local-as local-AS-number
-
neighbor peer-group local-as local-AS-number
無法為對等組中的各個對等點自定義Local-AS。
Local-AS不能具有本地BGP協定AS編號或遠端對等體的AS編號。
只有 local-as對等體是真正的eBGP對等體時,命令才有效。它不適用於聯盟中不同子AS中的兩個對等體。
設定
本節提供用於設定本檔案中所述功能的資訊。
註:註:要查詢有關本文檔所用命令的其他資訊,請使用命令查詢工具。
附註:只有完成註冊的思科使用者能存取思科內部工具與資訊。
網路圖
本檔案會使用這些網路設定。
圖1
圖2
組態
本檔案會使用以下設定:
ISP-B(AS 100,local-as 200) |
hostname ISP-B
!
interface serial 0
ip address 192.168.1.1 255.255.255.252
!
interface ethernet 0
ip address 192.168.4.1 255.255.255.0
!
router bgp 100
!--- Note the AS number 100. This is the AS number of ISP-A, which is now !--- used by all routers in ISP-B after its acquisition by ISP-A.
neighbor 192.168.1.2 remote-as 300
!--- Defines the e-BGP connection to ISP-C.
neighbor 192.168.1.2 local-as 200
!--- This command makes the remote router in ISP-C to see this !--- router as belonging to AS 200 instead of AS 100. !--- This also make this router to prepend AS 200 in !--- all updates to ISP-C.
network 192.168.4.0
!
! |
ISP-C(AS 300) |
hostname ISP-C
!
interface serial 1
ip address 192.168.1.2 255.255.255.252
!
interface ethernet 0
ip address 192.168.9.1 255.255.255.0
!
router bgp 300
neighbor 192.168.1.1 remote-as 200
!--- Defines the e-BGP connection to ISP-B.
!--- Note AS is 200 and not AS 100.
network 192.168.9.0
!
! |
驗證
本節提供的資訊可用於確認您的組態是否正常運作。
Output Interpreter show 工具支援某些命令,允許您檢視命令輸出的 show 分析。
附註:只有完成註冊的思科使用者能存取思科內部工具與資訊。
檢視BGP路由表,檢視命令 local-as 如何更改AS_PATH。您觀察到ISP-B將AS 200預置為ISP-C傳送和接收的更新。此外,請注意ISP-B位於AS編號100中。
ISP-B#
show ip bgp summary
BGP router identifier 192.168.4.1, local AS number 100
BGP table version is 3, main routing table version 3
2 network entries and 2 paths using 266 bytes of memory
2 BGP path attribute entries using 104 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 2/6 prefixes, 2/0 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.1.2 4 300 29 29 3 0 0 00:25:19 1
在此輸出中,請注意ISP-C將ISP-B視為AS 200的一部分。
ISP-C# show ip bgp summary
BGP table version is 3, main routing table version 3
2 network entries (2/6 paths) using 480 bytes of memory
2 BGP path attribute entries using 192 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.1.1 4 200 34 34 3 0 0 00:30:19 1
請注意,在此輸出中,ISP-B將「200」置於從ISP-C獲知的路由之前。
ISP-B#
show ip bgp
BGP table version is 3, local router ID is 192.168.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
*> 192.168.4.0 0.0.0.0 0 32768 i
*> 192.168.9.0 192.168.1.2 0 0 200 300 i
請注意,ISP-C看到來自ISP-B的路由,其AS_PATH為「200 100」。
ISP-C# show ip bgp
BGP table version is 3, local router ID is 192.168.1.2
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
*> 192.168.4.0 192.168.1.1 0 0 200 100 i
*> 192.168.9.0 0.0.0.0 0 32768 i
以下命令在其輸出中顯示配置的local-as值:
-
show ip bgp neighbor x.x.x.x
-
show ip bgp peer-group peer group name
ISP-B# show ip bgp neighbors 192.168.1.2
BGP neighbor is 192.168.1.2, remote AS 300, local AS 200, external link
BGP version 4, remote router ID 192.168.9.1
BGP state = Established, up for 00:22:42
Last read 00:00:42, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 2 1
Keepalives: 25 25
Route Refresh: 0 1
Total: 28 28
Default minimum time between advertisement runs is 30 seconds
! Output Suppressed
疑難排解
debug ip bgp updates命令顯示從鄰居接收到的字首及其屬性。此輸出顯示,字首192.168.4.0/24與AS PATH 200、100一起接收。
ISP-C#
*May 10 12:45:14.947: BGP(0): 192.168.1.1 computing updates, afi 0, neighbor ver
sion 0, table version 5, starting at 0.0.0.0
*May 10 12:45:14.947: BGP(0): 192.168.1.1 send UPDATE (format) 192.168.9.0/24, n
ext 192.168.1.2, metric 0, path
*May 10 12:45:14.947: BGP(0): 192.168.1.1 1 updates enqueued (average=52, maximu
m=52)
*May 10 12:45:14.947: BGP(0): 192.168.1.1 update run completed, afi 0, ran for 0
ms, neighbor version 0, start version 5, throttled to 5
*May 10 12:45:14.947: BGP: 192.168.1.1 initial update completed
*May 10 12:45:15.259: BGP(0): 192.168.1.1 rcvd UPDATE w/ attr: nexthop 192.168.1
.1, origin i, metric 0, path 200 100
ISP-C#
*May 10 12:45:15.259: BGP(0): 192.168.1.1 rcvd 192.168.4.0/24
*May 10 12:45:15.279: BGP(0): Revise route installing 192.168.4.0/24 -> 192.168.
1.1 to main IP table
ISP-C#
相關資訊