A-A+

实验五:BGP的路由反射器

2015年11月26日 路由器高级应用 暂无评论 阅读 3 views 次

实验目标:

1、熟练BGP的基本配置。

2、掌握BGP路由反射器的原理。

实验TOP:

物理拓扑

逻辑拓扑

基本配置

R1的配置:

  1. !  
  2. hostname r1  
  3. !  
  4. interface Loopback0  
  5. ip address 1.1.1.1255.255.255.0  
  6. !  
  7. interface Ethernet0/0  
  8. no shu  
  9. !  
  10. interface Ethernet0/0.14  
  11. encapsulation dot1Q 14  
  12. ip address 10.1.1.1255.255.255.0  
  13. no shu  
  14. !  
  15. interface Ethernet0/0.15  
  16. encapsulation dot1Q 15  
  17. ip address 20.1.1.1255.255.255.0  
  18. no shu  
  19. !  
  20. interface Serial1/0  
  21. ip address 12.1.1.1255.255.255.0  
  22. no shu  
  23. !  
  24. interface Serial2/0  
  25. ip address 13.1.1.1255.255.255.0  
  26. no shu  
  27. !  
  28. router ospf 10  
  29. network 10.1.1.00.0.0.255 area 0  
  30. network 12.1.1.00.0.0.255 area 0  
  31. network 13.1.1.00.0.0.255 area 0  
  32. network 20.1.1.00.0.0.255 area 0  
  33. !  
  34. router bgp 10  
  35. no synchronization  
  36. bgp router-id 1.1.1.1  
  37. network 1.1.1.0mask 255.255.255.0  
  38. neighbor 10.1.1.4remote-as 20  
  39. neighbor 12.1.1.2remote-as 10  
  40. neighbor 13.1.1.3remote-as 10  
  41. neighbor 20.1.1.5remote-as 10   
  42. no auto-summary  
  43. !  

R2的配置:

  1. !  
  2. hostname r2  
  3. !  
  4. interface Loopback0  
  5. ip address 2.2.2.2255.255.255.0  
  6. !  
  7. !  
  8. interface Serial2/0  
  9. ip address 12.1.1.2255.255.255.0  
  10. no shu  
  11. !  
  12. router ospf 10  
  13. network 12.1.1.00.0.0.255 area 0  
  14. !  
  15. router bgp 10  
  16. no synchronization  
  17. bgp router-id 2.2.2.2  
  18. network 2.2.2.0mask 255.255.255.0  
  19. neighbor 12.1.1.1remote-as 10  
  20. no auto-summary  
  21. !  

R3的配置:

  1. !  
  2. hostname r3  
  3. !  
  4. interface Loopback0  
  5. ip address 3.3.3.3255.255.255.0  
  6. !  
  7. interface Serial1/0  
  8. ip address 13.1.1.3255.255.255.0  
  9. no shu  
  10. ! www.luyouqiwang.com  
  11. !  
  12. router ospf 10  
  13. network 13.1.1.00.0.0.255 area 0  
  14. !  
  15. router bgp 10  
  16. no synchronization  
  17. bgp router-id 3.3.3.3  
  18. network 3.3.3.0mask 255.255.255.0  
  19. neighbor 13.1.1.1remote-as 10  
  20. no auto-summary  
  21. !  

R4配置:

  1. !  
  2. hostname r4  
  3. !  
  4. interface Loopback0  
  5. ip address 4.4.4.4255.255.255.0  
  6. !  
  7. interface Ethernet0/0  
  8. no shu  
  9. !  
  10. interface Ethernet0/0.14  
  11. encapsulation dot1Q 14  
  12. ip address 10.1.1.4255.255.255.0  
  13. no  shu  
  14. !  
  15. !          
  16. router ospf 10  
  17. network 10.1.1.00.0.0.255 area 0  
  18. !  
  19. router bgp 20  
  20. no synchronization  
  21. bgp router-id 4.4.4.4  
  22. network 4.4.4.0mask 255.255.255.0  
  23. neighbor 10.1.1.1remote-as 10  
  24. no auto-summary  
  25. !  

R5配置:

  1. !  
  2. hostname r5  
  3. !  
  4. interface Loopback0  
  5. ip address 5.5.5.5255.255.255.0  
  6. !  
  7. interface Ethernet0/0  
  8. no shu  
  9. !  
  10. interface Ethernet0/0.15  
  11. encapsulation dot1Q 15  
  12. ip address 20.1.1.5255.255.255.0  
  13. no shu  
  14. !  
  15. !  
  16. router ospf 10  
  17. network 20.1.1.00.0.0.255 area 0  
  18. !  
  19. router bgp 10  
  20. no synchronization  
  21. bgp router-id 5.5.5.5  
  22. network 5.5.5.0mask 255.255.255.0  
  23. neighbor 20.1.1.1remote-as 10  
  24. no auto-summary  
  25. !  

验证:

下面我们查看一下每个路由器的BGP表,目的是验证BGP中路由条目传递的原则。

r1的BGP表

  1. r1#show ip bgp  
  2. BGP table version is 6, local router ID is 1.1.1.1  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *> 1.1.1.0/24       0.0.0.0                  0         32768 i  
  9. *>i2.2.2.0/24       12.1.1.2                 0    100     0 i  
  10. *>i3.3.3.0/24       13.1.1.3                 0   100      0 i  
  11. *> 4.4.4.0/24       10.1.1.4                 0             0 20 i  
  12.   
  13.   
  14. *>i5.5.5.0/24       20.1.1.5                 0    100     0 i  

r2的BGP表

  1. r2#show ip bgp  
  2. BGP table version is 4, local router ID is 2.2.2.2  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *>i1.1.1.0/24       12.1.1.1                 0    100     0 i  
  9. *> 2.2.2.0/24       0.0.0.0                  0         32768 i  
  10. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i  

r3的BGP表

  1. r3#show ip bgp  
  2. BGP table version is 4, local router ID is 3.3.3.3  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *>i1.1.1.0/24       13.1.1.1                 0    100     0 i  
  9. *> 3.3.3.0/24       0.0.0.0                  0         32768 i  
  10. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i  

r4的BGP表

  1. r4#show ip bgp  
  2. BGP table version is 6, local router ID is 4.4.4.4  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *> 1.1.1.0/24       10.1.1.1                 0             0 10 i  
  9. *> 2.2.2.0/24       10.1.1.1                               0 10 i  
  10. *> 3.3.3.0/24       10.1.1.1                               0 10 i  
  11. *> 4.4.4.0/24       0.0.0.0                  0         32768 i   
  12. *> 5.5.5.0/24       10.1.1.1                               0 10 i  

r5的BGP表

  1. r5#show ip bgp  
  2. BGP table version is 4, local router ID is 5.5.5.5  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *>i1.1.1.0/24       20.1.1.1                 0    100     0 i  
  9. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i  
  10. *> 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表

  1. r2#show ip bgp  
  2. BGP table version is 10, local router ID is2.2.2.2  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *>i1.1.1.0/24       12.1.1.1                 0    100     0 i  
  9. *> 2.2.2.0/24       0.0.0.0                  0         32768 i  
  10. *>i3.3.3.0/24       13.1.1.3                 0    100     0 i  
  11. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i   
  12. *>i5.5.5.0/24       20.1.1.5                 0    100     0 i  

从上面可以得之,R2从R1学到了所有IBGP对等体的路由条目

下面再来看一下R3和 R5的路由表条目

  1. r3#show ip bgp  
  2. BGP table version is 5, local router ID is 3.3.3.3  
  3. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  4.              r RIB-failure, S Stale  
  5. Origin codes: i - IGP, e - EGP, ? -incomplete  
  6.   
  7.  Network          Next Hop            Metric LocPrf Weight Path  
  8. *>i1.1.1.0/24       13.1.1.1                 0    100     0 i  
  9. *>i2.2.2.0/24       12.1.1.2                 0   100      0 i  
  10. *> 3.3.3.0/24       0.0.0.0                  0         32768 i  
  11. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i  
  12.   
  13. r5#show ip bgp  
  14. BGP table version is 5, local router ID is 5.5.5.5  
  15. Status codes: s suppressed, d damped, hhistory, * valid, > best, i - internal,  
  16.              r RIB-failure, S Stale  
  17. Origin codes: i - IGP, e - EGP, ? -incomplete  
  18.  Network          Next Hop            Metric LocPrf Weight Path  
  19. *>i1.1.1.0/24       20.1.1.1                 0    100     0 i  
  20. *>i2.2.2.0/24       12.1.1.2                 0    100     0 i  
  21. *>i4.4.4.0/24       10.1.1.4                 0    100     0 20 i   
  22. *> 5.5.5.0/24       0.0.0.0                  0         32768 i  

这就证明了路由是从客户处学习到的,将它反射给除了发起该路由的客户外的所有非客户以及客户。反射器从各户收到更新,会向非客户对等体通告。

标签:

给我留言