实例解析BGP基本配置之路由反射器(3)

网络
本文通过一个案例介绍了BGP基本配置中路由反射器的配置过程,希望通过以下的介绍,大家能够有所收获。

 

BGP检查配置之前,我们向大家介绍了:BGP基本配置之中路由反射器实例的概述基本配置

检查BGP之RA

  1. RA#sh ip bgp  
  2.  
  3. Network          Next Hop       Metric LocPrf   Weight Path  
  4.  
  5. *> 1.1.1.0/24       0.0.0.0                  0                          32768 i  
  6.  
  7. *> 2.2.2.0/24       192.1.1.2               0                       0 200 i  
  8.  
  9. *> 3.3.3.0/24       192.1.1.2                                        0 200 i 

 

可以看到RA已经通过BGP学习到了各个虚拟接口,这两条路由下一跳均为192.1.1.2。这里需指出当AS边界路由器通过EBGP转发路由信息时,总是将这些路由信息的下一跳设定为自己。

检查BGP之RB

  1. RB#sh ip bgp  
  2.  
  3. Network          Next Hop            Metric LocPrf Weight Path  
  4.  
  5. *> 1.1.1.0/24       192.1.1.1                0             0 100 i  
  6.  
  7. *> 2.2.2.0/24       0.0.0.0                  0         32768 i  
  8.  
  9. *>i3.3.3.0/24       193.1.1.2                0    100      0 i 

 

可以看到RB也学习到了这些虚拟接口

检查BGP之RC

  1. RC#sh ip bgp  
  2.  
  3. Network          Next Hop            Metric LocPrf Weight Path  
  4.  
  5. *>i1.1.1.0/24       192.1.1.1                0    100      0 100 i  
  6.  
  7. *>i2.2.2.0/24       193.1.1.1                0    100      0 i  
  8.  
  9. *> 3.3.3.0/24       0.0.0.0                  0         32768 i 

 

RC也学习到了这些路由

检查BGP之RD

  1. RD#sh ip bgp  
  2.  
  3. Network          Next Hop            Metric LocPrf Weight Path  
  4.  
  5. *>i3.3.3.0/24       194.1.1.1                0    100      0 i 

 

我们注意到这时RD并没有学习到1.1.1.0/24和2.2.2.0/24两个网段。这是因为在一个BGP域中,RC并不会将它通过RB学习到的路由转发给RD。这是我们需要将RC配置成路由反射器。配置如下:

  1. RC(config)# router bgp 200  
  2.  
  3. RC(config)#neighbor 193.1.1.1 route-reflector-client  
  4.  
  5. RC(config)#neighbor 194.1.1.2 route-reflector-client 

 

这两条命令是将RB和RD设为RC的路由反射器客户端

BGP再次检查

我们再次在RD上进行验证,之前用 clear ip bgp * 重启BGP进程,稍等一会儿在RD上进行查看;

  1. RD#sh ip bgp  
  2.  
  3. Network          Next Hop            Metric LocPrf Weight Path  
  4.  
  5. *>i1.1.1.0/24       192.1.1.1                0    100      0 100 i  
  6.  
  7. *>i2.2.2.0/24       193.1.1.1                0    100      0 i  
  8.  
  9. *>i3.3.3.0/24       194.1.1.1                0    100      0 i 

 

这时RD已经学习到了所有的虚拟接口,至此我们的路由反射器配置成功。下面我们将通过查看路由表来追踪这些路由信息。在这之前我们再次进入所有路由器的 BGP进程,输入: no synchronization 来取消BGP与IGP的同步关系,使得IGP能学到BGP中的路由信息,再次 clearip bgp * 和 clear ip route *  稍等片刻,等待BGP邻接关系再次建立后,我们在RB,RC,RD 分别用 sh iproute 就都能得到完整的路由信息了。以RC为例;

  1. RC#sh ip route  
  2.  
  3. Gateway of last resort is not set  
  4.  
  5. 1.0.0.0/24 is subnetted, 1 subnets  
  6.  
  7. B       1.1.1.0 [200/0] via 192.1.1.1, 02:08:19  
  8.  
  9. 2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks  
  10.  
  11. O       2.2.2.2/32 [110/11] via 193.1.1.1, 02:08:58, Ethernet0  
  12.  
  13. B       2.2.2.0/24 [200/0] via 193.1.1.1, 02:08:43  
  14.  
  15. 3.0.0.0/24 is subnetted, 1 subnets  
  16.  
  17. C       3.3.3.0 is directly connected, Loopback0  
  18.  
  19. C    193.1.1.0/24 is directly connected, Ethernet0  
  20.  
  21. O    192.1.1.0/24 [110/74] via 193.1.1.1, 02:08:58, Ethernet0  
  22.  
  23. C    194.1.1.0/24 is directly connected, Serial0 

 

到现在为止,所有路由器的BGP表都已经完整,RB,RC,RD的IP路由表也已经完整,现在我们来看RA的路由表。

  1. RA#sh ip route  
  2.  
  3. Gateway of last resort is not set  
  4.  
  5. 1.0.0.0/24 is subnetted, 1 subnets  
  6.  
  7. C       1.1.1.0 is directly connected, Loopback0  
  8.  
  9. 2.0.0.0/24 is subnetted, 1 subnets  
  10.  
  11. B       2.2.2.0 [20/0] via 192.1.1.2, 02:18:43  
  12.  
  13. 3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks  
  14.  
  15. B       3.3.3.3/32 [20/11] via 192.1.1.2, 02:12:30  
  16.  
  17. B       3.3.3.0/24 [20/0] via 192.1.1.2, 02:18:43  
  18.  
  19. C    192.1.1.0/24 is directly connected, Serial0 

 

我们可以看到在RA的路由表中并没有193.1.1.0/24和194.1.1.0/24这两个网段的路由,这是因为这两条路由是在AS200中通过OSPF发布的,因此R1当然无法学到。我们需要在AS边界路由器RB上将OSPF的路由信息重发布到BGP中;配置如下:

  1. RB(config)#router bgp 200  
  2.  
  3. RB(config)#redistribute ospf 1 

 

再次来到RA中,

  1. RA#sh ip route  
  2.  
  3. Gateway of last resort is not set  
  4.  
  5. 1.0.0.0/24 is subnetted, 1 subnets  
  6.  
  7. C       1.1.1.0 is directly connected, Loopback0  
  8.  
  9. 2.0.0.0/24 is subnetted, 1 subnets  
  10.  
  11. B       2.2.2.0 [20/0] via 192.1.1.2, 02:26:51  
  12.  
  13. 3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks  
  14.  
  15. B       3.3.3.3/32 [20/11] via 192.1.1.2, 02:20:39  
  16.  
  17. B       3.3.3.0/24 [20/0] via 192.1.1.2, 02:26:51  
  18.  
  19. B    193.1.1.0/24 [20/0] via 192.1.1.2, 02:20:38  
  20.  
  21. C    192.1.1.0/24 is directly connected, Serial0  
  22.  
  23. B    194.1.1.0/24 [20/74] via 192.1.1.2, 02:20:38 

 

我们可以看到这两条路由已经被RA学习到了。

BGP基本配置中路由反射器的配置就介绍完了,希望大家已经掌握。

【编辑推荐】

  1. 路由器故障:广域网故障处理分析
  2. 初学者必看:CISCO路由器教程讲解
  3. 浅析路由器设置如何彻底实现DDoS防御
  4. 熟练使用cisco rommon维护路由器 上篇
  5. 实例解析BGP基本配置之路由反射器(1) 
责任编辑:佚名 来源: 网络转载
相关推荐

2011-04-08 09:27:06

路由反射器

2011-04-08 09:26:53

BGP路由器

2011-03-14 17:26:29

BGP

2011-04-01 10:07:04

2011-03-14 17:02:36

BGP

2011-04-13 16:15:49

路由协议路由器路由

2011-04-01 09:40:28

OSPF路由器

2011-04-01 09:40:32

OSPF路由器

2011-04-01 09:40:25

OSPF路由器

2011-04-01 10:06:58

OSPF路由器

2011-04-01 10:11:25

OSPF路由器

2009-12-02 10:34:04

华为路由器配置实例

2011-08-16 10:50:35

DHCP路由器配置

2011-03-07 17:34:35

IGRP

2011-04-01 10:07:01

OSPF路由器

2009-12-31 10:28:20

VPN配置实例

2011-09-07 12:36:40

路由器连接路由器

2011-08-16 11:22:09

EIGRP帧中继

2011-08-09 13:30:17

腾达无线路由器路由器无线

2011-04-13 11:27:28

EIGRP路由
点赞
收藏

51CTO技术栈公众号