实验前推荐阅读

 
【实验说明】
使用BGP联盟配置R1、R2、R3,将AS2分为两个私有AS,如下图所示,但AS1和AS3看到的仍然是AS2。
BGP联盟(confedration)的目的是为了解决BGP的同步,上一实验中采用路由翻转来解决,本次实验用BGP联盟来解决。
BGP联盟概述:
AS内部的所有路由器都运行bgp,把一个原始的AS基于网络拓扑划分为若干个sub-AS(又称联盟AS),联盟AS之间的bgp邻居叫做联盟ebgp,不需要full mesh bgp会话;在每个联盟AS内部运full mesh ibgp或者hub and spoke反射器,然后就可以关闭所有路由器的bgp同步功能.
【实验拓扑】

 

【实验配置】

【实验基本配置】

R1:
interface FastEthernet0/0
ip address 155.1.146.1 255.255.255.0
interface Serial0/0
ip address 155.1.13.1 255.255.255.0
clock rate 2000000
router eigrp 2
network 155.1.13.1 0.0.0.0
no auto-summary
!
router bgp 65013
bgp confederation identifier 2
neighbor 155.1.13.3 remote-as 65013
neighbor 155.1.13.3 next-hop-self
neighbor 155.1.146.4 remote-as 3
R2:
interface Serial0/0
ip address 155.1.23.2 255.255.255.0
clock rate 2000000
interface Serial0/1
ip address 155.1.0.2 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.5 205 broadcast
router eigrp 2
network 155.1.23.2 0.0.0.0
no auto-summary
!
router bgp 65002
bgp confederation identifier 2
bgp confederation peers 65013
neighbor 155.1.23.3 remote-as 65013
neighbor 155.1.23.3 next-hop-self
neighbor 155.1.0.5 remote-as 1

注意:R2与R3之间也需要制定 next-hop-self,
否则R3 ping不通R5的通告地址。不清楚是否存在bug
R3:
interface Loopback0
ip address 155.1.37.3 255.255.255.0
interface Serial0/0
ip address 155.1.13.3 255.255.255.0
clock rate 2000000
interface Serial0/1
ip address 155.1.23.3 255.255.255.0
clock rate 2000000
router eigrp 2
network 155.1.13.3 0.0.0.0
network 155.1.23.3 0.0.0.0
auto-summary
!
router bgp 65013
bgp confederation identifier 2
bgp confederation peers 65002
network 155.1.37.0 mask 255.255.255.0
neighbor 155.1.13.1 remote-as 65013
neighbor 155.1.13.1 next-hop-self
neighbor 155.1.23.2 remote-as 65002
 
R4:
interface Loopback0
ip address 204.12.1.4 255.255.255.0
!
interface FastEthernet0/0
ip address 155.1.146.4 255.255.255.0
router bgp 3
no synchronization
bgp log-neighbor-changes
network 204.12.1.0
neighbor 155.1.146.1 remote-as 2
R5:
interface Loopback0
ip address 155.1.5.5 255.255.255.0
interface Loopback1
ip address 155.1.58.5 255.255.255.0
interface Serial0/0
ip address 155.1.0.5 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.2 502 broadcast
router bgp 1
network 155.1.5.0 mask 255.255.255.0
neighbor 155.1.0.2 remote-as 2
 
 

【实验验证】

 

R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 155.1.146.1 0 2 1 i
*> 155.1.37.0/24 155.1.146.1 0 2 i
*> 204.12.1.0 0.0.0.0 0 32768 i
R4#ping 155.1.5.5 source 204.12.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 155.1.5.5, timeout is 2 seconds:
Packet sent with a source address of 204.12.1.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/44/64 ms
R1#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*>i155.1.5.0/24 155.1.13.3 0 100 0 (65002) 1 i
*>i155.1.37.0/24 155.1.13.3 0 100 0 i
*> 204.12.1.0 155.1.146.4 0 0 3 i
R2#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 155.1.0.5 0 0 1 i
*> 155.1.37.0/24 155.1.23.3 0 100 0 (65013) i
*> 204.12.1.0 155.1.13.1 0 100 0 (65013) 3 i
R3#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 155.1.23.2 0 100 0 (65002) 1 i
*> 155.1.37.0/24 0.0.0.0 0 32768 i
*>i204.12.1.0 155.1.13.1 0 100 0 3 i
 
R3#ping 155.1.5.5 source 155.1.37.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 155.1.5.5, timeout is 2 seconds:
Packet sent with a source address of 155.1.37.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/19/36 ms
 
R5#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 155.1.5.0/24 0.0.0.0 0 32768 i
*> 155.1.37.0/24 155.1.0.2 0 2 i
*> 204.12.1.0 155.1.0.2 0 2 3 i
R5#ping 155.1.37.3 source 155.1.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 155.1.37.3, timeout is 2 seconds:
Packet sent with a source address of 155.1.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/39/68 ms