本文档介绍两个分支路由器通过ISP连接并在它们之间运行边界网关协议(BGP)的场景。两台分支路由器(R1和R2)虽然位于不同的位置,但共享相同的AS编号。路由从分支机构(本例中为R1)到达服务提供商(SP)网络后,将标记为客户AS。在默认情况下,SP将其传递到另一分支路由器(R2)后,如果另一分支也使用相同的AS编号运行BGP,则路由将被丢弃。在此场景中,发出neighbor allowas-in命令,以允许另一端的BGP注入更新。本文档提供了帮助您了解BGP中Allowas-in功能的示例配置。
注意:此功能只能用于真eBGP对等体。您无法对作为不同联盟子 AS 成员的两个对等体使用此功能。
本文档没有任何特定的要求。
本文档不限于特定的软件和硬件版本。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
本部分为您提供配置本文档描述的功能的信息。
注意:使用命令查找工具(仅限注册客户)可查找有关本文档中使用的命令的详细信息。
本文档使用以下网络设置:
本文档使用以下配置:
Router_A上的配置 |
---|
Router_A#interface Loopback1 ip address 1.1.1.1 255.255.255.255 ! interface Loopback2 ip address 2.2.2.2 255.255.255.255 ! interface Loopback3 ip address 3.3.3.3 255.255.255.255 ! interface GigabitEthernet0/1 no switchport ip address 192.1.12.2 255.255.255.0 ! router eigrp 100 network 1.1.1.1 0.0.0.0 network 2.2.2.2 0.0.0.0 network 3.3.3.3 0.0.0.0 network 192.1.12.0 auto-summary ! |
路由器R1上的配置 |
---|
R1#interface Loopback22 ip address 22.22.22.22 255.255.255.255 ! interface FastEthernet0/0 ip address 192.1.12.1 255.255.255.0 duplex auto speed auto ! interface Serial1/0 ip address 172.16.12.1 255.255.255.0 ! ! router eigrp 100 network 192.1.12.0 no auto-summary ! router bgp 121 no synchronization bgp router-id 22.22.22.22 bgp log-neighbor-changes network 22.22.22.22 mask 255.255.255.255 !--- This is the advertising loopback address. redistribute eigrp 100 !--- This shows the redistributing internal routes in BGP. neighbor 172.16.12.2 remote-as 500 !--- This shows the EBGP connection with ISP. neighbor 172.16.12.2 ebgp-multihop 5 no auto-summary ! |
本示例显示EIGRP在Router_A和R1之间运行:
r1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.1.12.2 Fa0/0 14 01:17:12 828 4968 0 7
本示例显示路由器R1如何通过EIGRP从Router_A获知路由:
r1#show ip route eigrp 100 D 1.0.0.0/8 [90/156160] via 192.1.12.2, 00:02:24, FastEthernet0/0 D 2.0.0.0/8 [90/156160] via 192.1.12.2, 00:02:24, FastEthernet0/0 D 3.0.0.0/8 [90/156160] via 192.1.12.2, 00:02:24, FastEthernet0/0
本示例显示路由器R1如何与运行BGP AS500的ISP建立BGP连接:
r1#show ip bgp summary BGP router identifier 22.22.22.22, local AS number 121 BGP table version is 19, main routing table version 19 7 network entries using 924 bytes of memory 7 path entries using 364 bytes of memory 5/4 BGP path/bestpath attribute entries using 840 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 Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory BGP using 2184 total bytes of memory BGP activity 40/33 prefixes, 42/35 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 172.16.12.2 4 500 86 76 19 0 0 00:25:13 2
此示例显示R1如何通告BGP获知的路由:
r1#show ip bgp BGP table version is 19, local router ID is 22.22.22.22 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.0.0.0 192.1.12.2 156160 32768 ? *> 2.0.0.0 192.1.12.2 156160 32768 ? *> 3.0.0.0 192.1.12.2 156160 32768 ? *> 10.10.12.0/24 172.16.12.2 0 0 500 i *> 22.22.22.22/32 0.0.0.0 0 32768 i r> 172.16.12.0/24 172.16.12.2 0 0 500 i *> 192.1.12.0 0.0.0.0 0 32768 ?
r1#ping 10.10.12.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.12.2, timeout is 2 seconds: !!!!! !--- This is the connectivity with Router 2 across the Internet cloud.
路由器R2上的配置 |
---|
R2#interface Loopback33 ip address 33.33.33.33 255.255.255.255 ! interface Serial1/0 ip address 10.10.12.1 255.255.255.0 router bgp 121 no synchronization bgp router-id 33.33.33.33 bgp log-neighbor-changes network 33.33.33.33 mask 255.255.255.255 !--- This is the advertising loopback address. neighbor 10.10.12.2 remote-as 500 !--- This is the EBGP connection with ISP. neighbor 10.10.12.2 ebgp-multihop 5 no auto-summary |
路由器R2不从路由器R1获知任何路由。
这是自然行为,因为BGP尝试避免路由环路。例如,默认情况下禁用对包含重复自治系统编号(ASN)的所有前缀的通告。
从R1重分发的EIGRP路由(1.0.0、2.0.0、3.0.0.0)和BGP内部路由22.22.22.22未被R2接收,因为它们来自Internet上的同一ASN。由于R2在AS-PATH中看到自己的AS编号(121),因此R2不采用这些路由。
r2#show ip bgp BGP table version is 20, local router ID is 33.33.33.33 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path r> 10.10.12.0/24 10.10.12.2 0 0 500 i *> 33.33.33.33/32 0.0.0.0 0 32768 i *> 172.16.12.0/24 10.10.12.2 0 0 500 i
要允许通告包含重复ASN的所有前缀,请在路由器R2的路由器配置模式下使用neighbor allowas-in命令。
r2(config-router)#neighbor 10.10.12.2 allowas-in r2#clear ip bgp* r2#show ip bgp BGP table version is 10, local router ID is 33.33.33.33 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.0.0.0 10.10.12.2 0 500 121 ? *> 2.0.0.0 10.10.12.2 0 500 121 ? *> 3.0.0.0 10.10.12.2 0 500 121 ? r> 10.10.12.0/24 10.10.12.2 0 0 500 i *> 22.22.22.22/32 10.10.12.2 0 500 121 i * 33.33.33.33/32 10.10.12.2 0 500 121 i *> 0.0.0.0 0 32768 i *> 172.16.12.0/24 10.10.12.2 0 0 500 i *> 192.1.12.0 10.10.12.2 0 500 121 ?
现在尝试从R1 ping R2:
r2#ping 22.22.22.22 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 22.22.22.22, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/57/60 ms
当前没有可用于此配置的验证过程。
“Message:%BGP%邻居A.B.C.D recv伪造路由:收到AS循环错误消息。
此通知意味着CE路由器收到的BGP路由在AS路径中有其自己的AS编号,并且被视为CE路由器的路由器环路。解决方法是,如上例所示,使用允许输入功能配置CE路由器。
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
16-Feb-2015 |
初始版本 |