A-A+

ccnp认证考试知识:IBGP和EBGP邻居关系的建立和验证

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

在学习CCNP各种知识和力图通过认证考试的努力中,花一些精力来了解IBGP和EBGP的配置和验证是必须的。实话实说,BGP的组网实验真的不好弄,不过为了成为一名优秀的思科认证网络工程师,一切汗水和付出都是值得的。
拓扑很简单,4台路由器,R1,R2和R3在同一个AS1中,R4在AS2中其中R1和R2是IBGP邻居关系,R2和R3运行OSPF。R3和R4是EBGP邻居关系。

  1. r1:  
  2. in e1/0  
  3. ip add 192.168.1.1 255.255.255.0  
  4. no sh  
  5. ip route 0.0.0.0 0.0.0.0 192.168.1.2  
  6. router bgp 1  
  7. nei 192.168.2.2 remote-as 1  
  8. net 192.168.1.0  
  9. r2:  
  10. in e1/0  
  11. ip add 192.168.1.2 255.255.255.0  
  12. no sh  
  13. ip ospf 1 a 0  
  14. in e1/1  
  15. ip add 192.168.2.1 255.255.255.0  
  16. no sh  
  17. ip ospf 1 a 0  
  18. r3:  
  19. in e1/0  
  20. ip add 192.168.2.2 255.255.255.0  
  21. no sh  
  22. ip ospf 1 a 0  
  23. in e1/1  
  24. ip add 192.168.3.1 255.255.255.0  
  25. no sh  
  26. router bgp 1  
  27. nei 192.168.1.1 remote-as 1  
  28. nei 192.168.3.2 remote-as 2  
  29. net 192.168.3.0  
  30. r4:  
  31. in e1/0  
  32. ip add 192.168.3.2 255.255.255.0  
  33. http://www.xiaoxiongboke.com   
  34. no sh  
  35. router bgp 2  
  36. nei 192.168.3.1 remote-as 1  
  37. net 192.168.3.0  

BGP是运行在运营商与运营商之间的路由协议,BGP维护着全INTERNET的路由,所以其路由条目是很多的。其复杂性也很强。废话不多说,解释一下配置的重点。

配置的重点在于R3,R3定义了IBGP邻居R1和EBGP邻居R4,是通过nei 192.168.1.1 remote-as 1定义了IBGP邻居,通过nei 192.168.3.2 remote-as 2定义了EBGP邻居。注意无论是要形成IBGP邻居还是EBGP都要有前往邻居的路由才能够形成邻居,所以我在R1和R4上各定义了一条默认路由。BGP是通过TCP端口179传输BGP消息。
验证命令:

show ip bgp 验证BGP路由,只有通过network命令定义了才会有show ip bgp sum 验证BGP邻居状态,状态不能为IDLE和ACTIVE,是数字就正常的show ip rou

下面是一个输出示例:

  1. R1#show ip bgp sum  
  2. BGP router identifier 1.1.1.1, local AS number 1  
  3. BGP table version is 3, main routing table version 3  
  4. 2 network entries using 234 bytes of memory  
  5. 2 path entries using 104 bytes of memory  
  6. 3/2 BGP path/bestpath attribute entries using 372 bytes of memory   
  7. 0 BGP route-map cache entries using 0 bytes of memory  
  8. 0 BGP filter-list cache entries using 0 bytes of memory  
  9. BGP using 710 total bytes of memory  
  10. BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs  
  11.   
  12. Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd  
  13. 192.168.2.2     4     1      42      42        3    0    0 00:38:09        1  

R1形成了一个邻居关系,再看看R3的

  1. R3#show ip bgp sum  
  2. BGP router identifier 192.168.3.1, local AS number 1  
  3. BGP table version is 4, main routing table version 4  
  4. 2 network entries using 234 bytes of memory  
  5. 3 path entries using 156 bytes of memory  
  6. 4/2 BGP path/bestpath attribute entries using 496 bytes of memory   
  7. 1 BGP AS-PATH entries using 24 bytes of memory  
  8. 0 BGP route-map cache entries using 0 bytes of memory  
  9. 0 BGP filter-list cache entries using 0 bytes of memory  
  10. BGP using 910 total bytes of memory  
  11. BGP activity 2/0 prefixes, 3/0 paths, scan interval 60 secs  
  12.   
  13. Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd  
  14. 192.168.1.1     4     1      45      45        4    0    0 00:41:20        1  
  15. 192.168.3.2     4     2      45      46        4    0    0 00:40:41        1  
  16.   
  17. R1#show ip bgp sum   
  18. BGP router identifier 1.1.1.1, local AS number 1  
  19. BGP table version is 3, main routing table version 3  
  20. 2 network entries using 234 bytes of memory  
  21. 2 path entries using 104 bytes of memory  
  22. 3/2 BGP path/bestpath attribute entries using 372 bytes of memory  
  23. 0 BGP route-map cache entries using 0 bytes of memory  
  24. 0 BGP filter-list cache entries using 0 bytes of memory  
  25. BGP using 710 total bytes of memory  
  26. BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs  
  27.   
  28. Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd  
  29. 192.168.2.2     4     1      42      42        3    0    0 00:38:09        1  
  30. R1#  
  31. R1#show ip bgp  
  32. BGP table version is 3, local router ID is 1.1.1.1   
  33. Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,  
  34.               r RIB-failure, S Stale  
  35. Origin codes: i - IGP, e - EGP, ? - incomplete  
  36.    Network          Next Hop            Metric LocPrf Weight Path  
  37. *> 192.168.1.0      0.0.0.0                  0         32768 i  
  38. *>i192.168.3.0      192.168.2.2              0    100      0 i  
  39. R1#show ip ro  
  40. Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP  
  41.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area   
  42.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  43.        E1 - OSPF external type 1, E2 - OSPF external type 2  
  44.        i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2  
  45.        ia - IS-IS inter area, * - candidate default, U - per-user static route  
  46.        o - ODR, P - periodic downloaded static route  
  47. Gateway of last resort is 192.168.1.2 to network 0.0.0.0  
  48.   
  49. C    1.0.0.0/8 is directly connected, Loopback1  
  50. C    192.168.1.0/24 is directly connected, Ethernet1/0  
  51. B    192.168.3.0/24 [200/0] via 192.168.2.2, 00:39:36  
  52. S*   0.0.0.0/0 [1/0] via 192.168.1.2  

这些就是这次要完成的ccnp基础网络知识。在建立ebgp和ibgp的邻居关系之后,进一步的进行验证的全过程。

标签:

给我留言