BGP 路由反射器实验报告
一、 实验目的
配置IBGP路由器使用路由反射器和简单的路由过滤器
二、 拓扑结构图
BGP路由反射器实验_第1张图片
三、 实验步骤
1.    配置基本接口地址()
测试: sanjose3(config)#do  ping 192.168.1.5
sanjose3(config)#do ping 172.24.1.18  通 基本地址配置成功
2.     配置内部IBGP协议采用rip
Sanjose3(config-if)#router rip
Sanjose3(config-router)#net 192.168.1.0
Sanjose3(config-router)#net 172.24.0.0
 
sanjose1(config-if)#router rip
sanjose1(config-router)#net 192.168.1.0
 
sanjose2(config-if)#router rip
sanjose2 (config-router)#net 172.24.0.0
3.    配置bgp协议
sanjose3(config)#router bgp 100
sanjose3(config-router)#neigh 192.168.1.5 remote-as 100
sanjose3(config-router)#neigh 172.24.1.18 remote-as 100
sanjose3(config-router)#net 200.100.50.0
 
sanjose1(config)#router bgp 100
sanjose1(config-router)#neigh 192.168.1.6 remote-as 100
 
sanjose2(config)#router bgp 100
sanjose2(config-router)#neigh 172.24.1.17 remote-as 100
sanjose2(config-router)#net 199.9.9.0
查看结果:
sanjose2#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 199.9.9.0        0.0.0 .0                  0         32768 i
r>i200.100.50.0     172.24.1.17              0    100      0 i
 
sanjose3#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
r>i199.9.9.0        172.24.1.18              0    100      0 i
 
sanjose1#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
r>i200.100.50.0     192.168.1.6              0    100      0 i
 
sanjose1#show ip route
R    200.100.50.0/24 [120/1] via 192.168.1.6, 00:00:11, Serial0/0
R    172.24.0.0/16 [120/1] via 192.168.1.6, 00:00:11, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0/0
 
问题:为什么在sanjose1上看不到哦啊199.9.9.0网络的bgp条目
原因:因为在一个自治系统内,由于水平分割的原则, 通过IBGP学习到的路径从来不会公告给其他IBGP
4.    配置路由反射器打破水平分割
sanjose3(config)#router bgp 100
sanjose3(config-router)#neigh 192.168.1.5 route-reflector-client
sanjose3(config-router)#neigh 172.24.1.18 route-reflector-client
 
sanjose1#sh ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*>i199.9.9.0        172.24.1.18              0    100      0 i
*>i200.100.50.0     192.168.1.6              0    100      0 i
 
sanjose1#sh ip route
B    199.9.9.0/24 [200/0] via 172.24.1.18, 00:00:52
B    200.100.50.0/24 [200/0] via 192.168.1.6, 00:01:48
R    172.24.0.0/16 [120/1] via 192.168.1.6, 00:00:14, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0/0
 
测试: sanjose1#ping 199.9.9.1
 
sanjose3#sh ip pro
Routing Protocol is "bgp 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Route Reflector for address family IPv4 Unicast, 2 clients
  Route Reflector for address family ×××v4 Unicast, 2 clients
  Route Reflector for address family IPv4 Multicast, 2 clients
  IGP synchronization is disabled
  Automatic route summarization is disabled
  Neighbor(s):
    Address          FiltIn FiltOut DistIn DistOut Weight RouteMap
    172.24.1.18                                         
    192.168.1.5                                         
  Maximum path: 1
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.24.1.18          200      00:03:07
  Distance: external 20 internal 200 local 200
5.    配置汇总地址
sanjose2(config)#router bgp 100
sanjose2(config-router)#aggre
sanjose2(config-router)#aggregate-address 199.0.0.0 255.255.255.0
 
sanjose2#sho ip bgp 199.0.0.0
BGP routing table entry for 199.0.0.0/8, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1        
  Local, (aggregated by 100 199.9.9.1)
    0.0.0 .0 from 0.0.0.0 (199.9.9.1)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best
 
sanjose1#show ip route
B    199.9.9.0/24 [200/0] via 172.24.1.18, 00:11:04
B    200.100.50.0/24 [200/0] via 192.168.1.6, 00:12:00
R    172.24.0.0/16 [120/1] via 192.168.1.6, 00:00:09, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0/0
B    199.0.0.0/8 [200/0] via 172.24.1.18, 00:02:41
6.    配置路由过滤防止sanjose3发送199.9.9.0/24给其他网络
sanjose3(config)#ip prefix-list supernetonly permit 199.0.0.0/8
sanjose3(config)#router bgp 100
sanjose3(config-router)#neighbor 192.168.1.5 prefix-list supernetonly out
 
查看结果
sanjose1#show ip route
R    172.24.0.0/16 [120/1] via 192.168.1.6, 00:00:23, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.4 is directly connected, Serial0/0
B    199.0.0.0/8 [200/0] via 172.24.1.18, 00:05:39
    只有一条bgp的汇总条目!!