实验目标:
1.熟练BGP的基本配置
2.掌握BGP路由反射器的原理
实验TOP:
物理拓扑
逻辑拓扑
基本配置
R1的配置:
!
hostname r1
!
interface Loopback0
ip address 1.1.1.1255.255.255.0
!
interface Ethernet0/0
no shu
!
interface Ethernet0/0.14
encapsulation dot1Q 14
ip address 10.1.1.1255.255.255.0
no shu
!
interface Ethernet0/0.15
encapsulation dot1Q 15
ip address 20.1.1.1255.255.255.0
no shu
!
interface Serial1/0
ip address 12.1.1.1255.255.255.0
no shu
!
interface Serial2/0
ip address 13.1.1.1255.255.255.0
no shu
!
router ospf 10
network 10.1.1.00.0.0.255 area 0
network 12.1.1.00.0.0.255 area 0
network 13.1.1.00.0.0.255 area 0
network 20.1.1.00.0.0.255 area 0
!
router bgp 10
no synchronization
bgp router-id 1.1.1.1
network 1.1.1.0mask 255.255.255.0
neighbor 10.1.1.4remote-as 20
neighbor 12.1.1.2remote-as 10
neighbor 13.1.1.3remote-as 10
neighbor 20.1.1.5remote-as 10
no auto-summary
!
R2的配置:
!
hostname r2
!
interface Loopback0
ip address 2.2.2.2255.255.255.0
!
!
interface Serial2/0
ip address 12.1.1.2255.255.255.0
no shu
!
router ospf 10
network 12.1.1.00.0.0.255 area 0
!
router bgp 10
no synchronization
bgp router-id 2.2.2.2
network 2.2.2.0mask 255.255.255.0
neighbor 12.1.1.1remote-as 10
no auto-summary
!
R3的配置:
!
hostname r3
!
interface Loopback0
ip address 3.3.3.3255.255.255.0
!
interface Serial1/0
ip address 13.1.1.3255.255.255.0
no shu
!
!
router ospf 10
network 13.1.1.00.0.0.255 area 0
!
router bgp 10
no synchronization
bgp router-id 3.3.3.3
network 3.3.3.0mask 255.255.255.0
neighbor 13.1.1.1remote-as 10
no auto-summary
!
R4配置:
!
hostname r4
!
interface Loopback0
ip address 4.4.4.4255.255.255.0
!
interface Ethernet0/0
no shu
!
interface Ethernet0/0.14
encapsulation dot1Q 14
ip address 10.1.1.4255.255.255.0
no shu
!
!
router ospf 10
network 10.1.1.00.0.0.255 area 0
!
router bgp 20
no synchronization
bgp router-id 4.4.4.4
network 4.4.4.0mask 255.255.255.0
neighbor 10.1.1.1remote-as 10
no auto-summary
!
R5配置:
!
hostname r5
!
interface Loopback0
ip address 5.5.5.5255.255.255.0
!
interface Ethernet0/0
no shu
!
interface Ethernet0/0.15
encapsulation dot1Q 15
ip address 20.1.1.5255.255.255.0
no shu
!
!
router ospf 10
network 20.1.1.00.0.0.255 area 0
!
router bgp 10
no synchronization
bgp router-id 5.5.5.5
network 5.5.5.0mask 255.255.255.0
neighbor 20.1.1.1remote-as 10
no auto-summary
!
验证:
下面我们查看一下每个路由器的BGP表,目的是验证BGP中路由条目传递的原则。
r1的BGP表
r1#show ip bgp
BGP table version is 6, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*>i2.2.2.0/24 12.1.1.2 0 100 0 i
*>i3.3.3.0/24 13.1.1.3 0 100 0 i
*> 4.4.4.0/24 10.1.1.4 0 0 20 i
*>i5.5.5.0/24 20.1.1.5 0 100 0 i
r2的BGP表
r2#show ip bgp
BGP table version is 4, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 12.1.1.1 0 100 0 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
r3的BGP表
r3#show ip bgp
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 13.1.1.1 0 100 0 i
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
r4的BGP表
r4#show ip bgp
BGP table version is 6, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 10.1.1.1 0 0 10 i
*> 2.2.2.0/24 10.1.1.1 0 10 i
*> 3.3.3.0/24 10.1.1.1 0 10 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
*> 5.5.5.0/24 10.1.1.1 0 10 i
r5的BGP表
r5#show ip bgp
BGP table version is 4, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 20.1.1.1 0 100 0 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
*> 5.5.5.0/24 0.0.0.0 0 32768 i
从上面每个路由器的BGP表中我们可以得知,默认情况下,IBGP对等体学习到的路由,在满足同步、可达的前提下,仍不会向其他IBGP对等体通告。但会向EBGP对等体通告。,下面我们把R2做成R1路由反射器的客户来观察一下实验现象。配置如下:
r1(config)#router bgp 10
r1(config-router)#neighbor 12.1.1.2route-reflector-client
下面我们来看一R2的BGP表
r2#show ip bgp
BGP table version is 10, local router ID is2.2.2.2
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 12.1.1.1 0 100 0 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
*>i3.3.3.0/24 13.1.1.3 0 100 0 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
*>i5.5.5.0/24 20.1.1.5 0 100 0 i
从上面可以得之,R2从R1学到了所有IBGP对等体的路由条目
下面再来看一下R3和 R5的路由表条目
r3#show ip bgp
BGP table version is 5, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 13.1.1.1 0 100 0 i
*>i2.2.2.0/24 12.1.1.2 0 100 0 i
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
r5#show ip bgp
BGP table version is 5, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? -incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 20.1.1.1 0 100 0 i
*>i2.2.2.0/24 12.1.1.2 0 100 0 i
*>i4.4.4.0/24 10.1.1.4 0 100 0 20 i
*> 5.5.5.0/24 0.0.0.0 0 32768 i
这就证明了路由是从客户处学习到的,将它反射给除了发起该路由的客户外的所有非客户以及客户。反射器从各户收到更新,会向非客户对等体通告。
本文出自 “8738667” 博客,转载请与作者联系!