IP : 边界网关协议(BGP)

MP-EBGP配置示例

2016 年 10 月 24 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 8 月 22 日) | 反馈


目录


简介

本文提供信息如何配置在Cisco IOS路由器扩展的边界网关协议(MP-EBGP)多协议。MP-BGP是允许BGP传播多个网络网络层协议IPv6, Vpnv4和其他的路由信息的延长的BGP。MP-BGP允许您有单播路由拓扑与组播路由拓扑不同,帮助控制网络和资源。

先决条件

要求

本文档没有任何特定的要求。

使用的组件

本文档不限于特定的软件和硬件版本。

在本文的配置根据运行Cisco IOSï ¿  ½软件版本12.4 (15)T 13的Cisco 3700系列路由器。

规则

有关文档规则的详细信息,请参阅 Cisco 技术提示规则

配置

在本例中, R1和R3路由器配置是AS 5500形成的iBGP。R2路由器配置是AS 6500。使用MP-EBGP, R1和R2路由器彼此连通。所有路由器配置与环回地址。

注意: 有关本文档所用命令的详细信息,请使用命令查找工具仅限注册用户)。

网络图

本文档使用以下网络设置:

http://www.cisco.com/c/dam/en/us/support/docs/ip/border-gateway-protocol-bgp/113555-mp-ebgp-config-01.gif

配置

本文档使用以下配置:

在路由器R1的配置
R1#show run
Building configuration...
!
version 12.4
!
hostname R1
!
ip cef
!
!
interface Loopback0
 ip address 10.10.10.10 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.100.10 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0
 ip address 172.16.10.1 255.255.255.0
 mpls ip
 clock rate 2000000
!
router bgp 5500
 no synchronization
 bgp router-id 10.10.10.10
 bgp log-neighbor-changes
 network 192.168.100.0
 redistribute connected
 neighbor 172.16.10.2 remote-as 6500
 neighbor 172.16.10.2 soft-reconfiguration inbound
 neighbor 192.168.100.11 remote-as 5500
 no auto-summary
 !
 address-family vpnv4
  neighbor 172.16.10.2 activate
  neighbor 172.16.10.2 send-community both

!--- Sends the community attribute to a BGP neighbor.

 exit-address-family
!
!
end

在路由器R2的配置
R2#show run
Building configuration...
!
version 12.4
!
hostname R2
!
ip cef
!
ip vrf WAN
 rd 2020:1
 route-target export 2020:1
 route-target import 2020:1
!
!
interface Loopback0
 ip vrf forwarding WAN

!--- Associates a VRF instance with an interface or subinterface.

 ip address 20.20.20.20 255.255.255.255
!
interface Serial0/0
 ip vrf forwarding WAN
 ip address 172.16.10.2 255.255.255.0
 mpls ip
 clock rate 2000000
!
router bgp 6500
 no synchronization
 bgp router-id 20.20.20.20
 bgp log-neighbor-changes
 neighbor 172.16.10.1 remote-as 5500
 no auto-summary
 !
 !
 address-family vpnv4
  neighbor 172.16.10.1 activate
  neighbor 172.16.10.1 send-community both
 exit-address-family
 !
 address-family ipv4 vrf WAN
  redistribute connected
  redistribute static
  neighbor 172.16.10.1 remote-as 5500
  neighbor 172.16.10.1 activate
  no synchronization
 exit-address-family
!
!
!
end

在路由器R3的配置
R3#show run
Building configuration...
!
version 12.4
!
hostname R3
!
ip cef
!
!
!
interface Loopback0
 ip address 11.11.11.11 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.100.11 255.255.255.0
 duplex auto
 speed auto
!
router bgp 5500
 no synchronization
 bgp router-id 11.11.11.11
 bgp log-neighbor-changes
 neighbor 192.168.100.10 remote-as 5500
 no auto-summary
!
end

验证

为了显示条目在(BGP)路由表里,请使用show ip bgp命令

show ip bgp
在路由器 R1 中
R1#show ip bgp 172.16.10.2
BGP routing table entry for 172.16.10.2/32, version 14
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    2
  Local
    0.0.0.0 from 0.0.0.0 (10.10.10.10)
      Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best

!--- Displays the routing table entries for the host 172.16.10.2

R1#sh ip bgp 192.168.100.11
BGP routing table entry for 192.168.100.0/24, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    2
  Local
    0.0.0.0 from 0.0.0.0 (10.10.10.10)
      Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best

!--- Displays the entries for the host 192.168.100.11

在路由器 R3 中
R3#sh ip bgp 192.168.100.10
BGP routing table entry for 192.168.100.0/24, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table, RIB-failure(17))
  Not advertised to any peer
  Local
    192.168.100.10 from 192.168.100.10 (10.10.10.10)
      Origin IGP, metric 0, localpref 100, valid, internal, best

!--- Displays the entries for the host 192.168.100.10

在路由器R2中,请使用show ip bgp vpnv4命令显示(从(BGP)表的Vpnv4)地址信息。

show ip bgp vpnv4
在路由器 R2 中
R2#sh ip bgp vpnv4 vrf WAN
BGP table version is 24, local router ID is 20.20.20.20
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
Route Distinguisher: 2020:1 (default for vrf WAN)
*> 10.10.10.0/24    172.16.10.1              0             0 5500 ?
*> 20.20.20.20/32   0.0.0.0                  0         32768 ?
*  172.16.10.0/24   172.16.10.1              0             0 5500 ?
*>                  0.0.0.0                  0         32768 ?
r> 172.16.10.2/32   172.16.10.1              0             0 5500 ?
*> 192.168.100.0    172.16.10.1              0             0 5500 I

!--- Displays prefixes associated with the (VRF) instance WAN. 

R2#show ip bgp vpnv4 vrf WAN 172.16.10.1
BGP routing table entry for 2020:1:172.16.10.0/24, version 7
Paths: (2 available, best #2, table WAN)
  Advertised to update-groups:
        1
  5500
    172.16.10.1 from 172.16.10.1 (10.10.10.10)
      Origin incomplete, metric 0, localpref 100, valid, external
      Extended Community: RT:2020:1
      mpls labels in/out 18/nolabel
  Local
    0.0.0.0 from 0.0.0.0 (20.20.20.20)
      Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best
      Extended Community: RT:2020:1
      mpls labels in/out 18/aggregate(WAN)

!--- Displays prefixes associated with neighbor 172.16.10.1

MP-EBGP设立在R1和R2路由器之间。请使用ping命令验证可接通性从R1到R2反之亦然。

ping
在路由器 R1 中
R1#ping 172.16.10.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/64/208 ms

R1#ping 192.168.100.11

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.11, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/41/96 ms

!--- Router R1 can successfully ping the routers R2 and R3.

在路由器 R2 中
R2#ping vrf WAN 172.16.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/32/96 ms

R2#ping vrf WAN 192.168.100.11

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.11, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/73/204 ms


!--- Router R2 can successfully reach router R1 and R3.


相关信息


Document ID: 113555