簡介
本文描述了兩個分支路由器通過ISP連線並在它們之間運行BGP的情況。
必要條件
需求
思科建議您瞭解以下主題:
- 網際網路服務供應商(ISP)
- 邊界閘道通訊協定(BGP)
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
背景資訊
本文描述兩個分支機構路由器通過Internet伺服器提供商(ISP)連線並在它們之間運行邊界網關協定(BGP)的場景。兩個分支路由器(R1和R2)雖然位於不同的位置,但共用相同的AS編號。一旦路由從分支(本例中為R1)到達服務提供商(SP)網路,就可以用使用者AS標籤。在SP將其傳遞到另一個分支路由器(R2)後,預設情況下,如果另一個分支也使用SP運行BGP並使用相同的AS編號,則路由可能會被丟棄。在此案例中,發出neighbor allowas-in 命令可允許另一端的BGP注入更新。本文提供一個組態範例,協助您瞭解BGP中的Alloa-in功能。
註:此功能只能用於真正的eBGP對等體。不能對屬於不同聯盟子AS的兩個對等體使用此功能。
設定
本節提供用於設定本檔案中所述功能的資訊。
注意:使用命令查詢工具查詢有關本文檔中使用的命令的詳細資訊。
注意:只有註冊的思科使用者才能訪問內部思科工具和資訊。
網路圖表
本檔案會使用以下網路設定:
網路圖表
組態
本檔案會使用以下設定:
Router_A上的組態 |
Router_A#interface Loopback1
ip address 10.1.1.1 255.255.255.255
!
interface Loopback2
ip address 10.2.2.2 255.255.255.255
!
interface Loopback3
ip address 10.3.3.3 255.255.255.255
!
interface GigabitEthernet0/1
no switchport
ip address 192.168.12.2 255.255.255.0
!
router eigrp 100
network 10.1.1.1 0.0.0.0
network 10.2.2.2 0.0.0.0
network 10.3.3.3 0.0.0.0
network 192.168.12.0
auto-summary
! |
路由器R1上的配置 |
R1#interface Loopback22
ip address 10.22.22.22 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.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.168.12.0
no auto-summary
!
router bgp 121
no synchronization
bgp router-id 10.22.22.22
bgp log-neighbor-changes
network 10.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.168.12.2 Fa0/0 14 01:17:12 828 4968 0 7
此示例顯示路由器R1如何通過EIGRP從Router_A獲取路由:
r1#show ip route eigrp 100
D 10.0.0.1/8 [90/156160] via 192.168.12.2, 00:02:24, FastEthernet0/0
D 10.0.0.2/8 [90/156160] via 192.168.12.2, 00:02:24, FastEthernet0/0
D 10.0.0.3/8 [90/156160] via 192.168.12.2, 00:02:24, FastEthernet0/0
此範例顯示路由器R1如何與執行BGP AS500的ISP建立BGP連線:
r1#show ip bgp summary
BGP router identifier 10.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 10.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
*> 10.0.0.1 192.168.12.2 156160 32768 ?
*> 10.0.0.2 192.168.12.2 156160 32768 ?
*> 10.0.0.3 192.168.12.2 156160 32768 ?
*> 10.10.12.0/24 172.16.12.2 0 0 500 i
*> 10.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.168.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 10.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 10.33.33.33
bgp log-neighbor-changes
network 10.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)的所有字首的readvertisement。
R2不會收到來自R1的已重分佈的EIGRP路由(10.0.0.1、10.0.0.2、10.0.0.3)和BGP內部路由10.22.22.22,因為這些路由來自通過Internet的相同ASN。因為R2在AS-PATH中看到自己的AS編號(121),所以R2不會採用這些路由。
r2#show ip bgp
BGP table version is 20, local router ID is 10.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
*> 10.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 allois-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 10.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
*> 10.0.0.1 10.10.12.2 0 500 121 ?
*> 10.0.0.2 10.10.12.2 0 500 121 ?
*> 10.0.0.3 10.10.12.2 0 500 121 ?
r> 10.10.12.0/24 10.10.12.2 0 0 500 i
*> 10.22.22.22/32 10.10.12.2 0 500 121 i
* 10.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.168.12.0 10.10.12.2 0 500 121 ?
現在嘗試從R1 ping R2:
r2#ping 10.22.22.22
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.22.22.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/57/60 ms
驗證
目前沒有適用於此組態的驗證程序。
疑難排解
錯誤消息
其 %BGP% Neighbor A.B.C.D recv bogus route : AS
收到loop錯誤消息。
此通知表示CE路由器收到的BGP路由在AS路徑中具有自己的AS編號,並且被視為CE路由器的路由器環路。解決方法是,使用分配功能配置CE路由器,如前面的示例所示。
相關資訊