• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

07-MPLS配置举例

目录

02-H3C_12500_MCE典型配置举例

本章节下载 02-H3C_12500_MCE典型配置举例  (501.11 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500-S/Configure/Typical_Configuration_Example/H3C_S12500-S_CE-R7536P05-6W100/07/201709/1032193_30005_0.htm

02-H3C_12500_MCE典型配置举例

H3C MCE典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2017新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,

并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。

H3C_彩色.emf

 



1 简介

本文档介绍MCE的配置举例。

MCE功能通过为每个VPN创建和维护独立的路由转发表,来隔离私网内不同VPN的报文转发路径,而且通过与PE间的配合,也能够将每个VPN的路由正确发布至对端PE,保证了在MPLS L3VPN环境下VPN报文在公网内的正确传输。本文介绍了由MCE设备向PE 1设备发布VPN路由信息的典型配置案例。

2 配置前提

本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解MCE特性。

3 MCE通过OSPF向PE发布VPN路由典型配置举例

3.1  组网需求

图3-1所示,某公司通过运营商提供的MPLS L3VPN服务实现总部与分支机构的VPN连接,运营商MPLS网络左侧为公司总部网络,包括财务和研发部门,财务部中使用静态路由,而研发部内部通过RIP维护路由信息。MPLS网络右侧为研发和财务的分支机构,两个分支机构分别通过CE1和CE2接入MPLS网络。

现要求通过在总部的出口设备上配置MCE功能,实现以下需求:

·     研发部和财务部的路由信息在出口设备上相互隔离;

·     出口设备与PE1之间通过OSPF交互路由信息,并可以通过PE1设备与远端相同VPN内的站点之间实现各部门内部路由信息的单独维护更新。

图3-1 MCE通过OSPF向PE发布VPN路由组网示意图

 

3.2  配置思路

说明

本案例主要介绍MCE功能的典型配置,因此仅对组网中MCE设备以及与之配合的VR1、VR2和PE1设备的配置进行介绍,组网中其它设备的配置这里不再列出。

 

在MCE设备和PE 1设备上都需要创建VPN实例,并将需要传播该VPN数据的接口与相应的VPN实例绑定。要实现在一台设备上对于不同VPN的路由表项进行隔离和单独维护,需要按顺序完成以下配置:

(1)     通过创建VPN实例完成虚拟路由表的创建;

(2)     在每个VPN实例中配置或学习VPN站点内的路由信息;

(3)     将VPN站点的路由信息通过OSPF协议发布给PE 1设备,并接收PE 1设备从远端站点传来的VPN路由信息;

(4)     将PE 1设备上的远端VPN路由信息引入到本地VPN站点。

图3-2 使用VPN实例虚拟多个CE设备示意图

 

3.3  使用版本

本举例在S12500S-CMW710-R7536P05版本上进行配置和验证。

3.4  配置注意事项

·     执行ip binding vpn-instance命令将删除接口上已经配置的IP地址,因此需要先执行绑定操作,再配置IP地址。

·     一个OSPF进程只能属于一个VPN实例,但一个VPN实例可以使用多个OSPF进程为其传播私网路由。同一VPN实例内的OSPF进程应配置有相同的域ID,以保证路由发布的正确性。

3.5  配置步骤

1. VPN实例配置

# 在MCE设备上为VPN1创建VPN实例,名为“vpn1”,并配置该实例的RD值为10:1。

<MCE> system-view

[MCE] ip vpn-instance vpn1

[MCE-vpn-instance-vpn1] route-distinguisher 10:1

[MCE-vpn-instance-vpn1] quit

# 按同样方法为VPN2创建实例“vpn2”,RD值为20:1。

[MCE] ip vpn-instance vpn2

[MCE-vpn-instance-vpn2] route-distinguisher 20:1

[MCE-vpn-instance-vpn2] quit

# 创建VLAN10,将端口GigabitEthernet 1/0/10加入VLAN10,并创建Vlan-interface10接口。

[MCE] vlan 10

[MCE-vlan10] port GigabitEthernet 1/0/10

[MCE-vlan10] quit

[MCE] interface Vlan-interface 10

# 配置Vlan-interface10接口与VPN1实例进行绑定,并配置IP地址为10.214.10.3/24

[MCE-Vlan-interface10] ip binding vpn-instance vpn1

[MCE-Vlan-interface10] ip address 10.214.10.3 24

# 使用类似步骤配置VLAN20,将端口GigabitEthernet 1/0/20加入VLAN20,配置接口与VPN2实例绑定并配置IP地址。

[MCE-Vlan-interface10] quit

[MCE] vlan 20

[MCE-vlan20] port GigabitEthernet 1/0/20

[MCE-vlan20] quit

[MCE] interface Vlan-interface 20

[MCE-Vlan-interface20] ip binding vpn-instance vpn2

[MCE-Vlan-interface20] ip address 10.214.20.3 24

[MCE-Vlan-interface20] quit

# 创建VLAN30VLAN40,将GigabitEthernet1/0/3端口以Trunk方式加入这两个VLAN。并创建相应的VLAN接口,将VLAN30VPN1绑定,VLAN40VPN2绑定,配置IP地址。

[MCE] vlan 30

[MCE-vlan30] quit

[MCE] vlan 40

[MCE-vlan40] quit

[MCE] interface GigabitEthernet 1/0/3

[MCE-GigabitEthernet1/0/3] port link-type trunk

[MCE-GigabitEthernet1/0/3] port trunk permit vlan 30 40

[MCE-GigabitEthernet1/0/3] quit

[MCE] interface Vlan-interface 30

[MCE-Vlan-interface30] ip binding vpn-instance vpn1

[MCE-Vlan-interface30] ip address 172.16.30.1 24

[MCE-Vlan-interface30] quit

[MCE] interface Vlan-interface 40

[MCE-Vlan-interface40] ip binding vpn-instance vpn2

[MCE-Vlan-interface40] ip address 172.16.40.1 24

[MCE-Vlan-interface40] quit

说明

·     在PE1设备上也需要创建相同的VPN实例及RD值,并将VPN实例分别与连接MCE的接口进行绑定,配置过程这里不再赘述。

·     为方便记忆和管理,建议用户在MCE上为VPN实例配置的RD与在PE1上为该VPN实例配置的RD值保持一致。

 

2. 在VPN实例中配置路由功能

(1)     配置VPN1中的路由

# 配置VR1设备连接MCE的接口地址分别为10.214.10.2/24,具体配置过程省略。

# 在VR1上配置缺省路由,指定出方向报文的下一跳地址为MCE设备,即10.214.10.3。

<VR1> system-view

[VR1] ip route-static 0.0.0.0 0.0.0.0 10.214.10.3

# 在MCE上指定静态路由,去往192.168.1.0网段的报文,下一跳地址为10.214.10.2,并将此路由与VPN1实例绑定。

[MCE] ip route-static vpn-instance vpn1 192.168.1.0 24 10.214.10.2

# 显示MCE上为VPN1实例维护的路由信息。

[MCE] display ip routing-table vpn-instance vpn1

 

Destinations : 7        Routes : 7

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

10.214.10.0/24      Direct 0     0           10.214.10.3     Vlan10

10.214.10.3/32      Direct 0     0           127.0.0.1       InLoop0

127.0.0.0/8         Direct 0     0           127.0.0.1       InLoop0

127.0.0.1/32        Direct 0     0           127.0.0.1       InLoop0

172.16.30.0/24      Direct 0     0           172.16.30.1     Vlan30

172.16.30.1/32      Direct 0     0           127.0.0.1       InLoop0

192.168.0.0/16      Static 60    0           10.214.10.2     Vlan10

可以看到,VPN1的路由表中已经存在去往站点1的静态路由。

(2)     配置VPN2中的路由

# VR2上,配置与MCE连接的接口地址为10.214.20.2/24(配置过程略),配置RIP(假设进程号为20),发布网段192.168.2.0/2410.214.20.0/24

<VR2> system-view

[VR2] rip 20

[VR2-rip-20] network 192.168.2.0

[VR2-rip-20] network 10.0.0.0

# VPN2的站点1内已经运行了RIP,可以在MCE上配置RIP路由协议,加入到站点1内的路由运算中,自动更新路由信息。配置RIP进程与VR2一致,并与VPN2实例进行绑定。

[MCE] rip 20 vpn-instance vpn2

# 将网段10.214.20.0发布,关闭路由自动聚合功能。

[MCE-rip-20] network 10.0.0.0

[MCE-rip-20] undo summary

[MCE-rip-20] quit

# 在MCE上查看VPN2实例的路由信息。

[MCE] display ip routing-table vpn-instance vpn2

 

Destinations : 5        Routes : 5

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

10.214.20.0/24      Direct 0    0            10.214.20.3     Vlan20

10.214.20.3/32      Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

172.16.40.0/30      Direct 0    0            172.16.40.1     Vlan40

172.16.40.1/32      Direct 0    0            127.0.0.1       InLoop0

192.168.2.0/24      RIP    100  1            10.214.20.2     Vlan20

可以看到,MCE已经通过RIP学习到了VPN2内的私网路由,并与VPN1内的192.168.1.0路由信息分别维护在两个路由表内,有效地进行了隔离。

3. 配置MCE与PE1设备间的路由信息同步

# 在PE1设备上创建VLAN30和VLAN40,并将GigabitEthernet1/0/18端口加入VLAN30和VLAN40。

<PE1> system-view

[PE1] vlan 30

[PE1-vlan30] quit

[PE1] vlan 40

[PE1-vlan40] quit

[PE1] interface GigabitEthernet 1/0/18

[PE1-GigabitEthernet1/0/18] port link-type trunk

[PE1-GigabitEthernet1/0/18] port trunk permit vlan 30 40

[PE1-GigabitEthernet1/0/18] undo port trunk permit vlan 1

[PE1-GigabitEthernet1/0/18] quit

# 在PE1设备上为VPN1和VPN2创建VPN实例,分别名为“vpn1”和“vpn2”,并配置该实例的RD值,与MCE设备上保持一致。

[PE1] ip vpn-instance vpn1

[PE1-vpn-instance-vpn1] route-distinguisher 10:1

[PE1-vpn-instance-vpn1] quit

[PE1] ip vpn-instance vpn2

[PE1-vpn-instance-vpn2] route-distinguisher 20:1

[PE1-vpn-instance-vpn2] quit

# 配置PE1Vlan-interface30Vlan-interface40接口分别与VPN1VPN2实例进行绑定,并配置IP地址分别为172.16.30.2/24172.16.40.2/24

[PE1] interface vlan-interface 30

[PE1-Vlan-interface30] ip binding vpn-instance vpn1

[PE1-Vlan-interface30] ip address 172.16.30.2 24

[PE1-Vlan-interface30] quit

[PE1] interface vlan-interface 40

[PE1-Vlan-interface40] ip binding vpn-instance vpn2

[PE1-Vlan-interface40] ip address 172.16.40.2 24

[PE1-Vlan-interface40] quit

# 配置MCE的Loopback0接口与VPN1实例绑定,IP地址为100.100.10.1/32,该接口用于指定MCE设备上用于传输VPN1路由信息的OSPF Router ID。

[MCE] interface Loopback 0

[MCE-Loopback0] ip binding vpn-instance vpn1

[MCE-Loopback0] ip address 100.100.10.1 32

[MCE-Loopback0] quit

# 配置PE1的Loopback0接口与VPN1实例绑定,IP地址为100.100.11.1/32,该接口用于指定PE1设备上用于传输VPN1路由信息的OSPF Router ID。

[PE1] interface Loopback 0

[PE1-Loopback0] ip binding vpn-instance vpn1

[PE1-Loopback0] ip address 100.100.11.1 32

[PE1-Loopback0] quit

# 配置MCE启动OSPF进程10,Router ID指定为Loopback0接口的地址。将该进程绑定到VPN1实例,用于与PE1交互VPN1的路由信息。

[MCE] ospf 10 router-id 100.100.10.1 vpn-instance vpn1

#开启OSPF多实例功能。

[MCE-ospf-10] vpn-instance-capability simple

# Area0区域发布172.16.30.0/24网段,并引入VPN1的静态路由。

[MCE-ospf-10] area 0

[MCE-ospf-10-area-0.0.0.0] network 172.16.30.0 0.0.0.255

[MCE-ospf-10-area-0.0.0.0] quit

[MCE-ospf-10] import-route static

[MCE-ospf-10] quit

# 配置PE1启动OSPF进程10,Router ID指定为Loopback0接口的地址,将该进程绑定到VPN1实例,用于与MCE设备交互VPN1的路由信息。

[PE1] ospf 10 router-id 100.100.11.1 vpn-instance vpn1

# 配置该进程的域ID为10。

[PE1-ospf-10] domain-id 10

# 开启OSPF多实例功能。

[PE1-ospf-10] vpn-instance-capability simple

# 并在Area0区域发布172.16.30.0/24网段。

[PE1-ospf-10] area 0

[PE1-ospf-10-area-0.0.0.0] network 172.16.30.0 0.0.0.255

# 配置MCE的Loopback1接口与VPN2实例绑定,IP地址为100.100.20.1/32,该接口用于指定MCE设备上用于传输VPN2路由信息的OSPF Router ID。

[MCE] interface Loopback 1

[MCE-Loopback1] ip binding vpn-instance vpn2

[MCE-Loopback1] ip address 100.100.20.1 32

# 配置PE1的Loopback1接口与VPN2实例绑定,IP地址为100.100.21.1/32,该接口用于指定PE1设备上用于传输VPN2路由信息的OSPF Router ID。

[PE1] interface Loopback 1

[PE1-Loopback1] ip binding-vpn-instance vpn2

[PE1-Loopback1] ip address 100.100.21.1 32

# 配置MCE启动OSPF进程20,Router ID指定为Loopback1接口的地址。将该进程绑定到VPN2实例,用于与PE1交互VPN2的路由信息。

[MCE] ospf 20 router-id 100.100.20.1 vpn-instance vpn2

#开启OSPF多实例功能。

[MCE-ospf-20] vpn-instance-capability simple

# Area0区域发布172.16.40.0/24网段,并引入VPN2的RIP路由。

[MCE-ospf-20] area 0

[MCE-ospf-20-area-0.0.0.0] network 172.16.40.0 0.0.0.255

[MCE-ospf-20-area-0.0.0.0] quit

[MCE-ospf-20] import-route rip 20

# 配置PE1启动OSPF进程20,Router ID指定为Loopback1接口的地址,将该进程绑定到VPN2实例,用于与MCE设备交互VPN2的路由信息。

[PE1] ospf 20 router-id 100.100.21.1 vpn-instance vpn2

# 配置该进程的域ID为20。

[PE1-ospf-20] domain-id 20

# 开启OSPF多实例功能。

[PE1-ospf-20] vpn-instance-capability simple

# 并在Area0区域发布172.16.40.0/24网段。

[PE1-ospf-20] area 0

[PE1-ospf-20-area-0.0.0.0] network 172.16.40.0 0.0.0.255

[PE1-ospf-20-area-0.0.0.0] quit

[PE1-ospf-20] quit

3.6  验证配置

# 显示PE1上VPN1实例的路由信息。

[PE1] display ip routing-table vpn-instance vpn1

 

Destinations : 14        Routes : 14

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

100.100.11.1/32    Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

172.16.30.0/24     Direct  0   0           172.16.30.2     Vlan30

172.16.30.0/32     Direct  0   0           172.16.30.2     Vlan30

172.16.30.2/32     Direct  0   0           127.0.0.1       InLoop0

172.16.30.255/32   Direct  0   0           172.16.30.2     Vlan30

192.168.1.0/24     O_ASE2  150 1           172.16.30.1     Vlan30

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

可以看到,VPN1内的静态路由已经引入到MCE与PE1间的OSPF路由表中。

# 显示PE1上VPN2实例的路由信息。

[PE1] display ip routing-table vpn-instance vpn2

 

Destinations : 14        Routes : 14

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

100.100.21.1/32    Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

172.16.40.0/24     Direct  0   0           172.16.40.2     Vlan40

172.16.40.0/32     Direct  0   0           172.16.40.2     Vlan40

172.16.40.2/32     Direct  0   0           127.0.0.1       InLoop0

172.16.40.255/32   Direct  0   0           172.16.40.2     Vlan40

192.168.1.0/24     O_ASE2  150 1           172.16.40.1     Vlan40

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

可以看到,VPN2内的RIP路由信息已经引入到MCE与PE1间的OSPF路由表中。

3.7  配置文件

·     VR1:

#

 vlan 10

#

interface Vlan-interface10

 ip address 10.214.10.2 255.255.255.0

#

 ip route-static 0.0.0.0 0 10.214.10.3

#

·     VR2:

#

rip 20

 network 10.0.0.0

 network 192.168.2.0

#

 vlan 20

#

interface Vlan-interface20

 ip address 10.214.20.2 255.255.255.0

#

·     MCE:

#

ip vpn-instance vpn1

 route-distinguisher 10:1

#

ip vpn-instance vpn2

 route-distinguisher 20:1

#

ospf 10 router-id 100.100.10.1 vpn-instance vpn1

 import-route static

 vpn-instance-capability simple

 area 0.0.0.0

  network 172.16.30.0 0.0.0.255

#

ospf 20 router-id 100.100.20.1 vpn-instance vpn2

 import-route rip 20

 vpn-instance-capability simple

 area 0.0.0.0

  network 172.16.40.0 0.0.0.255

#

rip 20 vpn-instance vpn2

 undo summary

 network 10.0.0.0

#

vlan 10

#

vlan 20

#

vlan 30

#

vlan 40

#

interface LoopBack0

 ip binding vpn-instance vpn1

 ip address 100.100.10.1 255.255.255.255

#

interface LoopBack1

 ip binding vpn-instance vpn2

 ip address 100.100.20.1 255.255.255.255

#

interface Vlan-interface10

 ip binding vpn-instance vpn1

 ip address 10.214.10.3 255.255.255.0

#

interface Vlan-interface20

 ip binding vpn-instance vpn2

 ip address 10.214.20.3 255.255.255.0

#

interface Vlan-interface30

 ip binding vpn-instance vpn1

 ip address 172.16.30.1 255.255.255.0

#

interface Vlan-interface40

 ip binding vpn-instance vpn2

 ip address 172.16.40.1 255.255.255.0

#

interface GigabitEthernet1/0/3

 port link-type trunk

 port trunk permit vlan 1 30 40

#

interface GigabitEthernet1/0/10

 port access vlan 10

#

interface GigabitEthernet1/0/20

 port access vlan 20

#

 ip route-static vpn-instance vpn1 192.168.1.0 255.255.255.0 10.214.10.2

#

·     PE1:

#

ip vpn-instance vpn1

 route-distinguisher 10:1

#

ip vpn-instance vpn2

 route-distinguisher 20:1

#

ospf 10 router-id 100.100.10.1 vpn-instance vpn1

 domain-id 0.0.0.10

 vpn-instance-capability simple

 area 0.0.0.0

  network 172.16.30.0 0.0.0.255

#

ospf 20 router-id 100.100.20.1 vpn-instance vpn2

 domain-id 0.0.0.20

 vpn-instance-capability simple

 area 0.0.0.0

  network 172.16.40.0 0.0.0.255

#

vlan 30

#

vlan 40

#

interface LoopBack0

 ip binding vpn-instance vpn1

 ip address 100.100.11.1 255.255.255.255

#

interface LoopBack1

 ip binding vpn-instance vpn2

 ip address 100.100.21.1 255.255.255.255

#

interface Vlan-interface30

 ip binding vpn-instance vpn1

 ip address 172.16.30.2 255.255.255.0

#

interface Vlan-interface40

 ip binding vpn-instance vpn2

 ip address 172.16.40.2 255.255.255.0

#

interface GigabitEthernet1/0/18

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 30 40

#

4 MCE通过BGP向PE发布VPN路由典型配置举例

4.1  组网需求

图4-1所示,某公司通过运营商提供的MPLS L3VPN服务实现总部与分支机构的VPN连接,组网示意,运营商MPLS网络左侧为公司总部网络,包括财务和研发部门,财务部中使用OSPF路由协议,而研发部内部通过IBGP维护路由信息。MPLS网络右侧为研发和财务的分支机构,两个分支机构分别通过CE1和CE2接入MPLS网络。

现要求通过在总部的出口设备上配置MCE功能,实现以下需求:

·     研发部和财务部的路由信息在出口设备上相互隔离;

·     出口设备与PE1之间通过BGP交互路由信息,并可以通过PE1设备与远端相同VPN内的站点之间实现各部门内部路由信息的单独维护更新。

图4-1 MCE通过BGP向PE发布VPN路由组网示意图

 

4.2  配置思路

说明

本案例主要介绍MCE功能的典型配置,因此仅对组网中MCE设备以及与之配合的VR1、VR2、VR3和PE1设备的配置进行介绍,组网中其它设备的配置这里不再列出。

 

在MCE设备和PE 1设备上都需要创建VPN实例,并将需要传播该VPN数据的接口与相应的VPN实例绑定。MCE设备对各VPN内路由信息的处理顺序如图4-2所示,即:

(1)     通过创建VPN实例完成虚拟路由表的创建;

(2)     在VPN实例中引入VPN站点的路由信息。需要注意的是,研发部内部使用的是IBGP协议,IBGP协议要求全连接或配置路由反射器。在MCE组网中,要求将MCE设备配置为IBGP的路由反射器;

(3)     将VPN站点的路由信息通过EBGP协议发布给PE 1设备,并接收PE 1设备从远端站点传来的VPN路由信息;

(4)     将PE 1设备上的远端VPN路由信息引入到本地VPN站点中。

图4-2 使用VPN实例虚拟多个CE设备示意图

 

4.3  使用版本

本举例在S12500S-CMW710-R7536P05版本上进行配置和验证。

4.4  配置注意事项

执行ip binding vpn-instance命令将删除接口上已经配置的IP地址,因此需要先执行绑定操作,再配置IP地址。

4.5  配置步骤

1. 配置VPN实例

# 在MCE设备上为VPN1创建VPN实例,名为“vpn1”,并配置该实例的RD值为10:1。

<MCE> system-view

[MCE] ip vpn-instance vpn1

[MCE-vpn-instance-vpn1] route-distinguisher 10:1

[MCE-vpn-instance-vpn1] quit

# 按同样方法为VPN2创建实例“vpn2”,RD值为20:1。

[MCE] ip vpn-instance vpn2

[MCE-vpn-instance-vpn2] route-distinguisher 20:1

[MCE-vpn-instance-vpn2] quit

# 创建VLAN10,将端口GigabitEthernet 1/0/10加入VLAN10

[MCE] vlan 10

[MCE-vlan10] port GigabitEthernet 1/0/10

[MCE-vlan10] quit

# 配置Vlan-interface10接口与VPN1实例进行绑定,并配置IP地址为10.214.10.3/24

[MCE] interface Vlan-interface 10

[MCE-Vlan-interface10] ip binding vpn-instance vpn1

[MCE-Vlan-interface10] ip address 10.214.10.3 24

[MCE-Vlan-interface10] quit

# 使用类似步骤配置VLAN20,将端口GigabitEthernet 1/0/20加入VLAN20,配置接口与VPN2实例绑定并配置IP地址。

[MCE] vlan 20

[MCE-vlan20] port GigabitEthernet 1/0/20

[MCE-vlan20] quit

[MCE] interface Vlan-interface 20

[MCE-Vlan-interface20] ip binding vpn-instance vpn2

[MCE-Vlan-interface20] ip address 10.214.20.3 24

[MCE-Vlan-interface20] quit

# 使用类似步骤配置VLAN21,将端口GigabitEthernet 1/0/21加入VLAN21,配置接口与VPN2实例绑定并配置IP地址。

[MCE] vlan 21

[MCE-vlan21] port GigabitEthernet 1/0/21

[MCE-vlan21] quit

[MCE] interface Vlan-interface 21

[MCE-Vlan-interface21] ip binding vpn-instance vpn2

[MCE-Vlan-interface21] ip address 10.214.50.3 24

[MCE-Vlan-interface21] quit

# 创建VLAN30VLAN40,将GigabitEthernet1/0/3端口以Trunk方式加入这两个VLAN。并创建相应的VLAN接口,将VLAN30接口与VPN1绑定,VLAN40接口与VPN2绑定,并配置IP地址。

[MCE] vlan 30

[MCE-vlan30] quit

[MCE] vlan 40

[MCE-vlan40] quit

[MCE] interface GigabitEthernet 1/0/3

[MCE-GigabitEthernet1/0/3] port link-type trunk

[MCE-GigabitEthernet1/0/3] port trunk permit vlan 30 40

[MCE-GigabitEthernet1/0/3] quit

[MCE] interface Vlan-interface 30

[MCE-Vlan-interface30] ip binding vpn-instance vpn1

[MCE-Vlan-interface30] ip address 172.16.30.1 24

[MCE-Vlan-interface30] quit

[MCE] interface Vlan-interface 40

[MCE-Vlan-interface40] ip binding vpn-instance vpn2

[MCE-Vlan-interface40] ip address 172.16.40.1 24

[MCE-Vlan-interface40] quit

2. 在VPN实例中引入VPN站点的路由

(1)     引入VPN1站点中的路由

# 配置VR1设备连接MCE的接口地址为10.214.10.2/24,具体配置过程省略。

# 在VR1上开启OSPF路由协议,并发布直连网段192.168.1.0/24和10.214.10.2/24。

<VR1> system-view

[VR1] ospf

[VR1-ospf-1] area 0

[VR1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[VR1-ospf-1-area-0.0.0.0] network 10.214.10.0 0.0.0.255

# 配置MCELoopback0接口与VPN1实例绑定,并配置IP地址为101.101.10.1/32,该接口用来作为与VPN1实例绑定的OSPF进程的Router ID

[MCE] interface LoopBack 0

[MCE-LoopBack0] ip binding vpn-instance vpn1

[MCE-LoopBack0] ip address 101.101.10.1 32

[MCE-LoopBack0] quit

# 在MCE上开启OSPF路由协议,进程为1,将该进程与VPN1实例进行绑定,使用Loopback0接口的地址作为Router ID。

[MCE] ospf 1 vpn-instance vpn1 router-id 101.101.10.1

# 将直连网段10.214.10.0/24发布。

[MCE-ospf-1] area 0

[MCE-ospf-1-area-0.0.0.0] network 10.214.10.0 0.0.0.255

[MCE-ospf-1-area-0.0.0.0] quit

[MCE-ospf-1] quit

# 显示MCE上为VPN1实例维护的路由信息。

[MCE] display ip routing-table vpn-instance vpn1

 

Destinations : 6        Routes : 6

 

Destination/Mask   Proto   Pre Cost         NextHop         Interface

0.0.0.0/32         Direct  0   0            127.0.0.1       InLoop0

127.0.0.0/8        Direct  0   0            127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0            127.0.0.1       InLoop0

10.214.10.0/24     Direct  0   0            10.214.10.3     Vlan10

10.214.10.3/32     Direct  0   0            127.0.0.1       InLoop0

192.168.1.0/24     O_INTRA 10  2            10.214.10.2     Vlan10

可以看到,已经在MCE上学到了去往VPN1站点1的路由。

(2)     引入VPN2站点中的路由

# 配置VR2设备和VR3设备连接MCE的接口地址分别为10.214.20.2/24和10.214.50.2/24,具体配置过程省略。

# VR2上配置BGP(使用自治系统100),对等体为10.214.20.3MCE),并将网段192.168.2.0/2410.214.20.0/24发布。

<VR2> system-view

[VR2] bgp 100

[VR2-bgp-default] router-id 2.2.2.2

[VR2-bgp-default] peer 10.214.20.3 as-number 100

[VR2-bgp-default] address-family ipv4

[VR2-bgp-default-ipv4] peer 10.214.20.3 enable

[VR2-bgp-default-ipv4] network 192.168.2.0 24

[VR2-bgp-default-ipv4] network 10.214.20.0 24

[VR2-bgp-default-ipv4] quit

[VR2-bgp-default] quit

# VR3上配置BGP(使用自治系统100),对等体为10.214.50.3MCE),并将网段192.168.3.0/2410.214.50.0/24发布。

<VR3> system-view

[VR3] bgp 100

[VR3-bgp-default] router-id 3.3.3.3

[VR3-bgp-default] peer 10.214.50.3 as-number 100

[VR3-bgp-default] address-family ipv4

[VR3-bgp-default-ipv4] peer 10.214.50.3 enable

[VR3-bgp-default-ipv4] network 192.168.3.0 24

[VR3-bgp-default-ipv4] network 10.214.50.0 24

[VR3-bgp-default-ipv4] quit

[VR3-bgp-default] quit

# 在MCE上配置BGP(使用自治系统100),并为VPN2创建BGP-VPN实例。在该实例中配置对等体为10.214.20.2和10.214.50.2,将网段10.214.20.0/24和10.214.50.0/24发布。

[MCE] bgp 100

[MCE-bgp-default] ip vpn-instance vpn2

[MCE-bgp-default-vpn2] peer 10.214.20.2 as-number 100

[MCE-bgp-default-vpn2] peer 10.214.50.2 as-number 100

[MCE-bgp-default] address-family ipv4

[MCE-bgp-default-ipv4-vpn2] peer 10.214.20.2 enable

[MCE-bgp-default-ipv4-vpn2] peer 10.214.50.2 enable

[MCE-bgp-default-ipv4-vpn2] network 10.214.20.0 24

[MCE-bgp-default-ipv4-vpn2] network 10.214.50.0 24

# 配置MCE作为VR2和VR3设备的BGP路由反射器。

[MCE-bgp-default-ipv4-vpn2] peer 10.214.20.2 reflect-client

[MCE-bgp-default-ipv4-vpn2] peer 10.214.50.2 reflect-client

# 在MCE上查看BGP路由信息。

[MCE-bgp-default-ipv4-vpn2] display bgp routing-table vpnv4

 

BGP local router ID is 4.4.4.4

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

               Origin: i - IGP, e - EGP, ? - incomplete

 

 Route distinguisher: 20:1(vpn2)

 Total number of routes: 6

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >  10.214.20.0/24     10.214.20.3     0                     32768   i

*  i                    10.214.20.2     0          100        0       i

* >  10.214.50.0/24     10.214.50.3     0                     32768   i

*  i                    10.214.50.2     0          100        0       i

* >i 192.168.2.0        10.214.20.2     0          100        0       i

* >i 192.168.3.0        10.214.50.2     0          100        0       i

可以看到MCE上已经学习到了VPN2站点内部的路由信息。

3. 配置MCE与PE 1设备间的路由信息同步

# 配置PE 1的GigabitEthernet1/0/18端口加入VLAN30和VLAN40。

<PE1> system-view

[PE1] interface GigabitEthernet 1/0/18

[PE1-GigabitEthernet1/0/18] port link-type trunk

[PE1-GigabitEthernet1/0/18] port trunk permit vlan 30 40

[PE1-GigabitEthernet1/0/18] quit

# 在PE1设备上为VPN1和VPN2创建VPN实例,分别名为“vpn1”和“vpn2”,并配置该实例的RD值,与MCE设备上保持一致。

[PE1] ip vpn-instance vpn1

[PE1-vpn-instance-vpn1] route-distinguisher 10:1

[PE1-vpn-instance-vpn1] quit

[PE1] ip vpn-instance vpn2

[PE1-vpn-instance-vpn2] route-distinguisher 20:1

[PE1-vpn-instance-vpn2] quit

# 配置PE1Vlan-interface30Vlan-interface40接口分别与vpn1vpn2实例进行绑定,并配置IP地址分别为172.16.30.2/24172.16.40.2/24

[PE1] interface vlan-interface 30

[PE1-Vlan-interface30] ip binding vpn-instance vpn1

[PE1-Vlan-interface30] ip address 172.16.30.2 24

[PE1-Vlan-interface30] quit

[PE1-Vlan-interface40] ip binding vpn-instance vpn2

[PE1-Vlan-interface40] ip address 172.16.40.2 24

[PE1-Vlan-interface40] quit

(1)     配置MCE与PE 1设备间同步VPN1的路由信息

# 在MCE设备上,为VPN1创建BGP-VPN实例,指定172.16.30.2PE 1)作为EBGP对等体,自治系统号为200

[MCE] bgp 100

[MCE-bgp-default] ip vpn-instance vpn1

[MCE-bgp-default-vpn1] peer 172.16.30.2 as-number 200

# BGP-VPN实例中,引入OSPF的路由信息,并发布172.16.30.0/24网段。

[MCE-bgp-default-vpn1] address-family ipv4

[MCE-bgp-default-ipv4-vpn1] import-route ospf

[MCE-bgp-default-ipv4-vpn1] peer 172.16.30.2 enable

[MCE-bgp-default-ipv4-vpn1] network 172.16.30.0 24

[MCE-bgp-default-ipv4-vpn1] quit

[MCE-bgp-default-vpn1] quit

# PE 1设备上进入VPN1BGP-VPN实例视图,配置EBGP对等体地址为172.16.30.1MCE),自治系统号为100,并发布172.16.30.0/24网段。

[PE1] bgp 200

[PE1-bgp-default] ip vpn-instance vpn1

[PE1-bgp-default-vpn1] peer 172.16.30.1 as-number 100

[PE1-bgp-default-vpn1] address-family ipv4

[PE1-bgp-default-ipv4-vpn1] peer 172.16.30.1 enable

[PE1-bgp-default-ipv4-vpn1] network 172.16.30.0 24

[PE1-bgp-default-ipv4-vpn1] quit

[PE1-bgp-default-vpn1] quit

(2)     配置MCE与PE 1设备间同步VPN2的路由信息

# MCE设备VPN2BGP-VPN实例中,指定172.16.40.2作为EBGP对等体,自治系统号为200,并发布172.16.40.0/24网段。

[MCE-bgp-default] ip vpn-instance vpn2

[MCE-bgp-default-vpn2] peer 172.16.40.2 as-number 200

[MCE-bgp-default-vpn2] address-family ipv4

[MCE-bgp-default-ipv4-vpn2] peer 172.16.40.2 enable

[MCE-bgp-default-ipv4-vpn2] network 172.16.40.0 24

[MCE-bgp-default-ipv4-vpn2] quit

[MCE-bgp-default-vpn2] quit

[MCE-bgp-default] quit

# PE 1设备上进入VPN2BGP-VPN实例视图,配置EBGP对等体地址为172.16.40.1,自治系统号为100,并发布172.16.40.0/24网段。

[PE1-bgp-default] ip vpn-instance vpn2

[PE1-bgp-default-vpn2] peer 172.16.40.1 as-number 100

[PE1-bgp-default-vpn2] address-family ipv4

[PE1-bgp-default-ipv4-vpn2] peer 172.16.40.1 enable

[PE1-bgp-default-ipv4-vpn2] network 172.16.40.0 24

[PE1-bgp-default-ipv4-vpn2] quit

[PE1-bgp-default-vpn2] quit

[PE1-bgp-default] quit

4.6  验证配置

# 在PE 1设备上查看VPN1实例的路由表。

[PE1] display ip routing-table vpn-instance vpn1

 

         Destinations : 5        Routes : 5

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

172.16.30.0/24      Direct 0    0            172.16.30.2     Vlan30

172.16.30.2/24      Direct 0    0            127.0.0.1       InLoop0

192.168.1.0/24      BGP    255  3            172.16.30.1     Vlan30

可以看到,在PE 1设备上VPN1实例的路由表中,已经引入了VPN1站点中的192.168.1.0网段的路由信息。

# 在PE1设备上查看VPN2实例的路由表。

[PE1] display ip routing-table vpn-instance vpn2

 

Destinations : 16        Routes : 16

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

10.214.20.0/24     BGP     255 0           172.16.40.1     Vlan40

10.214.50.0/24     BGP     255 0           172.16.40.1     Vlan40

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

172.16.40.0/24     Direct  0   0           172.16.40.2     Vlan40

172.16.40.0/32     Direct  0   0           172.16.40.2     Vlan40

172.16.40.2/32     Direct  0   0           127.0.0.1       InLoop0

172.16.40.255/32   Direct  0   0           172.16.40.2     Vlan40

192.168.2.0/24     BGP     255 0           172.16.40.1     Vlan40

192.168.3.0/24     BGP     255 0           172.16.40.1     Vlan40

224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0

224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0

255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

可以看到,在PE 1设备上VPN2实例的路由表中,已经引入了VPN2站点中的192.168.2.0/24192.168.3.0/24网段的路由信息。

4.7  配置文件

·     VR1:

#

ospf 1

 area 0.0.0.0

  network 10.214.10.0 0.0.0.255

  network 192.168.1.0 0.0.0.255

#

 vlan 10

#

interface Vlan-interface10

 ip address 10.214.10.2 255.255.255.0

#

·     VR2:

#

 vlan 20

#

interface Vlan-interface20

 ip address 10.214.20.2 255.255.255.0

#

bgp 100

 router-id 2.2.2.2

 peer 10.214.20.3 as-number 100

 #

 address-family ipv4 unicast

  network 10.214.20.0 255.255.255.0

  network 192.168.2.0 255.255.255.0

  peer 10.214.20.3 enable

#

·     VR3:

#

 vlan 21

#

interface Vlan-interface21

 ip address 10.214.50.2 255.255.255.0

#

bgp 100

 router-id 3.3.3.3

 peer 10.214.50.3 as-number 100

 #

 address-family ipv4 unicast

  network 3.3.3.3 255.255.255.255

  network 10.214.50.0 255.255.255.0

  network 192.168.3.0 255.255.255.0

  peer 10.214.50.3 enable

#

·     MCE设备的配置文件

#

ip vpn-instance vpn1

 route-distinguisher 10:1

#

ip vpn-instance vpn2

 route-distinguisher 20:1

#

vlan 10

#

vlan 20 to 21

#

vlan 30

#

vlan 40

#

interface LoopBack0

 ip binding vpn-instance vpn1

 ip address 101.101.10.1 255.255.255.255

#

interface Vlan-interface10

 ip binding vpn-instance vpn1

 ip address 10.214.10.3 255.255.255.0

#

interface Vlan-interface20

 ip binding vpn-instance vpn2

 ip address 10.214.20.3 255.255.255.0

#

interface Vlan-interface21

 ip binding vpn-instance vpn2

 ip address 10.214.50.3 255.255.255.0

#

interface Vlan-interface30

 ip binding vpn-instance vpn1

 ip address 172.16.30.1 255.255.255.0

#

interface Vlan-interface40

 ip binding vpn-instance vpn2

 ip address 172.16.40.1 255.255.255.0

#

interface GigabitEthernet1/0/3

 port link-type trunk

 port trunk permit vlan 1 30 40

#

interface GigabitEthernet1/0/10

 port access vlan 10

#

interface GigabitEthernet1/0/20

 port access vlan 20

#

interface GigabitEthernet1/0/21

 port access vlan 21

#

bgp 100

 #

 address-family ipv4 unicast

 #

 ip vpn-instance vpn1

  peer 172.16.30.2 as-number 200

  #

  address-family ipv4 unicast

   import-route ospf 1

   network 172.16.30.0 255.255.255.0

 #

 ip vpn-instance vpn2

  peer 10.214.20.2 as-number 100

  peer 10.214.50.2 as-number 100

  peer 172.16.40.2 as-number 200

  #

  address-family ipv4 unicast

   network 10.214.20.0 255.255.255.0

   network 10.214.50.0 255.255.255.0

   network 172.16.40.0 255.255.255.0

   peer 10.214.20.2 enable

   peer 10.214.20.2 reflect-client

   peer 10.214.50.2 enable

   peer 10.214.50.2 reflect-client

   peer 172.16.40.2 enable

#

ospf 1 router-id 101.101.10.1 vpn-instance vpn1

 area 0.0.0.0

  network 10.214.10.0 0.0.0.255

#

·     PE 1设备的配置文件

#

ip vpn-instance vpn1

 route-distinguisher 10:1

#

ip vpn-instance vpn2

 route-distinguisher 20:1

#

vlan 30

#

vlan 40

#

interface LoopBack0

 ip binding vpn-instance vpn1

 ip address 100.100.11.1 255.255.255.255

#

interface LoopBack1

 ip binding vpn-instance vpn2

 ip address 100.100.21.1 255.255.255.255

#

interface Vlan-interface30

 ip binding vpn-instance vpn1

 ip address 172.16.30.2 255.255.255.0

#

interface Vlan-interface40

 ip binding vpn-instance vpn2

 ip address 172.16.40.2 255.255.255.0

#

interface GigabitEthernet1/0/18

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 30 40

#

bgp 200

 #

 ip vpn-instance vpn1

  peer 172.16.30.1 as-number 100

  #

  address-family ipv4 unicast

   network 172.16.30.0 255.255.255.0

   peer 172.16.30.1 enable

 #

 ip vpn-instance vpn2

  peer 172.16.40.1 as-number 100

  #

  address-family ipv4 unicast

   network 172.16.40.0 255.255.255.0

   peer 172.16.40.1 enable

#

5 相关资料

·     H3C S12500-S系列交换机 MPLS配置指导-R7536P05

·     H3C S12500-S系列交换机 MPLS命令参考-R7536P05

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们