简介
本文档介绍最初在Cisco IOS®软件版本12.0(5)S中提供的边界网关协议(BGP)local-AS功能。
先决条件
要求
本文档需要了解BGP路由协议及其操作。有关详细信息,请参阅检查边界网关协议案例研究。
使用的组件
本文档中的信息适用于以下软件和硬件版本:
-
Cisco IOS 软件版本 12.2(28)
-
Cisco 2500 系列路由器
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
规则
有关文件规则的更多信息请参见“ Cisco技术提示规则”。
背景信息
本地 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”。由于“200”由ISP-B预置, local-as 200
命令配置为ISP-C。
通常情况下,组合 ISP-A/B 可对 ISP-B 中的路由器重新编号,使其成为 AS 100 的一部分。如果 ISP-C 无法更改其与 ISP-B 的 eBGP 配置,将会怎样?在使用本地 AS 功能之前,要组合 ISP-A/B,必须保持两个 AS 编号。此 local-as
命令允许ISP-A/B在物理上是一个自治系统,而对ISP-C显示为两个自治系统。
命令语法
此列表显示本文档中的配置使用的命令的语法:
无法为对等体组中的各对等体自定义本地 AS。
本地 AS 无法拥有本地 BGP 协议 AS 编号或远程对等体的 AS 编号。
此 local-as
仅当对等体是真正的eBGP对等体时,命令才有效。对于作为联盟中不同子 AS 的两个对等体,此命令不起作用。
配置
本部分提供了用于配置本文档所述功能的信息。
注:注:要查找有关本文档所用命令的其他信息,请使用命令查找工具。
注意:只有思科注册用户才能访问思科内部工具和信息。
网络图
本文档使用这些网络设置。
图 1

图 2

配置
本文档使用以下配置:
ISP-B(AS 100、本地 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
!
! |
验证
本部分提供的信息可用于确认您的配置是否工作正常。
某些 show
命令由命令输出解释程序工具支持,您可以查看命令输出解释程序 show
命令输出.
注意:只有思科注册用户才能访问思科内部工具和信息。
查看BGP路由表,了解 local-as
命令更改了AS_PATH。您会看到 ISP-B 将 AS 200 附加在发送至 ISP-C 以及从 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 值:
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#
相关信息