CCNP配置实验之CCNP-BGP/MPLS VPN配置

企业动态
本文分步详细讲解了CCNP配置实验之CCNP-BGP/MPLS VPN配置实验,分为配置接口和IGP,定义VPN,配置PE-PE的路由会话,配置PE-CE的路由会话,配置CE路由器几部分。

为了进一步了解BGP/MPLS VPN,先搭建一个MPLS Lab。

 

简述CCNP配置实验步骤:
1、准备P-network
1.1配置接口和IGP
1.2定义VPN
1.3配置PE-PE的路由会话
1.4配置PE-CE的路由会话
2、配置CE路由器

下面详细讲解CCNP配置实验,CCNP-BGP/MPLS VPN配置步骤如下:

CCNP配置实验之一:准备P-network

1.1配置接口和IGP

  1. router P  
  2. !  
  3. ip cef  
  4. !  
  5. interface Loopback0 
  6. ip address 1.1.1.1 255.255.255.255 
  7. !  
  8. interface Serial1/0 
  9. ip unnumbered Loopback0 
  10. mpls ip  
  11. !  
  12. interface Serial1/1 
  13. ip unnumbered Loopback0 
  14. mpls  
  15. !  
  16. router ospf 1 
  17. log-adjacency-changes  
  18. network 1.1.1.1 0.0.0.0 area 0 
  19. Router PEA  
  20. !  
  21. ip cef  
  22. !  
  23. interface Loopback0 
  24. ip address 1.1.1.2 255.255.255.255 
  25. !  
  26. interface Serial1/1 
  27. ip unnumbered Loopback0 
  28. mpls ip  
  29. !  
  30. router ospf 1 
  31. log-adjacency-changes  
  32. network 1.1.1.2 0.0.0.0 area 0 
  33. Router PEB  
  34. !  
  35. ip cef  
  36. !  
  37. interface Loopback0 
  38. ip address 1.1.1.3 255.255.255.255 
  39. !  
  40. interface Serial1/0 
  41. ip unnumbered Loopback0 
  42. mpls ip  
  43. !  
  44. router ospf 1 
  45. log-adjacency-changes  
  46. network 1.1.1.3 0.0.0.0 area 0 

主要完成下列任务:
在全局模式打开赛虎CEF,CEF是运行MPLS所必须的;
配置相应的IP地址和完成IGP(OSPF)的配置;
在接口启用MPLS交换。

#p#

1.2在PE定义VPN

主要完成下列任务:
定义vrf,定义不同的vpn路由选择和转发实例;
用RD(Router Distinguisher)标识VPN,为用户VPN创建路由选择和转发表;
从或者向vpn扩展公用体导入导出路由选择信息;
把VRF和接口或子接口关联起来。

  1. Router PEA  
  2.  
  3. !  
  4. ip vrf vpn-a  
  5. rd 65001:1  
  6. route-target export 65001:1  
  7. route-target import 65001:1  
  8. !  
  9. ip vrf vpn-b  
  10. rd 65001:2  
  11. route-target export 65001:2  
  12. route-target import 65001:2  
  13.  
  14. interface Serial1/0  
  15. ip vrf forwarding vpn-a  
  16. ip address 172.16.3.1 255.255.255.0  
  17.  
  18. !  
  19. interface Serial1/2  
  20. ip vrf forwarding vpn-b  
  21. ip address 172.16.5.1 255.255.255.252  
  22.  
  23.  Router PEB  
  24.  
  25. !  
  26. ip vrf vpn-a  
  27. rd 65001:1  
  28. route-target export 65001:1  
  29. route-target import 65001:1  
  30. !  
  31. ip vrf vpn-b  
  32. rd 65001:2  
  33. route-target export 65001:2  
  34. route-target import 65001:2  
  35. !  
  36.  
  37. interface Serial1/1  
  38. ip vrf forwarding vpn-a  
  39. ip address 172.16.4.1 255.255.255.0  
  40. !  
  41. interface Serial1/2  
  42. ip vrf forwarding vpn-b  
  43. ip address 172.16.5.5 255.255.255.252  
  44.  

1.3配置PE-PE的路由会话

配置PE-PE的路由主要完成下列任务:
启用BGP;
关闭ipv4单播前缀的通告;
配置PE的邻居PE;
激活IPv4到邻居的通告。

  1. Router PEA  
  2. !  
  3. router bgp 4837  
  4. no bgp default ipv4-unicast  
  5. bgp log-neighbor-changes  
  6. neighbor 1.1.1.3 remote-as 4837  
  7. neighbor 1.1.1.3 update-source Loopback0  
  8. !  
  9. address-family vpnv4  
  10. neighbor 1.1.1.3 activate  
  11. neighbor 1.1.1.3 send-community extended  
  12. exit-address-family  
  13. !  
  14. Router PEB  
  15. !  
  16. router bgp 4837  
  17. no synchronization  
  18. bgp log-neighbor-changes  
  19. neighbor 1.1.1.2 remote-as 4837  
  20. neighbor 1.1.1.2 update-source Loopback0  
  21. no auto-summary  
  22. !  
  23. address-family vpnv4  
  24. neighbor 1.1.1.2 activate  
  25. neighbor 1.1.1.2 send-community extended  
  26. exit-address-family  

1.4配置BGP4的PE-CE的路由选择会话

  1. Router PEA  
  2.  
  3. !  
  4. router bgp 4837  
  5. no bgp default ipv4-unicast  
  6. bgp log-neighbor-changes  
  7. neighbor 1.1.1.3 remote-as 4837  
  8. neighbor 1.1.1.3 update-source Loopback0  
  9. !  
  10. address-family vpnv4  
  11. neighbor 1.1.1.3 activate  
  12. neighbor 1.1.1.3 send-community extended  
  13. exit-address-family  
  14. !  
  15. address-family ipv4 vrf vpn-b  
  16. neighbor 172.16.5.2 remote-as 65003  
  17. neighbor 172.16.5.2 activate  
  18. no synchronization  
  19. network 172.16.5.0 mask 255.255.255.252  
  20. exit-address-family  
  21. !  
  22. address-family ipv4 vrf vpn-a  
  23. neighbor 172.16.3.2 remote-as 65001  
  24. neighbor 172.16.3.2 activate  
  25. no synchronization  
  26. network 172.16.3.0 mask 255.255.255.0  
  27. exit-address-family  
  28.  
  29.  
  30. Router PEB  
  31.  
  32. router bgp 4837  
  33. no synchronization  
  34. bgp log-neighbor-changes  
  35. neighbor 1.1.1.2 remote-as 4837  
  36. neighbor 1.1.1.2 update-source Loopback0  
  37. no auto-summary  
  38. !  
  39. address-family vpnv4  
  40. neighbor 1.1.1.2 activate  
  41. neighbor 1.1.1.2 send-community extended  
  42. exit-address-family  
  43. !  
  44. address-family ipv4 vrf vpn-b  
  45. neighbor 172.16.5.6 remote-as 65004  
  46. neighbor 172.16.5.6 activate  
  47. no synchronization  
  48. network 172.16.5.4 mask 255.255.255.252  
  49. exit-address-family  
  50. !  
  51. address-family ipv4 vrf vpn-a  
  52. neighbor 172.16.4.2 remote-as 65002  
  53. neighbor 172.16.4.2 activate  
  54. no synchronization  
  55. network 172.16.4.0 mask 255.255.255.0  
  56. exit-address-family  

#p#

CCNP配置实验之二:配置CE路由器

  1. Router CED  
  2.  
  3. !  
  4. interface Loopback0  
  5. ip address 192.168.100.1 255.255.255.0  
  6. !  
  7. interface Serial1/0  
  8. ip address 172.16.5.6 255.255.255.252  
  9. !  
  10.  
  11. router bgp 65004  
  12. bgp log-neighbor-changes  
  13. neighbor 172.16.5.5 remote-as 4837  
  14. !  
  15. address-family ipv4  
  16. neighbor 172.16.5.5 activate  
  17. no auto-summary  
  18. no synchronization  
  19. network 192.168.100.0  
  20. exit-address-family  
  21. !  
  22.  
  23. Router CEC  
  24.  
  25. !  
  26. interface Loopback0  
  27. ip address 192.168.10.1 255.255.255.0  
  28. !  
  29. interface Serial1/1  
  30. ip address 172.16.5.2 255.255.255.252  
  31.  
  32. !  
  33. router bgp 65003  
  34. bgp log-neighbor-changes  
  35. neighbor 172.16.5.1 remote-as 4837  
  36. !  
  37. address-family ipv4  
  38. neighbor 172.16.5.1 activate  
  39. no auto-summary  
  40. no synchronization  
  41. network 192.168.10.0  
  42. exit-address-family  
  43. !  
  44.  
  45. Router CEA  
  46. !  
  47. interface Loopback0  
  48. ip address 10.10.0.1 255.255.0.0  
  49. !  
  50. interface Serial1/1  
  51. ip address 172.16.3.2 255.255.255.0  
  52.  
  53. !  
  54. router bgp 65001  
  55. no synchronization  
  56. bgp log-neighbor-changes  
  57. network 10.10.0.0 mask 255.255.0.0  
  58. neighbor 172.16.3.1 remote-as 4837  
  59. no auto-summary  
  60. !  
  61.  
  62. Router CEB  
  63.  
  64. !  
  65. interface Loopback0  
  66. ip address 10.20.0.1 255.255.0.0  
  67. !  
  68. interface Loopback1  
  69. ip address 10.40.0.1 255.255.0.0  
  70. !  
  71. interface Serial1/0  
  72. ip address 172.16.4.2 255.255.255.0  
  73. !  
  74. router bgp 65002  
  75. no synchronization  
  76. bgp log-neighbor-changes  
  77. network 10.20.0.0 mask 255.255.0.0  
  78. network 10.40.0.0 mask 255.255.0.0  
  79. neighbor 172.16.4.1 remote-as 4837  
  80. no auto-summary  

CCNP配置实验结果验证:

  1. CEA#   show ip route  
  2. Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP  
  3.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  4.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  5.        E1 - OSPF external type 1, E2 - OSPF external type 2  
  6.        i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2  
  7.        ia - IS-IS inter area, * - candidate default, U - per-user static route  
  8.        o - ODR, P - periodic downloaded static route  
  9.  
  10. Gateway of last resort is not set  
  11.  
  12.      172.16.0.0/24 is subnetted, 2 subnets  
  13. B       172.16.4.0 [20/0] via 172.16.3.1, 00:06:50  
  14. C       172.16.3.0 is directly connected, Serial1/1  
  15.      10.0.0.0/16 is subnetted, 3 subnets  
  16. C       10.10.0.0 is directly connected, Loopback0  
  17. B       10.20.0.0 [20/0] via 172.16.3.1, 00:06:50  
  18. B       10.40.0.0 [20/0] via 172.16.3.1, 00:06:50  
  19. CEA#  
  20.  
  21. CEA#ping ip  
  22. Target IP address: 10.40.0.1  
  23. Repeat count [5]:  
  24. Datagram size [100]:  
  25. Timeout in seconds [2]: 10  
  26. Extended commands [n]:  
  27. Sweep range of sizes [n]:  
  28. Type escape sequence to abort.  
  29. Sending 5, 100-byte ICMP Echos to 10.40.0.1, timeout is 10 seconds:  
  30. !!!!!  
  31. Success rate is 100 percent (5/5), round-trip min/avg/max = 1400/2528/4192 ms  
  32. CEA#  
  33.  
  34. CEC# show ip route  
  35. Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP  
  36.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  37.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  38.        E1 - OSPF external type 1, E2 - OSPF external type 2  
  39.        i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-  
  40.        ia - IS-IS inter area, * - candidate default, U - per-user static ro  
  41.        o - ODR, P - periodic downloaded static route  
  42.  
  43. Gateway of last resort is not set  
  44.  
  45. C    192.168.10.0/24 is directly connected, Loopback0  
  46.      172.16.0.0/30 is subnetted, 2 subnets  
  47. C       172.16.5.0 is directly connected, Serial1/1  
  48. B       172.16.5.4 [20/0] via 172.16.5.1, 00:09:20  
  49. B    192.168.100.0/24 [20/0] via 172.16.5.1, 00:09:20  
  50. CEC#  
  51.  
  52. CEC#ping ip  
  53. Target IP address: 192.168.100.1  
  54. Repeat count [5]:  
  55. Datagram size [100]:  
  56. Timeout in seconds [2]: 10  
  57. Extended commands [n]:  
  58. Sweep range of sizes [n]:  
  59. Type escape sequence to abort.  
  60. Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 10 seconds:  
  61. !!!!.  
  62. Success rate is 80 percent (4/5), round-trip min/avg/max = 1256/1972/3144 ms  
  63. CEC# 

Comment:

终于在我的小本上实现了CCNP配置实验之BGP/MPLS VPN,算是先僵化吧,当然还要继续固化,最后才有可能优化。

【编辑推荐】

  1. 思科老师对所有思科认证CCNP学习者的几点建议
  2. 思科认证CCNP实验:GRE隧道流量的IPSEC加密
  3. 思科认证CCNP实验设备配置介绍和注意事项
责任编辑:佚名 来源: 56cto
相关推荐

2009-08-19 14:36:58

思科认证CCNP

2011-08-16 11:37:27

EIGRP带宽

2009-05-05 10:39:10

CCNP数据包路由

2010-06-29 09:58:42

CCIE K4

2009-06-29 09:08:03

CCNP综合实验

2009-05-12 10:36:47

CCNPBGP协议揭秘

2009-05-13 10:50:59

CCNPHSRP路由

2009-12-17 16:15:00

CCNP学习笔记

2012-01-04 10:32:09

2009-11-24 14:42:00

CCNP实验

2009-12-08 10:34:00

2010-02-24 16:06:28

CCNP Lab

2009-09-10 18:07:20

CCNP认证介绍

2009-11-24 15:03:00

CCNP642-892考试

2009-11-02 15:24:07

CCNP真实考试实验题

2009-07-16 09:45:03

CCNPbgp路由

2010-03-26 09:42:09

CCNP

2009-10-15 11:55:57

CCIE实验

2009-08-25 17:12:33

思科认证CCNP

2009-12-31 10:28:20

VPN配置实例
点赞
收藏

51CTO技术栈公众号