当前位置:   article > 正文

华为配置BGP/MPLS IP VPN示例

华为配置BGP/MPLS IP VPN示例

配置BGP/MPLS IP VPN示例

组网图形

图1 BGP/MPLS IP VPN组网图
 

  • BGP/MPLS IP VPN简介
  • 配置注意事项
  • 组网需求
  • 配置思路
  • 操作步骤
  • 配置文件

BGP/MPLS IP VPN简介

BGP/MPLS IP VPN是一种基于MPLS的L3VPN,组网方式灵活,可扩展性好,支持大规模部署。新增一个站点时,只需要修改提供该站点业务的边缘节点的配置。

BGP/MPLS IP VPN适用于位于不同地理位置的公司总部和分支之间需要相互通信的场景,由于通信数据需要穿越运营商的骨干网,可以使用BGP在骨干网上发布VPN路由,使用MPLS在骨干网上转发VPN报文;由于公司内部各个部门之间需要相互隔离,可以通过该功能实现不同VPN之间的路由隔离、地址空间隔离和访问隔离。

配置注意事项
  • 本举例适用的产品和版本包括:
    • S5700-HI、S5710-EI:V200R002C00及后续版本
    • S5720-EI:V200R009C00及后续版本
    • S5720-HI:V200R007C10及后续版本
    • S5710-HI、S5730-HI、S5731-H、S5731-H-K、S5731S-H、S5732-H、S5732-H-K:适用版本请参见“案例适用的产品和版本说明”中的表1
    • S5731-S、S6730-S:V200R022C00及后续版本
    • S6700-EI:V200R005(C00&C01)
    • S6720-EI、S6720S-EI、S6720-HI、S6730-H、S6730-H-K、S6730S-H:适用版本请参见“案例适用的产品和版本说明”中的表1
    • S7703、S7706、S7712、S7703 PoE、S7706 PoE、S7710、S7905、S7908、S9703、S9706、S9712:适用版本请参见“案例适用的产品和版本说明”中的表1
  • SA系列单板、E3L系列单板不支持BGP/MPLS IP VPN功能,X1E系列单板在V200R006C00版本及后续版本支持BGP/MPLS IP VPN功能。

如需了解交换机软件配套详细信息,请点击Info-Finder,在选择产品系列或产品型号后,在“硬件中心”进行查询。

S5731-L和S5731S-L属于远端模块,不支持Web管理、YANG和命令行,仅支持通过中心交换机对其下发配置,相关操作请参见《S300, S500, S2700, S5700, S6700 V200R022C00 配置指南-设备管理》中的“智能极简园区网络配置(小行星方案)”。

组网需求

图1所示:

  • CE1连接公司总部研发区、CE3连接分支机构研发区,CE1和CE3属于vpna;
  • CE2连接公司总部非研发区、CE4连接分支机构非研发区,CE2和CE4属于vpnb。

公司要求通过部署BGP/MPLS IP VPN,实现总部和分支机构的安全互通,同时要求研发区和非研发区间数据隔离。

配置思路

采用如下的思路配置BGP/MPLS IP VPN:

  1. P、PE之间配置OSPF,实现骨干网的IP连通性。
  2. PE、P上配置MPLS基本能力和MPLS LDP,建立MPLS LSP公网隧道,传输VPN数据。
  3. PE1和PE2之间配置MP-IBGP,交换VPN路由信息。
  4. PE1和PE2上配置VPN实例,其中,vpna使用的VPN-target属性为111:1,vpnb使用的VPN-target属性为222:2,以实现相同VPN间互通,不同VPN间隔离。同时,与CE相连的接口和相应的VPN实例绑定,以接入VPN用户。
  5. CE与PE之间配置EBGP,交换VPN路由信息。

操作步骤
  1. 在MPLS骨干网上配置IGP协议,实现骨干网PE和P的互通

    1. # 配置PE1
    2. <HUAWEI> system-view
    3. [HUAWEI] sysname PE1
    4. [PE1] interface loopback 1
    5. [PE1-LoopBack1] ip address 1.1.1.9 32
    6. [PE1-LoopBack1] quit
    7. [PE1] vlan batch 10 20 30
    8. [PE1] interface gigabitethernet 1/0/0
    9. [PE1-GigabitEthernet1/0/0] port link-type trunk
    10. [PE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10
    11. [PE1-GigabitEthernet1/0/0] quit
    12. [PE1] interface gigabitethernet 2/0/0
    13. [PE1-GigabitEthernet2/0/0] port link-type trunk
    14. [PE1-GigabitEthernet2/0/0] port trunk allow-pass vlan 20
    15. [PE1-GigabitEthernet2/0/0] quit
    16. [PE1] interface gigabitethernet 3/0/0
    17. [PE1-GigabitEthernet3/0/0] port link-type trunk
    18. [PE1-GigabitEthernet3/0/0] port trunk allow-pass vlan 30
    19. [PE1-GigabitEthernet3/0/0] quit
    20. [PE1] interface vlanif 30
    21. [PE1-Vlanif30] ip address 172.1.1.1 24
    22. [PE1-Vlanif30] quit
    23. [PE1] ospf 1 router-id 1.1.1.9
    24. [PE1-ospf-1] area 0
    25. [PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
    26. [PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
    27. [PE1-ospf-1-area-0.0.0.0] quit
    28. [PE1-ospf-1] quit
    29. # 配置P。
    30. <HUAWEI> system-view
    31. [HUAWEI] sysname P
    32. [P] interface loopback 1
    33. [P-LoopBack1] ip address 2.2.2.9 32
    34. [P-LoopBack1] quit
    35. [P] vlan batch 30 60
    36. [P] interface gigabitethernet 1/0/0
    37. [P-GigabitEthernet1/0/0] port link-type trunk
    38. [P-GigabitEthernet1/0/0] port trunk allow-pass vlan 30
    39. [P-GigabitEthernet1/0/0] quit
    40. [P] interface gigabitethernet 2/0/0
    41. [P-GigabitEthernet2/0/0] port link-type trunk
    42. [P-GigabitEthernet2/0/0] port trunk allow-pass vlan 60
    43. [P-GigabitEthernet2/0/0] quit
    44. [P] interface vlanif 30
    45. [P-Vlanif30] ip address 172.1.1.2 24
    46. [P-Vlanif30] quit
    47. [P] interface vlanif 60
    48. [P-Vlanif60] ip address 172.2.1.1 24
    49. [P-Vlanif60] quit
    50. [P] ospf 1 router-id 2.2.2.9
    51. [P-ospf-1] area 0
    52. [P-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
    53. [P-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
    54. [P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
    55. [P-ospf-1-area-0.0.0.0] quit
    56. [P-ospf-1] quit
    57. # 配置PE2
    58. <HUAWEI> system-view
    59. [HUAWEI] sysname PE2
    60. [PE2] interface loopback 1
    61. [PE2-LoopBack1] ip address 3.3.3.9 32
    62. [PE2-LoopBack1] quit
    63. [PE2] vlan batch 40 50 60
    64. [PE2] interface gigabitethernet 1/0/0
    65. [PE2-GigabitEthernet1/0/0] port link-type trunk
    66. [PE2-GigabitEthernet1/0/0] port trunk allow-pass vlan 40
    67. [PE2-GigabitEthernet1/0/0] quit
    68. [PE2] interface gigabitethernet 2/0/0
    69. [PE2-GigabitEthernet2/0/0] port link-type trunk
    70. [PE2-GigabitEthernet2/0/0] port trunk allow-pass vlan 50
    71. [PE2-GigabitEthernet2/0/0] quit
    72. [PE2] interface gigabitethernet 3/0/0
    73. [PE2-GigabitEthernet3/0/0] port link-type trunk
    74. [PE2-GigabitEthernet3/0/0] port trunk allow-pass vlan 60
    75. [PE2-GigabitEthernet3/0/0] quit
    76. [PE2] interface vlanif 60
    77. [PE2-Vlanif60] ip address 172.2.1.2 24
    78. [PE2-Vlanif60] quit
    79. [PE2] ospf 1 router-id 3.3.3.9
    80. [PE2-ospf-1] area 0
    81. [PE2-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
    82. [PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
    83. [PE2-ospf-1-area-0.0.0.0] quit
    84. [PE2-ospf-1] quit

    配置完成后,PE1和P、P和PE2之间应能建立OSPF邻居关系,执行display ospf peer命令可以看到邻居状态为Full。执行display ip routing-table命令可以看到PE之间学习到对方的Loopback1路由。

    以PE1的显示为例:

    1. [PE1] display ip routing-table
    2. Route Flags: R - relay, D - download to fib, T - to vpn-instance
    3. ------------------------------------------------------------------------------
    4. Routing Tables: Public
    5. Destinations : 8 Routes : 8
    6. Destination/Mask Proto Pre Cost Flags NextHop Interface
    7. 1.1.1.9/32 Direct 0 0 D 127.0.0.1 LoopBack1
    8. 2.2.2.9/32 OSPF 10 1 D 172.1.1.2 Vlanif30
    9. 3.3.3.9/32 OSPF 10 2 D 172.1.1.2 Vlanif30
    10. 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
    11. 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
    12. 172.1.1.0/24 Direct 0 0 D 172.1.1.1 Vlanif30
    13. 172.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
    14. 172.2.1.0/24 OSPF 10 2 D 172.1.1.2 Vlanif30
    15. [PE1] display ospf peer
    16. OSPF Process 1 with Router ID 1.1.1.9
    17. Neighbors
    18. Area 0.0.0.0 interface 172.1.1.1(Vlanif30)'s neighbors
    19. Router ID: 2.2.2.9 Address: 172.1.1.2
    20. State: Full Mode:Nbr is Master Priority: 1
    21. DR: 172.1.1.2 BDR: 172.1.1.1 MTU: 0
    22. Dead timer due in 37 sec
    23. Retrans timer interval: 5
    24. Neighbor is up for 00:16:21
    25. Authentication Sequence: [ 0 ]

  2. 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP

    1. [PE1] mpls lsr-id 1.1.1.9
    2. [PE1] mpls
    3. [PE1-mpls] quit
    4. [PE1] mpls ldp
    5. [PE1-mpls-ldp] quit
    6. [PE1] interface vlanif 30
    7. [PE1-Vlanif30] mpls
    8. [PE1-Vlanif30] mpls ldp
    9. [PE1-Vlanif30] quit
    10. [P] mpls lsr-id 2.2.2.9
    11. [P] mpls
    12. [P-mpls] quit
    13. [P] mpls ldp
    14. [P-mpls-ldp] quit
    15. [P] interface vlanif 30
    16. [P-Vlanif30] mpls
    17. [P-Vlanif30] mpls ldp
    18. [P-Vlanif30] quit
    19. [P] interface vlanif 60
    20. [P-Vlanif60] mpls
    21. [P-Vlanif60] mpls ldp
    22. [P-Vlanif60] quit
    23. [PE2] mpls lsr-id 3.3.3.9
    24. [PE2] mpls
    25. [PE2-mpls] quit
    26. [PE2] mpls ldp
    27. [PE2-mpls-ldp] quit
    28. [PE2] interface vlanif 60
    29. [PE2-Vlanif60] mpls
    30. [PE2-Vlanif60] mpls ldp
    31. [PE2-Vlanif60] quit
    32. [PE1] display mpls ldp session
    33. LDP Session(s) in Public Network
    34. Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
    35. A '*' before a session means the session is being deleted.
    36. ------------------------------------------------------------------------------
    37. PeerID Status LAM SsnRole SsnAge KASent/Rcv
    38. ------------------------------------------------------------------------------
    39. 2.2.2.9:0 Operational DU Passive 0000:00:01 6/6
    40. ------------------------------------------------------------------------------
    41. TOTAL: 1 session(s) Found.
    42. [PE1] display mpls ldp lsp
    43. LDP LSP Information
    44. -------------------------------------------------------------------------------
    45. Flag after Out IF: (I) - LSP Is Only Iterated by RLFA
    46. -------------------------------------------------------------------------------
    47. DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
    48. -------------------------------------------------------------------------------
    49. 1.1.1.9/32 3/NULL 2.2.2.9 127.0.0.1 InLoop0
    50. *1.1.1.9/32 Liberal/1024 DS/2.2.2.9
    51. 2.2.2.9/32 NULL/3 - 172.1.1.2 Vlanif30
    52. 2.2.2.9/32 1024/3 2.2.2.9 172.1.1.2 Vlanif30
    53. 3.3.3.9/32 NULL/1025 - 172.1.1.2 Vlanif30
    54. 3.3.3.9/32 1025/1025 2.2.2.9 172.1.1.2 Vlanif30
    55. -------------------------------------------------------------------------------
    56. TOTAL: 5 Normal LSP(s) Found.
    57. TOTAL: 1 Liberal LSP(s) Found.
    58. TOTAL: 0 Frr LSP(s) Found.
    59. A '*' before an LSP means the LSP is not established
    60. A '*' before a Label means the USCB or DSCB is stale
    61. A '*' before a UpstreamPeer means the session is stale
    62. A '*' before a DS means the session is stale
    63. A '*' before a NextHop means the LSP is FRR LSP
    64. PE设备上配置VPN实例,将CE接入PE
    65. [PE1] ip vpn-instance vpna
    66. [PE1-vpn-instance-vpna] route-distinguisher 100:1
    67. [PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
    68. [PE1-vpn-instance-vpna-af-ipv4] quit
    69. [PE1-vpn-instance-vpna] quit
    70. [PE1] ip vpn-instance vpnb
    71. [PE1-vpn-instance-vpnb] route-distinguisher 100:2
    72. [PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
    73. [PE1-vpn-instance-vpnb-af-ipv4] quit
    74. [PE1-vpn-instance-vpnb] quit
    75. [PE1] interface vlanif 10
    76. [PE1-Vlanif10] ip binding vpn-instance vpna
    77. [PE1-Vlanif10] ip address 10.1.1.2 24
    78. [PE1-Vlanif10] quit
    79. [PE1] interface vlanif 20
    80. [PE1-Vlanif20] ip binding vpn-instance vpnb
    81. [PE1-Vlanif20] ip address 10.2.1.2 24
    82. [PE1-Vlanif20] quit
    83. [PE2] ip vpn-instance vpna
    84. [PE2-vpn-instance-vpna] route-distinguisher 200:1
    85. [PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
    86. [PE2-vpn-instance-vpna-af-ipv4] quit
    87. [PE2-vpn-instance-vpna] quit
    88. [PE2] ip vpn-instance vpnb
    89. [PE2-vpn-instance-vpnb] route-distinguisher 200:2
    90. [PE2-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
    91. [PE2-vpn-instance-vpnb-af-ipv4] quit
    92. [PE2-vpn-instance-vpnb] quit
    93. [PE2] interface vlanif 40
    94. [PE2-Vlanif40] ip binding vpn-instance vpna
    95. [PE2-Vlanif40] ip address 10.3.1.2 24
    96. [PE2-Vlanif40] quit
    97. [PE2] interface vlanif 50
    98. [PE2-Vlanif50] ip binding vpn-instance vpnb
    99. [PE2-Vlanif50] ip address 10.4.1.2 24
    100. [PE2-Vlanif50] quit
    101. <HUAWEI> system-view
    102. [HUAWEI] sysname CE1
    103. [CE1] vlan batch 10
    104. [CE1] interface gigabitethernet 1/0/0
    105. [CE1-GigabitEthernet1/0/0] port link-type trunk
    106. [CE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10
    107. [CE1-GigabitEthernet1/0/0] quit
    108. [CE1] interface vlanif 10
    109. [CE1-Vlanif10] ip address 10.1.1.1 24
    110. [CE1-Vlanif10] quit

  3. 配置完成后,在PE设备上执行display ip vpn-instance verbose命令可以看到VPN实例的配置情况。各PE能ping通自己接入的CE。

    当PE上有多个接口绑定了同一个VPN,则使用ping -vpn-instance命令ping对端PE接入的CE时,要指定源IP地址,即要指定ping -vpn-instance vpn-instance-name -a source-ip-address dest-ip-address命令中的参数-a source-ip-address,否则可能ping不通。

    1. PE1为例:
    2. [PE1] display ip vpn-instance verbose
    3. Total VPN-Instances configured : 2
    4. Total IPv4 VPN-Instances configured : 2
    5. Total IPv6 VPN-Instances configured : 0
    6. VPN-Instance Name and ID : vpna, 1
    7. Interfaces : Vlanif10
    8. Address family ipv4
    9. Create date : 2014-11-03 02:39:34+00:00
    10. Up time : 0 days, 22 hours, 24 minutes and 53 seconds
    11. Route Distinguisher : 100:1
    12. Export VPN Targets : 111:1
    13. Import VPN Targets : 111:1
    14. Label Policy : label per instance
    15. Per-Instance Label : 4098
    16. Log Interval : 5
    17. VPN-Instance Name and ID : vpnb, 2
    18. Interfaces : Vlanif20
    19. Address family ipv4
    20. Create date : 2014-11-03 02:39:34+00:00
    21. Up time : 0 days, 22 hours, 24 minutes and 53 seconds
    22. Route Distinguisher : 100:2
    23. Export VPN Targets : 222:2
    24. Import VPN Targets : 222:2
    25. Label Policy : label per instance
    26. Per-Instance Label : 4098
    27. Log Interval : 5
    28. [PE1] ping -vpn-instance vpna 10.1.1.1
    29. PING 10.1.1.1: 56 data bytes, press CTRL_C to break
    30. Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=5 ms
    31. Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=3 ms
    32. Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=3 ms
    33. Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=3 ms
    34. Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=16 ms
    35. --- 10.1.1.1 ping statistics ---
    36. 5 packet(s) transmitted
    37. 5 packet(s) received
    38. 0.00% packet loss
    39. round-trip min/avg/max = 3/6/16 ms

  4. 在PE与CE之间建立EBGP对等体关系,引入VPN路由

    1. # 配置连接公司总部研发区的CE1CE2CE3CE4的配置与CE1类似,详见配置文件。
    2. [CE1] bgp 65410
    3. [CE1-bgp] peer 10.1.1.2 as-number 100
    4. [CE1-bgp] import-route direct
    5. [CE1-bgp] quit
    6. # 配置PE1PE2的配置与PE1类似,详见配置文件。
    7. [PE1] bgp 100
    8. [PE1-bgp] ipv4-family vpn-instance vpna
    9. [PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
    10. [PE1-bgp-vpna] import-route direct
    11. [PE1-bgp-vpna] quit
    12. [PE1-bgp] ipv4-family vpn-instance vpnb
    13. [PE1-bgp-vpnb] peer 10.2.1.1 as-number 65420
    14. [PE1-bgp-vpnb] import-route direct
    15. [PE1-bgp-vpnb] quit
    16. [PE1-bgp] quit
    17. 配置完成后,在PE设备上执行display bgp vpnv4 vpn-instance peer命令,可以看到PECE之间的BGP对等体关系已建立,并达到Established状态。
    18. PE1CE1的对等体关系为例:
    19. [PE1] display bgp vpnv4 vpn-instance vpna peer
    20. BGP local router ID : 1.1.1.9
    21. Local AS number : 100
    22. VPN-Instance vpna, Router ID 1.1.1.9:
    23. Total number of peers : 1 Peers in established state : 1
    24. Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
    25. 10.1.1.1 4 65410 11 9 0 00:07:25 Established 1

  5. 在PE之间建立MP-IBGP对等体关系

    1. # 配置PE1
    2. [PE1] bgp 100
    3. [PE1-bgp] peer 3.3.3.9 as-number 100
    4. [PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
    5. [PE1-bgp] ipv4-family vpnv4
    6. [PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
    7. [PE1-bgp-af-vpnv4] quit
    8. [PE1-bgp] quit
    9. # 配置PE2
    10. [PE2] bgp 100
    11. [PE2-bgp] peer 1.1.1.9 as-number 100
    12. [PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
    13. [PE2-bgp] ipv4-family vpnv4
    14. [PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
    15. [PE2-bgp-af-vpnv4] quit
    16. [PE2-bgp] quit
    17. 配置完成后,在PE设备上执行display bgp peer或display bgp vpnv4 all peer命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。
    18. [PE1] display bgp peer
    19. BGP local router ID : 1.1.1.9
    20. Local AS number : 100
    21. Total number of peers : 1 Peers in established state : 1
    22. Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
    23. 3.3.3.9 4 100 12 6 0 00:02:21 Established 0
    24. [PE1] display bgp vpnv4 all peer
    25. BGP local router ID : 1.1.1.9
    26. Local AS number : 100
    27. Total number of peers : 3 Peers in established state : 3
    28. Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
    29. 3.3.3.9 4 100 12 18 0 00:09:38 Established 0
    30. Peer of IPv4-family for vpn instance :
    31. VPN-Instance vpna, Router ID 1.1.1.9:
    32. 10.1.1.1 4 65410 25 25 0 00:17:57 Established 1
    33. VPN-Instance vpnb, Router ID 1.1.1.9:
    34. 10.2.1.1 4 65420 21 22 0 00:17:10 Established 1

  6. 检查配置结果
    1. PE设备上执行display ip routing-table vpn-instance命令,可以看到去往对端CE的路由。
    2. PE1的显示为例:
    3. [PE1] display ip routing-table vpn-instance vpna
    4. Route Flags: R - relay, D - download to fib, T - to vpn-instance
    5. ------------------------------------------------------------------------------
    6. Routing Tables: vpna
    7. Destinations : 3 Routes : 3
    8. Destination/Mask Proto Pre Cost Flags NextHop Interface
    9. 10.1.1.0/24 Direct 0 0 D 10.1.1.2 Vlanif10
    10. 10.1.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif10
    11. 10.3.1.0/24 IBGP 255 0 RD 3.3.3.9 Vlanif30
    12. [PE1] display ip routing-table vpn-instance vpnb
    13. Route Flags: R - relay, D - download to fib, T - to vpn-instance
    14. ------------------------------------------------------------------------------
    15. Routing Tables: vpnb
    16. Destinations : 3 Routes : 3
    17. Destination/Mask Proto Pre Cost Flags NextHop Interface
    18. 10.2.1.0/24 Direct 0 0 D 10.2.1.2 Vlanif20
    19. 10.2.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif20
    20. 10.4.1.0/24 IBGP 255 0 RD 3.3.3.9 Vlanif30
    21. 同一VPNCE能够相互Ping通,不同VPNCE不能相互Ping通。
    22. 例如:连接公司总部研发区的CE1能够Ping通连接分支机构研发区的CE310.3.1.1),但不能Ping通连接分支机构非研发区的CE410.4.1.1)。
    23. [CE1] ping 10.3.1.1
    24. PING 10.3.1.1: 56 data bytes, press CTRL_C to break
    25. Reply from 10.3.1.1: bytes=56 Sequence=1 ttl=253 time=72 ms
    26. Reply from 10.3.1.1: bytes=56 Sequence=2 ttl=253 time=34 ms
    27. Reply from 10.3.1.1: bytes=56 Sequence=3 ttl=253 time=50 ms
    28. Reply from 10.3.1.1: bytes=56 Sequence=4 ttl=253 time=50 ms
    29. Reply from 10.3.1.1: bytes=56 Sequence=5 ttl=253 time=34 ms
    30. --- 10.3.1.1 ping statistics ---
    31. 5 packet(s) transmitted
    32. 5 packet(s) received
    33. 0.00% packet loss
    34. round-trip min/avg/max = 34/48/72 ms

配置文件
  1. PE1的配置文件
  2. #
  3. sysname PE1
  4. #
  5. vlan batch 10 20 30
  6. #
  7. ip vpn-instance vpna
  8. ipv4-family
  9. route-distinguisher 100:1
  10. vpn-target 111:1 export-extcommunity
  11. vpn-target 111:1 import-extcommunity
  12. #
  13. ip vpn-instance vpnb
  14. ipv4-family
  15. route-distinguisher 100:2
  16. vpn-target 222:2 export-extcommunity
  17. vpn-target 222:2 import-extcommunity
  18. #
  19. mpls lsr-id 1.1.1.9
  20. mpls
  21. #
  22. mpls ldp
  23. #
  24. interface Vlanif10
  25. ip binding vpn-instance vpna
  26. ip address 10.1.1.2 255.255.255.0
  27. #
  28. interface Vlanif20
  29. ip binding vpn-instance vpnb
  30. ip address 10.2.1.2 255.255.255.0
  31. #
  32. interface Vlanif30
  33. ip address 172.1.1.1 255.255.255.0
  34. mpls
  35. mpls ldp
  36. #
  37. interface GigabitEthernet1/0/0
  38. port link-type trunk
  39. port trunk allow-pass vlan 10
  40. #
  41. interface GigabitEthernet2/0/0
  42. port link-type trunk
  43. port trunk allow-pass vlan 20
  44. #
  45. interface GigabitEthernet3/0/0
  46. port link-type trunk
  47. port trunk allow-pass vlan 30
  48. #
  49. interface LoopBack1
  50. ip address 1.1.1.9 255.255.255.255
  51. #
  52. bgp 100
  53. peer 3.3.3.9 as-number 100
  54. peer 3.3.3.9 connect-interface LoopBack1
  55. #
  56. ipv4-family unicast
  57. undo synchronization
  58. peer 3.3.3.9 enable
  59. #
  60. ipv4-family vpnv4
  61. policy vpn-target
  62. peer 3.3.3.9 enable
  63. #
  64. ipv4-family vpn-instance vpna
  65. import-route direct
  66. peer 10.1.1.1 as-number 65410
  67. #
  68. ipv4-family vpn-instance vpnb
  69. import-route direct
  70. peer 10.2.1.1 as-number 65420
  71. #
  72. ospf 1 router-id 1.1.1.9
  73. area 0.0.0.0
  74. network 1.1.1.9 0.0.0.0
  75. network 172.1.1.0 0.0.0.255
  76. #
  77. return
  78. P的配置文件
  79. #
  80. sysname P
  81. #
  82. vlan batch 30 60
  83. #
  84. mpls lsr-id 2.2.2.9
  85. mpls
  86. #
  87. mpls ldp
  88. #
  89. interface Vlanif30
  90. ip address 172.1.1.2 255.255.255.0
  91. mpls
  92. mpls ldp
  93. #
  94. interface Vlanif60
  95. ip address 172.2.1.1 255.255.255.0
  96. mpls
  97. mpls ldp
  98. #
  99. interface GigabitEthernet1/0/0
  100. port link-type trunk
  101. port trunk allow-pass vlan 30
  102. #
  103. interface GigabitEthernet2/0/0
  104. port link-type trunk
  105. port trunk allow-pass vlan 60
  106. #
  107. interface LoopBack1
  108. ip address 2.2.2.9 255.255.255.255
  109. #
  110. ospf 1 router-id 2.2.2.9
  111. area 0.0.0.0
  112. network 2.2.2.9 0.0.0.0
  113. network 172.1.1.0 0.0.0.255
  114. network 172.2.1.0 0.0.0.255
  115. #
  116. return
  117. PE2的配置文件
  118. #
  119. sysname PE2
  120. #
  121. vlan batch 40 50 60
  122. #
  123. ip vpn-instance vpna
  124. ipv4-family
  125. route-distinguisher 200:1
  126. vpn-target 111:1 export-extcommunity
  127. vpn-target 111:1 import-extcommunity
  128. #
  129. ip vpn-instance vpnb
  130. ipv4-family
  131. route-distinguisher 200:2
  132. vpn-target 222:2 export-extcommunity
  133. vpn-target 222:2 import-extcommunity
  134. #
  135. mpls lsr-id 3.3.3.9
  136. mpls
  137. #
  138. mpls ldp
  139. #
  140. interface Vlanif40
  141. ip binding vpn-instance vpna
  142. ip address 10.3.1.2 255.255.255.0
  143. #
  144. interface Vlanif50
  145. ip binding vpn-instance vpnb
  146. ip address 10.4.1.2 255.255.255.0
  147. #
  148. interface Vlanif60
  149. ip address 172.2.1.2 255.255.255.0
  150. mpls
  151. mpls ldp
  152. #
  153. interface GigabitEthernet1/0/0
  154. port link-type trunk
  155. port trunk allow-pass vlan 40
  156. #
  157. interface GigabitEthernet2/0/0
  158. port link-type trunk
  159. port trunk allow-pass vlan 50
  160. #
  161. interface GigabitEthernet3/0/0
  162. port link-type trunk
  163. port trunk allow-pass vlan 60
  164. #
  165. interface LoopBack1
  166. ip address 3.3.3.9 255.255.255.255
  167. #
  168. bgp 100
  169. peer 1.1.1.9 as-number 100
  170. peer 1.1.1.9 connect-interface LoopBack1
  171. #
  172. ipv4-family unicast
  173. undo synchronization
  174. peer 1.1.1.9 enable
  175. #
  176. ipv4-family vpnv4
  177. policy vpn-target
  178. peer 1.1.1.9 enable
  179. #
  180. ipv4-family vpn-instance vpna
  181. import-route direct
  182. peer 10.3.1.1 as-number 65430
  183. #
  184. ipv4-family vpn-instance vpnb
  185. import-route direct
  186. peer 10.4.1.1 as-number 65440
  187. #
  188. ospf 1 router-id 3.3.3.9
  189. area 0.0.0.0
  190. network 3.3.3.9 0.0.0.0
  191. network 172.2.1.0 0.0.0.255
  192. #
  193. return
  194. 连接公司总部研发区的CE1的配置文件
  195. #
  196. sysname CE1
  197. #
  198. vlan batch 10
  199. #
  200. interface Vlanif10
  201. ip address 10.1.1.1 255.255.255.0
  202. #
  203. interface GigabitEthernet1/0/0
  204. port link-type trunk
  205. port trunk allow-pass vlan 10
  206. #
  207. bgp 65410
  208. peer 10.1.1.2 as-number 100
  209. #
  210. ipv4-family unicast
  211. undo synchronization
  212. import-route direct
  213. peer 10.1.1.2 enable
  214. #
  215. return
  216. 连接公司总部非研发区的CE2的配置文件
  217. #
  218. sysname CE2
  219. #
  220. vlan batch 20
  221. #
  222. interface Vlanif20
  223. ip address 10.2.1.1 255.255.255.0
  224. #
  225. interface GigabitEthernet1/0/0
  226. port link-type trunk
  227. port trunk allow-pass vlan 20
  228. #
  229. bgp 65420
  230. peer 10.2.1.2 as-number 100
  231. #
  232. ipv4-family unicast
  233. undo synchronization
  234. import-route direct
  235. peer 10.2.1.2 enable
  236. #
  237. return
  238. 连接分支机构研发区的CE3的配置文件
  239. #
  240. sysname CE3
  241. #
  242. vlan batch 40
  243. #
  244. interface Vlanif40
  245. ip address 10.3.1.1 255.255.255.0
  246. #
  247. interface GigabitEthernet1/0/0
  248. port link-type trunk
  249. port trunk allow-pass vlan 40
  250. #
  251. bgp 65430
  252. peer 10.3.1.2 as-number 100
  253. #
  254. ipv4-family unicast
  255. undo synchronization
  256. import-route direct
  257. peer 10.3.1.2 enable
  258. #
  259. return
  260. 连接分支机构非研发区的CE4的配置文件
  261. #
  262. sysname CE4
  263. #
  264. vlan batch 50
  265. #
  266. interface Vlanif50
  267. ip address 10.4.1.1 255.255.255.0
  268. #
  269. interface GigabitEthernet1/0/0
  270. port link-type trunk
  271. port trunk allow-pass vlan 50
  272. #
  273. bgp 65440
  274. peer 10.4.1.2 as-number 100
  275. #
  276. ipv4-family unicast
  277. undo synchronization
  278. import-route direct
  279. peer 10.4.1.2 enable
  280. #
  281. return

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/71789
推荐阅读
相关标签
  

闽ICP备14008679号