A-A+

BGP路由策略实验(H3C)的完整报告

2015年11月23日 站长资讯 暂无评论

一、这次bgp路由策略实验的拓扑图如下:

二、本次实验的具体要求:

1.互联链路配置及测试

2.AS65001和AS65002的IGP配置及测试(修改以太网接口网络类型为P2P,修改R2、R3间OSPF链路开销为10,请不要将AS65001的业务网段发布进IGP)。

3.按图示建立BGP邻居关系,并查看BGP邻居表(请不要忘记针对IBGP邻居修改更新源和下一跳)。

4.在R1、R2、R3、R4上用BGP发布各自AS的业务网段路由(Loop1)

5.查看各台路由器的BGP路由表和IP转发表,查看是否有去往其他AS业务网段的路由。请分析R6的BGP路由表中的最优BGP路由是如何选择的?

6.测试各业务网段间的连通性。

7.在合适的位置上通过修改Local-Pre值实现AS65002的业务网段去往10.30.1.1的主路径走R1-R2,去往10.40.4.1的主路径走R3-R4,使用Tracert命令测试。

8. 还原第7步的配置后,在合适的位置上通过修改MED值实现AS65002的业务网段去往10.30.1.1的主路径走R1-R2,去往10.40.4.1的主路径走R3-R4使用Tracert命令测试。

三、完整的实验过程和命令行:

  1. [R1]bgp 65001  
  2. [R1-bgp]peer 10.0.1.6 as-num 65002  
  3. [R1-bgp]peer 4.4.4.4 as-num 65002  
  4. [R1-bgp]peer 4.4.4.4 connect-int lo0  
  5. [R1-bgp]peer 4.4.4.4 next-hop-lo  
  6.    
  7. [R4]bgp 65001  
  8. [R4-bgp]peer 10.0.1.10 as-num 65002  
  9. [R4-bgp]peer 1.1.1.1 as-num 65001  
  10. [R4-bgp]peer 1.1.1.1 connect-int lo0  
  11. [R4-bgp]peer 1.1.1.1 next-hop-lo  
  12.    
  13. [R2]bgp 65002  
  14. [R2-bgp]peer 10.0.1.5 as-num 65001  
  15. [R2-bgp]group rr internal   
  16. [R2-bgp]peer rr next-hop-lo  
  17. [R2-bgp]peer rr connect-int lo0  
  18. [R2-bgp]peer 3.3.3.3 group rr  
  19. [R2-bgp]peer 5.5.5.5 group rr  
  20. [R2-bgp]peer 6.6.6.6 group rr  
  21.    
  22. [R3]bgp 65002  
  23. [R3-bgp]peer 10.0.1.9 as-num 65001  
  24. [R3-bgp]group nn internal  
  25. [R3-bgp]peer nn next-hop-lo  
  26. [R3-bgp]peer nn connect-int lo0  
  27. [R3-bgp]peer 2.2.2.2 group nn  
  28. [R3-bgp]peer 5.5.5.5 group nn  
  29. [R3-bgp]peer 6.6.6.6 group nn  
  30.    
  31. [R5]bgp 65002  
  32. [R5-bgp]group mm internal   
  33. [R5-bgp]peer mm next  
  34. [R5-bgp]peer mm next-hop-local   
  35. [R5-bgp]peer mm con  
  36. [R5-bgp]peer mm connect-interface lo0  
  37. [R5-bgp]peer 2.2.2.2 group mm  
  38. [R5-bgp]peer 3.3.3.3 group mm  
  39. [R5-bgp]peer 6.6.6.6 group  mm  
  40.    
  41. [R6]bgp 65002  
  42. [R6-bgp]group ii internal   
  43. [R6-bgp]peer ii ne  
  44. [R6-bgp]peer ii next-hop-local   
  45. [R6-bgp]peer ii con   
  46. [R6-bgp]peer ii connect-interface lo0  
  47. [R6-bgp]peer 2.2.2.2 group ii  
  48. [R6-bgp]peer 5.5.5.5 group ii  
  49. [R6-bgp]peer 3.3.3.3 group ii  
  50. [R6-bgp]  
  51.    
  52. [R2-bgp]net 10.10.5.1 32  
  53. [R2-bgp]net 10.10.6.1 32  
  54. [R2-bgp]  
  55.    
  56. [R3-bgp]net 10.10.5.1 32  
  57. [R3-bgp]net 10.10.6.1 32  
  58. [R3-bgp]  
  59.    
  60. [R1-bgp]net 10.30.1.1 32  
  61. [R4-bgp]net 10.40.4.1 32  
  62.    
  63. [R2]bgp 65002  
  64. [R2-bgp]peer 10.0.1.5 route-po lp import   
  65. [R2-bgp]q  
  66. [R2]route-po lp permit node 10  
  67. New Sequence of this List  
  68. [R2-route-policy]if-m acl 2003  
  69. [R2-route-policy]apply local-pre 300  
  70. [R2-route-policy]qui  
  71. [R2]acl num 2003  
  72. [R2-acl-basic-2003]rule permit source 10.30.1.1 0.0.0.0   
  73. [R2-acl-basic-2003]qui  

问题:

1.BGP发言者network的路由以及自己使用的路由才会发布到对等体

2.BGP路由表里可用与最优是什么意思?

最优的一定是可用的,可用的不一定是最优的。

在R3上(BGP里)network3.3.3.3 32 之后

  1. [R4]dis ip rout  
  2. Routing Tables: Public  
  3.         Destinations : 8        Routes : 8  
  4.    
  5. Destination/Mask    Proto  Pre  Cost         NextHop         Interface  
  6.    
  7. 4.4.4.4/32          Direct 0    0            127.0.0.1       InLoop0  
  8. 10.0.1.0/30         Direct 0    0            10.0.1.2        Eth0/1/0  
  9. 10.0.1.2/32         Direct 0    0            127.0.0.1       InLoop0  
  10. 10.0.1.8/30         Direct 0    0            10.0.1.9        Eth0/1/1  
  11. 10.0.1.9/32         Direct 0    0            127.0.0.1       InLoop0  
  12. 10.40.4.1/32        Direct 0    0            127.0.0.1       InLoop0  
  13. 127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0  
  14. 127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0  
  15.    
  16. [R4] dis bgp rout  
  17.    
  18.  Total Number of Routes: 2  
  19.    
  20.  BGP Local router ID is 10.40.4.1   
  21.  Status codes: * - valid, > - best, d - damped,  
  22.                h - history,  i - internal, s - suppressed, S - Stale  
  23.                Origin : i - IGP, e - EGP, ? - incomplete  
  24.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  25.    
  26.  *>  3.3.3.3/32         10.0.1.10       0                     0       65002i  
  27.  *>  10.40.4.1/32       0.0.0.0         0                     0       i  
  28.    
  29.    
  30.    
  31. <R5> dis bgp rout  
  32.    
  33.  Total Number of Routes: 3  
  34.    
  35.  BGP Local router ID is 10.10.5.1   
  36.  Status codes: * - valid, > - best, d - damped,  
  37.                h - history,  i - internal, s - suppressed, S - Stale  
  38.                Origin : i - IGP, e - EGP, ? - incomplete  
  39.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  40.    
  41.  i 3.3.3.3/32         3.3.3.3         0          100        0       i  
  42.  *>i 10.30.1.1/32       2.2.2.2         0          100        0       65001i  
  43.  *>i 10.40.4.1/32       3.3.3.3         0          100        0       65001i  
  44.    
  45. <R5>dis ip rout  
  46. Routing Tables: Public  
  47.         Destinations : 17       Routes : 20  
  48.    
  49. Destination/Mask    Proto  Pre  Cost         NextHop         Interface  
  50.    
  51. 2.2.2.2/32          OSPF   10   10           10.0.1.17       Eth0/1/0  
  52. 3.3.3.3/32          OSPF   10   20           10.0.1.17       Eth0/1/0  
  53.                     OSPF   10   20           10.0.1.26       Eth0/1/2  
  54. 5.5.5.5/32          Direct 0    0            127.0.0.1       InLoop0  
  55. 6.6.6.6/32          OSPF   10   10           10.0.1.26       Eth0/1/2  
  56. 10.0.1.4/30         OSPF   10   20           10.0.1.17       Eth0/1/0  
  57. 10.0.1.8/30         OSPF   10   30           10.0.1.17       Eth0/1/0  
  58.                     OSPF   10   30           10.0.1.26       Eth0/1/2  
  59. 10.0.1.12/30        OSPF   10   20           10.0.1.17       Eth0/1/0  
  60. 10.0.1.16/30        Direct 0    0            10.0.1.18       Eth0/1/0  
  61. 10.0.1.18/32        Direct 0    0            127.0.0.1       InLoop0  
  62. 10.0.1.20/30        OSPF   10   20           10.0.1.26       Eth0/1/2  
  63. 10.0.1.24/30        Direct 0    0            10.0.1.25       Eth0/1/2  
  64. 10.0.1.25/32        Direct 0    0            127.0.0.1       InLoop0  
  65. 10.10.5.1/32        Direct 0    0            127.0.0.1       InLoop0  
  66. 10.30.1.1/32        BGP    255  0            2.2.2.2         Eth0/1/0  
  67. 10.40.4.1/32        BGP    255  0            3.3.3.3         Eth0/1/0  
  68.                     BGP    255  0            3.3.3.3         Eth0/1/2  
  69. 127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0  
  70. 127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0  
  71.    
  72.    
  73. [R3]dis ip rout  
  74. Routing Tables: Public  
  75.         Destinations : 18       Routes : 19  
  76.    
  77. Destination/Mask    Proto  Pre  Cost         NextHop         Interface  
  78.    
  79. 2.2.2.2/32          OSPF   10   10           10.0.1.13       S0/2/0  
  80. 3.3.3.3/32          Direct 0    0            127.0.0.1       InLoop0  
  81. 5.5.5.5/32          OSPF   10   20           10.0.1.13       S0/2/0  
  82.                     OSPF   10   20           10.0.1.22       Eth0/1/1  
  83. 6.6.6.6/32          OSPF   10   10           10.0.1.22       Eth0/1/1  
  84. 10.0.1.4/30         OSPF   10   20           10.0.1.13       S0/2/0  
  85. 10.0.1.8/30         Direct 0    0            10.0.1.10       Eth0/1/3  
  86. 10.0.1.10/32        Direct 0    0            127.0.0.1       InLoop0  
  87. 10.0.1.12/30        Direct 0    0            10.0.1.14       S0/2/0  
  88. 10.0.1.13/32        Direct 0    0            10.0.1.13       S0/2/0  
  89. 10.0.1.14/32        Direct 0    0            127.0.0.1       InLoop0  
  90. 10.0.1.16/30        OSPF   10   20           10.0.1.13       S0/2/0  
  91. 10.0.1.20/30        Direct 0    0            10.0.1.21       Eth0/1/1  
  92. 10.0.1.21/32        Direct 0    0            127.0.0.1       InLoop0  
  93. 10.0.1.24/30        OSPF   10   20           10.0.1.22       Eth0/1/1  
  94. 10.30.1.1/32        BGP    255  0            2.2.2.2         S0/2/0  
  95. 10.40.4.1/32        BGP    255  0            10.0.1.9        Eth0/1/3  
  96. 127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0  
  97. 127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0  
  98.    
  99. [R3]dis bgp rout  
  100.    
  101.  Total Number of Routes: 3  
  102.    
  103.  BGP Local router ID is 3.3.3.3   
  104.  Status codes: * - valid, > - best, d - damped,  
  105.                h - history,  i - internal, s - suppressed, S - Stale  
  106.                Origin : i - IGP, e - EGP, ? - incomplete  
  107.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  108.    
  109. *>  3.3.3.3/32         0.0.0.0         0                     0       i  
  110.  *>i 10.30.1.1/32       2.2.2.2         0          100        0       65001i  
  111.  *>  10.40.4.1/32       10.0.1.9        0                     0       65001i  

3.R1和R4互相收不到路由。

  1. <R1>dis ip rout  
  2. Routing Tables: Public  
  3.         Destinations : 9        Routes : 9  
  4.    
  5. Destination/Mask    Proto  Pre  Cost         NextHop         Interface  
  6.    
  7. 1.1.1.1/32          Direct 0    0            127.0.0.1       InLoop0  
  8. 10.0.1.0/30         Direct 0    0            10.0.1.1        Eth0/1/2  
  9. 10.0.1.1/32         Direct 0    0            127.0.0.1       InLoop0  
  10. 10.0.1.4/30         Direct 0    0            10.0.1.5        Eth0/1/0  
  11. 10.0.1.5/32         Direct 0    0            127.0.0.1       InLoop0  
  12. 10.10.5.1/32        BGP    255  10           10.0.1.6        Eth0/1/0  
  13. 10.30.1.1/32        Direct 0    0            127.0.0.1       InLoop0  
  14. 127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0  
  15. 127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0  
  16.    
  17. <R4>dis ip rout  
  18. Routing Tables: Public  
  19.         Destinations : 10       Routes : 10  
  20.    
  21. Destination/Mask    Proto  Pre  Cost         NextHop         Interface  
  22.    
  23. 3.3.3.3/32          BGP    255  0            10.0.1.10       Eth0/1/1  
  24. 4.4.4.4/32          Direct 0    0            127.0.0.1       InLoop0  
  25. 10.0.1.0/30         Direct 0    0            10.0.1.2        Eth0/1/0  
  26. 10.0.1.2/32         Direct 0    0            127.0.0.1       InLoop0  
  27. 10.0.1.8/30         Direct 0    0            10.0.1.9        Eth0/1/1  
  28. 10.0.1.9/32         Direct 0    0            127.0.0.1       InLoop0  
  29. 10.10.5.1/32        BGP    255  20           10.0.1.10       Eth0/1/1  
  30. 10.40.4.1/32        Direct 0    0            127.0.0.1       InLoop0  
  31. 127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0  
  32. 127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0  

查看邻居是否建立

  1. <R1> dis bgp peer  
  2.    
  3.  BGP local router ID : 10.30.1.1  
  4.  Local AS number : 65001  
  5.  Total number of peers : 2                Peers in established state : 1  
  6.    
  7.   Peer            V    AS  MsgRcvd  MsgSent  OutQ PrefRcv Up/Down  State  
  8.    
  9.   4.4.4.4         4 65002        0        0     0       0 00:45:19 Active     
  10.   10.0.1.6        4 65002       49       61     0       1 00:44:48 Established  
  11.    
  12.    
  13. <R4>  dis bgp peer  
  14.    
  15.  BGP local router ID : 10.40.4.1  
  16.  Local AS number : 65001  
  17.  Total number of peers : 2                Peers in established state : 1  
  18.    
  19.   Peer            V    AS  MsgRcvd  MsgSent  OutQ PrefRcv Up/Down  State  
  20.    
  21.   1.1.1.1         4 65001        0        0     0       0 01:02:43 Active  
  22.   10.0.1.10       4 65002       84       84     0       2 01:02:11 Established  

邻居未建立,停在了Active状态。为什么。

排错:BGP邻居通过对比open消息建立连接关系,并进行了参数协商。内容包括:BGP版本号,自己所属的AS号,路由器ID,hold time值、认证信息。

1) 于是首先发现R1配对等体时AS号错了。改正之后还是不行。

2)后来发现建邻居用的是loopback接口,TCP三次握手需要路由才能到,由于没有到对方loopback口的路由,所以无法建立TCP连接,所以建立不了邻居。
配了到各自的静态的路由之后,可以建立邻居。

问题,不配静态路由,R1,R4能否通过跨越AS 65002建邻居。前提在BGP里network了loopback网段。

  1. [R1]undo ip rout 10.40.4.1 255.255.255.255 10.0.1.2  
  2. [R1]dis bgp peer  
  3.    
  4.  BGP local router ID : 10.30.1.1  
  5.  Local AS number : 65001  
  6.  Total number of peers : 2                Peers in established state : 2  
  7.    
  8.   Peer            V    AS  MsgRcvd  MsgSent  OutQ PrefRcv Up/Down  State  
  9.    
  10.   10.0.1.6        4 65002      246      315     0       1 03:58:23 Established  
  11.   10.40.4.1       4 65001       25       19     0       2 00:15:15 Established  
  12. [R1]      
  13.    
  14. (BGP连接隔了一两分钟才断开,可以通过重启进程)  
  15. %Aug 31 15:29:07:438 2012 R1 RM/3/RMLOG:  
  16.  BGP.: 10.40.4.1 State is changed from ESTABLISHED to IDLE.  
  17.    
  18. [R1]  
  19. [R1]  
  20. [R1]dis bgp peer  
  21.    
  22.  BGP local router ID : 10.30.1.1  
  23.  Local AS number : 65001  
  24.  Total number of peers : 2                Peers in established state : 1  
  25.    
  26.   Peer            V    AS  MsgRcvd  MsgSent  OutQ PrefRcv Up/Down  State  
  27.    
  28.   10.0.1.6        4 65002      250      320     0       1 04:02:01 Established  
  29.   10.40.4.1       4 65001        0        0     0       0 00:01:51 Active       

4.R4 ping 10.10.5.1 要带源ping,并且源是在BGP里发布了的10.40.4.1 ,否则不通,因为要保证对端有回来的路由。

  1. <R4>trace -a 10.40.4.1 10.10.5.1  
  2.  traceroute to 10.10.5.1(10.10.5.1) 30 hops max,40 bytes packet, press CTRL_C to break  
  3.  1  10.0.1.1 4294967291 ms 20 ms <1 ms  
  4.  2  10.0.1.6 10 ms 20 ms 20 ms  
  5.  3  10.10.5.1 30 ms 25 ms 5 ms  
  6.    
  7. <R5> trace -a 10.10.5.1 10.40.4.1  
  8.  traceroute to 10.40.4.1(10.40.4.1) 30 hops max,40 bytes packet, press CTRL_C to break  
  9. 1  10.0.1.26 30 ms 10.0.1.17 4 ms 10.0.1.26 15 ms  
  10.  2  10.0.1.14 15 ms 10.0.1.21 25 ms 10.0.1.14 21 ms  
  11.  3  10.40.4.1 14 ms 10 ms 35 ms  

5.修改路由信息属性来控制数据流方向

修改local-pre值,实现AS65002的业务网段去往10.30.1.1的主路径走R1-R2,去往10.40.4.1的主路径走R3-R4,使用Tracert命令测试。

1)local-pre该配在哪里?根据BGP的路由选路规则,R2,R3,R5去往10.30.1.1的路径都是R1-R2

现在只有:

  1. [R2]acl num 2003  
  2.  [R2-acl-basic-2003]rule 1 permit source 10.30.1.1 0.0.0.0  
  3. [R2-acl-basic-2003]q  
  4.    
  5. [R2]route-policy R1-R2 permit node 10  
  6. New Sequence of this List  
  7. [R2-route-policy]if-match acl 2003  
  8. [R2-route-policy]apply local-pre 200  
  9. [R2-route-policy]q  
  10.    
  11. [R2]bgp 65002  
  12. [R2-bgp]peer 10.0.1.5 route-policy R1-R2 import  
  13.    
  14. [R3]acl num 2003  
  15. [R3-acl-basic-2003]rule 1 permit source 10.40.4.1 0.0.0.0   
  16. [R3-acl-basic-2003]q  
  17.    
  18. [R3]route-policy R3-R4 permit node 10  
  19. New Sequence of this List  
  20. [R3-route-policy]if-match acl 2003  
  21. [R3-route-policy]apply ?  
  22.   as-path           Prepend the as-path string to the AS path  
  23.   comm-list         Set BGP community list (for deletion)  
  24.   community         BGP community attribute  
  25.   cost              Set cost of the matched route  
  26.   cost-type         Type of metric for destination routing protocol  
  27.   extcommunity      BGP extended community attribute  
  28.   ip-address        IP information  
  29.   ipv6              IPv6 Information   
  30.   isis              IS-IS routing protocol defined by ISO  
  31.   local-preference  BGP local preference  
  32.   mpls-label        Match MPLS label  
  33.   origin            BGP origin code   
  34.   preference        Give the Preference  (Route Preference)  
  35.   preferred-value   BGP Preferred-value (weight) for routing table  
  36.   tag               Set tag of route  
  37.    
  38. [R3-route-policy]apply local-pre 300  
  39. [R3-route-policy]q  
  40. [R3]bgp 65002  
  41. [R3-bgp]peer 10.0.1.9 route-policy R3-R4 ?  
  42.   export  Specify export policy  
  43.   import  Specify import policy  
  44.    
  45. [R3-bgp]peer 10.0.1.9 route-policy R3-R4 import  

修改后的效果:

  1. <R6>dis bgp rout  
  2.    
  3.  Total Number of Routes: 7  
  4.    
  5.  BGP Local router ID is 6.6.6.6   
  6.  Status codes: * - valid, > - best, d - damped,  
  7.                h - history,  i - internal, s - suppressed, S - Stale  
  8.                Origin : i - IGP, e - EGP, ? - incomplete  
  9.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  10.    
  11.    i 3.3.3.3/32         3.3.3.3         0          100        0       i  
  12.  * i 10.10.5.1/32       2.2.2.2         10         100        0       i  
  13.  * i                    3.3.3.3         20         100        0       i  
  14.  * i 10.10.6.1/32       3.3.3.3         10         100        0       i  
  15.  * i                    2.2.2.2         20         100        0       i  
  16.  *>i 10.30.1.1/32       2.2.2.2         0          200        0       65001i  
  17.  *>i 10.40.4.1/32       3.3.3.3         0          300        0       65001i  
  18.    
  19.    
  20. 6.<R2> dis bgp rout  
  21.    
  22.  Total Number of Routes: 8  
  23.    
  24.  BGP Local router ID is 2.2.2.2   
  25.  Status codes: * - valid, > - best, d - damped,  
  26.                h - history,  i - internal, s - suppressed, S - Stale  
  27.                Origin : i - IGP, e - EGP, ? - incomplete  
  28.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  29.    
  30.    i 3.3.3.3/32         3.3.3.3         0          100        0       i  
  31.  *>  10.10.5.1/32       0.0.0.0         10                    0       i  
  32.  * i                    3.3.3.3         20         100        0       i  
  33.  *>  10.10.6.1/32       0.0.0.0         20                    0       i  
  34.  *>                     0.0.0.0         20                    0       i  
  35.  * i                    3.3.3.3         10         100        0       i  
  36.  *>  10.30.1.1/32       10.0.1.5        0          200        0       65001i  
  37. *>i 10.40.4.1/32       3.3.3.3         0          100        0       65001i  

这里的i是指从本自治系统收到的。

疑问:为什么R2收不到来自R1发来的10.40.4.1这条路由?

R3也收不到来自R4发来的10.30.1.1这条路由?

原因是:原来配错了,导致R1与R4邻居建立不起来。

  1. [R3]dis bgp rout  
  2.    
  3.  Total Number of Routes: 10  
  4.    
  5.  BGP Local router ID is 3.3.3.3   
  6.  Status codes: * - valid, > - best, d - damped,  
  7.                h - history,  i - internal, s - suppressed, S - Stale  
  8.                Origin : i - IGP, e - EGP, ? - incomplete  
  9.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  10.    
  11.  *>  3.3.3.3/32         0.0.0.0         0                     0       i  
  12.  *>  10.10.5.1/32       0.0.0.0         20                    0       i  
  13.  *>                     0.0.0.0         20                    0       i  
  14.  * i                    2.2.2.2         10         100        0       i  
  15.  *>  10.10.6.1/32       0.0.0.0         10                    0       i  
  16.  * i                    2.2.2.2         20         100        0       i  
  17.  *>  10.30.1.1/32       10.0.1.9                              0       65001i  
  18.  * i                    2.2.2.2         0          100        0       65001i  
  19.  *>  10.40.4.1/32       10.0.1.9        0                     0       65001i  
  20.  * i                    2.2.2.2                    100        0       65001i  
  21.    
  22.    
  23. <R2>dis bgp rout  
  24.    
  25.  Total Number of Routes: 10  
  26.    
  27.  BGP Local router ID is 2.2.2.2   
  28.  Status codes: * - valid, > - best, d - damped,  
  29.                h - history,  i - internal, s - suppressed, S - Stale  
  30.                Origin : i - IGP, e - EGP, ? - incomplete  
  31.      Network            NextHop         MED        LocPrf     PrefVal Path/Ogn  
  32.    
  33.    i 3.3.3.3/32         3.3.3.3         0          100        0       i  
  34.  *>  10.10.5.1/32       0.0.0.0         10                    0       i  
  35.  * i                    3.3.3.3         20         100        0       i  
  36.  *>  10.10.6.1/32       0.0.0.0         20                    0       i  
  37.  *>                     0.0.0.0         20                    0       i  
  38.  * i                    3.3.3.3         10         100        0       i  
  39.  *>  10.30.1.1/32       10.0.1.5        0                     0       65001i  
  40.  * i                    3.3.3.3                    100        0       65001i  
  41.  *>  10.40.4.1/32       10.0.1.5                              0       65001i  
  42.  * i                    3.3.3.3         0          100        0       65001i  

2) 配置MED值

  1. [R2]acl num 2004  
  2. [R2-acl-basic-2004]rule 1 permit source   
  3. %Aug 31 22:04:15:00 2012 R2 RM/3/RMLOG:  
  4.  BGP.: 6.6.6.6 State is changed from OPENCONFIRM to ESTABLISHED.  
  5. 10.40.4.1 0.0.0.0   
  6. [R2-acl-basic-2004]q  
  7. [R2]  
  8. %Aug 31 22:04:35:968 2012 R2 RM/3/RMLOG:  
  9.  BGP.: 5.5.5.5 State is changed from OPENCONFIRM to ESTABLISHED.  
  10.    
  11. [R2]route-policy R3-R4 permit node 10  
  12. New Sequence of this List  
  13. [R2-route-policy]if-match acl 2004  
  14. [R2-route-policy]apply cost 100  
  15.    
  16. [R2]bgp 65002  
  17. [R2-bgp]peer 10.0.1.5 route-policy R3-R4 import  
  18.    
  19.    
  20. [R3]acl num 2004  
  21. [R3-acl-basic-2004]rule 1 permit source 10.30.1.1 0.0.0.0   
  22. [R3-acl-basic-2004]q  
  23. [R3]  
  24.    
  25. [R3]route-policy R3-R4 permit node 10  
  26. New Sequence of this List  
  27. [R3-route-policy]if-match acl 2004  
  28. [R3-route-policy]apply cost 100  
  29. [R3]bgp 65002  
  30. [R3-bgp]peer 10.0.1.5 route-policy R1-R2 import  

模拟器问题,敲下apply cost 100,自动关闭了路由器的模拟窗口?

只在各自上配一条就行了,相对提高值!

四、实验总结

小结:1.有些路由会显示本地优先级,有些不会,是因为没有发过来?

2.BGP发言者只将自己使用的路由(BGP路由表里的路由)发布给对等体.

3.只有在自己全局路由表里存在有的路由,才能通告BGP network 出去!

4.H3C MSR路由器默认关闭了同步,R3上从R5上收到了10.10.5.1的路由,会直接发给自己EBGP R4,由于R3所在区域配置了全互联,所以不会产生路由“黑洞”。

5.全局路由表里显示的直连网段下一跳是自己的出接口。

6.EBGP之间建邻居为什么用物理接口?IBGP之间建邻居为什么用loopback0接口?

7.断开R1、R4的连接关系、10.40.4.1 这条路由不会发给R1,因为防环机制,AS号重复了。

标签:

给我留言