IBGP
水平分割:
当一个
IBGP
收到一个
IBGP
邻居的路由时他不会再将这条路由传递给下一个
IBGP
邻居
拓朴如下图:
R1
,
R2
,
R3
是
IBGP
关系,同属于
AS1
区域,
R4
属于
AS4
,
R5
属于
AS5
R1
学不到
R5
的路由
,
Router1#show ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.4/32 14.0.0.4 0 0 4 i
R2
也学不到
R4
的路由
Router2#show ip bgp
BGP table version is 3, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 5.5.5.5/32 25.0.0.5 0 0 5 i
*> 6.6.6.6/32 25.0.0.5 0 0 5 i
但是
R3
可以学到
R4
与
R5
的路由
Router3#show ip bgp
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i4.4.4.4/32 13.0.0.1 0 100 0 4 i
*>i5.5.5.5/32 23.0.0.2 0 100 0 5 i
*>i6.6.6.6/32 23.0.0.2 0 100 0 5 i
Router1#show run
Building configuration...
Current configuration : 1264 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
ip subnet-zero
!
fax interface-type fax-mail
mta receive maximum-recipients 0
!
interface Loopback0
no ip address
!
interface FastEthernet0/0
ip address 14.0.0.1 255.0.0.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 13.0.0.1 255.0.0.0
duplex auto
speed auto
!
!
router ospf 1
log-adjacency-changes
network 13.0.0.1 0.0.0.0 area 0
network 14.0.0.1 0.0.0.0 area 0
!
router bgp 1
no synchronization //
关闭同步
bgp log-neighbor-changes
neighbor 13.0.0.3 remote-as 1 //和AS1的13.0.0.3建立IBGP邻居关系
neighbor 13.0.0.3 next-hop-self //
更改
13.0.0.3
的下一跳属性
neighbor 14.0.0.4 remote-as 4 //和AS4的14.0.0.4建立EBGP领居关系
neighbor 14.0.0.4 ebgp-multihop 2 //
指定
EBGP
的邻居多跳
neighbor 14.0.0.4 next-hop-self //
更改
14.0.0.4
的下一跳属性
no auto-summary
!
!
end
Router2#show run
Building configuration...
Current configuration : 1264 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
!
ip subnet-zero
!
fax interface-type fax-mail
mta receive maximum-recipients 0
!
interface Loopback0
no ip address
!
interface FastEthernet0/0
ip address 23.0.0.2 255.0.0.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 25.0.0.2 255.0.0.0
duplex auto
speed auto
router ospf 1
log-adjacency-changes
network 23.0.0.2 0.0.0.0 area 0
network 25.0.0.2 0.0.0.0 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 23.0.0.3 remote-as 1
neighbor 23.0.0.3 next-hop-self
neighbor 25.0.0.5 remote-as 5
neighbor 25.0.0.5 ebgp-multihop 2
neighbor 25.0.0.5 next-hop-self
no auto-summary
!
end
Router3#show run
Building configuration...
Current configuration : 1176 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
ip subnet-zero
!
fax interface-type fax-mail
mta receive maximum-recipients 0
!
interface Loopback0
no ip address
!
interface FastEthernet0/0
ip address 23.0.0.3 255.0.0.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 13.0.0.3 255.0.0.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 13.0.0.3 0.0.0.0 area 0
network 23.0.0.3 0.0.0.0 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 13.0.0.1 remote-as 1
neighbor 13.0.0.1 next-hop-self
neighbor 23.0.0.2 remote-as 1
neighbor 23.0.0.2 next-hop-self
no auto-summary
!
End
Router4#show run
Building configuration...
Current configuration : 1096 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
ip subnet-zero
!
fax interface-type fax-mail
mta receive maximum-recipients 0
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
ip address 14.0.0.4 255.0.0.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Ethernet1/0
no ip address
shutdown
half-duplex
router bgp 4
no synchronization
bgp log-neighbor-changes
network 4.4.4.4 mask 255.255.255.255
neighbor 14.0.0.1 remote-as 1
neighbor 14.0.0.1 ebgp-multihop 2
no auto-summary
!
ip route 0.0.0.0 0.0.0.0 14.0.0.1
End
Router5#show run
Building configuration...
Current configuration : 1192 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
ip subnet-zero
!
fax interface-type fax-mail
mta receive maximum-recipients 0
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Loopback1
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 25.0.0.5 255.0.0.0
duplex auto
speed auto
!
!
router bgp 5
no synchronization
bgp log-neighbor-changes
network 5.5.5.5 mask 255.255.255.255 //宣告自己的环回
network 6.6.6.6 mask 255.255.255.255
neighbor 25.0.0.2 remote-as 1
neighbor 25.0.0.2 ebgp-multihop 2
no auto-summary
!
ip route 0.0.0.0 0.0.0.0 25.0.0.2 //用于回包的路由
End
如何才能让
R1
学到
R5
的路由??
如何才能让
R2
学到
R4
的路由??
解决此类问题:让
R1
与
R2
建立邻居关系,实现
IBGP
会话的全互联