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

07-MPLS配置举例

目录

09-H3C_GRE和VPN结合使用典型配置举例

本章节下载 09-H3C_GRE和VPN结合使用典型配置举例  (235.42 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500-S/Configure/Typical_Configuration_Example/H3C_S12500-S_CE-R7577P04-6W100/07/201904/1173250_30005_0.htm

09-H3C_GRE和VPN结合使用典型配置举例

H3C GRE和VPN结合使用典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

资料版本:6W100-20190330

产品版本:Release 7577P04

 

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

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

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



1  简介

在MPLS VPN中,CE(Customer Edge,用户网络边缘)和PE(Provider Edge,服务提供商网络边缘)之间往往需要通过直连(即同在一个网络中)的方式进行连接,但是在实际组网中,有可能出现CE和PE之间距离相距甚远的情况,无法做到两者之间的直连。为了让CE能够与PE直连,可以在两者之间配置GRE隧道,建立一条虚拟的点对点连接,这样,就可以看成是CE和PE直连了。

2  配置前提

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

本文档假设您已了解MPLS L3VPN和GRE特性。

3  GRE和VPN结合使用典型配置举例

3.1  组网需求

图1所示,Customer A和Customer B所在的分支机构属于VPN1,现要求通过MPLS L3VPN技术,实现用户数据可以通过VPN方式在各站点间安全传输,其中:

·              PE1和PE2属于MPLS骨干网络的边界设备;

·              CE1和CE2属于VPN1的用户网络边缘设备;

·              CE1和PE1之间存在一个其他网络的VPN2,且CE1和PE1之间路由可达。

图1 GRE和VPN结合使用典型配置组网图

 

3.2  配置思路

·              为了使报文能够通过MPLS网络传输,需要在MPLS骨干网络中配置IGP路由协议,并利用LDP分发公网标签,作为VPN报文的外层标签。

·              在PE设备之间配置MP-BGP协议并建立对等体,用于传输VPN的私网路由信息并分发内层标签,即私网标签。

·              在CE1和PE1之间建立GRE隧道,在逻辑上使CE1和PE1直连。

3.3  配置注意事项

由于在配置接口与VPN实例绑定后,接口上的IP地址等配置会清除,因此先配置接口与VPN实例的绑定关系,再进行其他配置。

3.4  配置步骤

1. 在MPLS骨干网上配置IGP协议(本例为OSPF协议),实现骨干网PE和P的互通

(1)      配置PE 1

# 配置骨干网接口以及环回口地址。

<PE1> system-view

[PE1] interface loopback 0

[PE1-LoopBack0] ip address 1.1.1.9 32

[PE1-LoopBack0] quit

[PE1] vlan 2

[PE1-vlan2] port ten-gigabitethernet 1/0/2

[PE1-vlan2] quit

[PE1] interface vlan-interface 2

[PE1-Vlan-interface2] ip address 10.1.1.1 24

[PE1-Vlan-interface2] quit

# 配置OSPF协议发布骨干网侧路由。

[PE1] ospf

[PE1-ospf-1] area 0

[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0

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

[PE1-ospf-1] quit

(2)      配置P

# 配置骨干网接口以及环回口地址。

<P> system-view

[P] interface loopback 0

[P-LoopBack0] ip address 2.2.2.9 32

[P-LoopBack0] quit

[P] vlan 2

[P-vlan2] port ten-gigabitethernet 1/0/2

[P-vlan2] quit

[P] vlan 5

[P-vlan5] port ten-gigabitethernet 1/0/3

[P-vlan5] quit

[P] interface vlan-interface 2

[P-Vlan-interface2] ip address 10.1.1.2 24

[P-Vlan-interface2] quit

[P] interface vlan-interface 5

[P-Vlan-interface5] ip address 10.1.4.1 24

[P-Vlan-interface5] quit

# 配置OSPF协议发布骨干网侧路由。

[P] ospf

[P-ospf-1] area 0

[P-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[P-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255

[P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0

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

[P-ospf-1] quit

(3)       配置PE 2

# 配置骨干网接口以及环回口地址。

<PE2> system-view

[PE2] interface loopback 0

[PE2-LoopBack0] ip address 3.3.3.9 32

[PE2-LoopBack0] quit

[PE2] vlan 5

[PE2-vlan5] port ten-gigabitethernet 1/0/1

[PE2-vlan5] quit

[PE2] interface vlan-interface 5

[PE2-Vlan-interface5] ip address 10.1.4.2 24

[PE2-Vlan-interface5] quit

# 配置OSPF协议发布骨干网侧路由。

[PE2] ospf

[PE2-ospf-1] area 0

[PE2-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255

[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0

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

[PE2-ospf-1] quit

配置完成后,PE 1、P、PE 2之间建立OSPF邻居,执行display ospf peer命令可以看到邻居达到Full状态。执行display ip routing-table命令可以看到PE之间学习到对方的Loopback路由。

以PE 1为例:

[PE1] display ospf peer verbose

 

          OSPF Process 1 with Router ID 1.1.1.9

                  Neighbors

 

 Area 0.0.0.0 interface 10.1.1.1(Vlan-interface2)'s neighbors

 Router ID: 2.2.2.9          Address: 10.1.1.2        GR State: Normal

   State: Full  Mode: Nbr is Master  Priority: 1

   DR: 10.1.1.2  BDR: 10.1.1.1  MTU: 0

   Options is 0x02 (-|-|-|-|-|-|E|-)

   Dead timer due in 38  sec

   Neighbor is up for 17:30:25

   Authentication Sequence: [ 0 ]

   Neighbor state change count: 6

   BFD status: Disabled

[PE1] display ip routing-table protocol ospf

 

Summary Count : 5

 

OSPF Routing table Status : <Active>

Summary Count : 3

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

2.2.2.9/32          OSPF   10   1            10.1.1.2        Vlan2

3.3.3.9/32          OSPF   10   2            10.1.1.2        Vlan2

10.1.4.0/24         OSPF   10   2            10.1.1.2        Vlan2

 

OSPF Routing table Status : <Inactive>

Summary Count : 2

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

1.1.1.9/32          OSPF   10   0            1.1.1.9         Loop0

10.1.1.0/24         OSPF   10   1            10.1.1.1        Vlan2

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

(1)      配置PE 1

[PE1] mpls lsr-id 1.1.1.9

[PE1] mpls ldp

[PE1-ldp] quit

[PE1] interface vlan-interface 2

[PE1-Vlan-interface2] mpls enable

[PE1-Vlan-interface2] mpls ldp enable

[PE1-Vlan-interface2] quit

(2)      配置P

[P] mpls lsr-id 2.2.2.9

[P] mpls ldp

[P-ldp] quit

[P] interface vlan-interface 2

[P-Vlan-interface2] mpls enable

[P-Vlan-interface2] mpls ldp enable

[P-Vlan-interface2] quit

[P] interface vlan-interface 5

[P-Vlan-interface5] mpls enable

[P-Vlan-interface5] mpls ldp enable

[P-Vlan-interface5] quit

(3)      配置PE 2

[PE2] mpls lsr-id 3.3.3.9

[PE2] mpls ldp

[PE2-ldp] quit

[PE2] interface vlan-interface 5

[PE2-Vlan-interface5] mpls enable

[PE2-Vlan-interface5] mpls ldp enable

[PE2-Vlan-interface5] quit

上述配置完成后,PE 1、P、PE 2之间应能建立LDP会话,执行display mpls ldp peer命令可以看到LDP会话的状态为Operational。执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。

以PE 1为例:

[PE1] display mpls ldp peer

Total number of peers: 1

Peer LDP ID             State         Role     GR   MD5  KA Sent/Rcvd

2.2.2.9:0               Operational   Passive  Off  Off  5/5

[PE1] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup

FECs: 4            Ingress: 1          Transit: 1      Egress: 3

 

FEC                In/Out Label        Nexthop         OutInterface

1.1.1.9/32         3/-

                   -/1151(L)

2.2.2.9/32         -/3                 10.1.1.2        Vlan2

                   1151/3              10.1.1.2        Vlan2

3.3.3.9/32         -/1150              10.1.1.2        Vlan2

                   1150/1150           10.1.1.2        Vlan2

3. 在PE1和CE1上配置VPN实例,并配置PE1和CE1之间的GRE隧道,将CE1接入PE1

(1)      配置PE1

# 在PE1上创建VPN实例,名为“VPN1”。

[PE1] ip vpn-instance vpn1

# 为该实例配置RD为100:1。

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

# 为该VPN实例配置VPN Target属性。

[PE1-vpn-instance-vpn1] vpn-target 100:1 import-extcommunity

[PE1-vpn-instance-vpn1] vpn-target 100:1 export-extcommunity

[PE1-vpn-instance-vpn1] quit

# 配置Vlan-interface100与VPN实例进行绑定。

[PE1] vlan 100

[PE1-vlan100] port ten-gigabitethernet 1/0/1

[PE1-vlan100] quit

[PE1] interface vlan-interface 100

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

[PE1-Vlan-interface100] ip address 200.1.1.2 24

[PE1-Vlan-interface100] quit

(2)      配置CE1

# 在CE1上创建VPN实例,名为“VPN1”。

[CE1] ip vpn-instance vpn1

# 为该实例配置RD为100:1。

[CE1-vpn-instance-vpn1] route-distinguisher 100:1

# 为该VPN实例配置VPN Target属性。

[CE1-vpn-instance-vpn1] vpn-target 100:1 import-extcommunity

[CE1-vpn-instance-vpn1] vpn-target 100:1 export-extcommunity

[CE1-vpn-instance-vpn1] quit

# 配置Vlan-interface101与VPN实例进行绑定。

[CE1] vlan 101

[CE1-vlan101] port ten-gigabitethernet 1/0/1

[CE1-vlan101] quit

[CE1] interface vlan-interface 101

[CE1-Vlan-interface101] ip binding vpn-instance vpn1

[CE1-Vlan-interface101] ip address 100.1.1.1 24

[CE1-Vlan-interface101] quit

(3)      配置CE1和PE1之间的GRE隧道

·              配置CE1

# 创建业务环回组1,并配置服务类型为Tunnel。

[CE1] service-loopback group 1 type tunnel

# 将接口Ten-gigabitethernet1/0/3加入业务环回组1。

[CE1] interface ten-gigabitethernet 1/0/3

[CE1-Ten-gigabitethernet1/0/3] port service-loopback group 1

[CE1-Ten-gigabitethernet1/0/3] quit

# 创建Tunnel1接口,并指定隧道模式为GRE over IPv4隧道。

[CE1] interface tunnel 1 mode gre

# 指定隧道源端地址所属的VPN实例

[CE1-Tunnel1] ip binding vpn-instance vpn1

# 配置Tunnel1接口的IP地址。

[CE1-Tunnel1] ip address 20.1.1.1 255.255.255.0

# 配置Tunnel1接口的源端地址(CE1的Vlan-interface101的IP地址)。

[CE1-Tunnel1] source vlan-interface 101

# 配置Tunnel1接口的目的端地址(PE1的Vlan-interface100的IP地址)。

[CE1-Tunnel1] destination 200.1.1.2

# 配置隧道目的端地址所属的VPN实例

[CE1-Tunnel1] tunnel vpn-instance vpn1

[CE1-Tunnel1] quit

# 配置Customer A经过Tunnel1接口到Customer B的静态路由。

[CE1] ip route-static vpn-instance vpn1 172.2.0.0 24 tunnel 1

·              配置PE1

# 创建业务环回组1,并配置服务类型为Tunnel。

[PE1] service-loopback group 1 type tunnel

# 将接口Ten-gigabitethernet1/0/3加入业务环回组1。

[PE1] interface ten-gigabitethernet 1/0/3

[PE1-Ten-gigabitethernet1/0/3] port service-loopback group 1

[PE1-Ten-gigabitethernet1/0/3] quit

# 创建Tunnel1接口,并指定隧道模式为GRE over IPv4隧道。

[PE1] interface tunnel 1 mode gre

# 指定隧道源端地址所属的VPN实例

[PE1-Tunnel1] ip binding vpn-instance vpn1

# 配置Tunnel1接口的IP地址。

[PE1-Tunnel1] ip address 20.1.1.2 255.255.255.0

# 配置Tunnel1接口的源端地址(PE1的Vlan-interface100的IP地址)。

[PE1-Tunnel1] source vlan-interface 100

# 配置Tunnel1接口的目的端地址(CE1的Vlan-interface101的IP地址)。

[PE1-Tunnel1] destination 100.1.1.1

# 配置隧道目的端地址所属的VPN实例

[PE1-Tunnel1] tunnel vpn-instance vpn1

[PE1-Tunnel1] quit

# 配置Customer B经过Tunnel1接口到Customer A的静态路由。

[PE1] ip route-static vpn-instance vpn1 172.1.0.0 24 Tunnel 1

4. 在PE2上配置VPN实例, 将CE2接入PE2

(1)      配置PE2

# 在PE2上创建VPN实例,名为“vpn1”。

[PE2] ip vpn-instance vpn1

# 为该VPN实例配置RD。

[PE2-vpn-instance-vpn1] route-distinguisher 100:1

# 为该VPN实例配置VPN Target,需要注意的是接收和发送的属性要分别与PE 1上配置的发送和接收的属性保持一致。

[PE2-vpn-instance-vpn1] vpn-target 100:1 import-extcommunity

[PE2-vpn-instance-vpn1] vpn-target 100:1 export-extcommunity

[PE2-vpn-instance-vpn1] quit

# 将Vlan-interface101与vpn1实例进行绑定。

[PE2] vlan 101

[PE2-vlan101] port ten-gigabitethernet 1/0/2

[PE2-vlan101] quit

[PE2] interface vlan-interface 101

[PE2-Vlan-interface101] ip binding vpn-instance vpn1

[PE2-Vlan-interface101] ip address 101.1.1.1 24

[PE2-Vlan-interface101] quit

(2)      配置CE2

图1配置CE2的接口IP地址,配置过程略。

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

[PE2] display ip vpn-instance

  Total VPN-Instances configured : 1

  VPN-Instance Name               RD                     Create time

  vpn1                            100:1                  2016/06/22 13:20:08

[PE2] ping -vpn-instance vpn1 101.1.1.2

Ping 10.1.4.2 (101.1.1.2): 56 data bytes, press CTRL_C to break

56 bytes from 101.1.1.2: icmp_seq=0 ttl=255 time=1.000 ms

56 bytes from 101.1.1.2: icmp_seq=1 ttl=255 time=2.000 ms

56 bytes from 101.1.1.2: icmp_seq=2 ttl=255 time=0.000 ms

56 bytes from 101.1.1.2: icmp_seq=3 ttl=255 time=1.000 ms

56 bytes from 101.1.1.2: icmp_seq=4 ttl=255 time=0.000 ms

 

--- Ping statistics for 10.1.1.1 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.800/2.000/0.748 ms

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

(1)      配置PE1

# 在PE1上创建BGP进程100。

[PE1] bgp 100

# 将CE1指定为对等体,并将PE 1的直连路由引入到BGP-VPN实例路由表中。

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

[PE1-bgp-default-vpn1] peer 20.1.1.1 as-number 65410

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

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

[PE1-bgp-default-ipv4-vpn1] import-route direct

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

[PE1-bgp-default-vpn1] quit

(2)      配置PE 2

# 在PE 2上创建BGP进程100。

[PE2] bgp 100

# 将CE 2指定为对等体,并将PE 2的直连路由引入到BGP-VPN实例路由表中。

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

[PE2-bgp-default-vpn1] peer 101.1.1.2 as-number 65410

[PE2-bgp-default-vpn1] address-family ipv4 unicast

[PE2-bgp-default-ipv4-vpn1] peer 101.1.1.2 enable

[PE2-bgp-default-ipv4-vpn1] import-route direct

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

[PE2-bgp-default-vpn1] quit

(3)      配置CE1

# CE1上创建BGP进程65410,并指定PE1为对等体,对等体自治系统号为100。

<CE1> system-view

[CE1] bgp 65410

[CE1-bgp-default] peer 20.1.1.2 as-number 100

# 使能CE1与对等体20.1.1.2交换IPv4单播路由信息的能力。

[CE1-bgp-default] address-family ipv4 unicast

[CE1-bgp-default-ipv4] peer 20.1.1.2 enable

# 将CE 1上连接站点的直连接口路由引入EBGP。

[CE1-bgp-default-ipv4] import-route direct

[CE1-bgp-default-ipv4] quit

[CE1-bgp-default] quit

(4)      配置CE2

# CE2上创建BGP进程65410,并指定PE2为对等体,对等体自治系统号为100。

<CE2> system-view

[CE2] bgp 65410

[CE2-bgp-default] peer 101.1.1.1 as-number 100

# 使能CE2与对等体101.1.1.1交换IPv4单播路由信息的能力。

[CE2-bgp-default] address-family ipv4 unicast

[CE2-bgp-default-ipv4] peer 101.1.1.1 enable

# 将CE2上连接站点的直连接口路由引入EBGP。

[CE2-bgp-default-ipv4] import-route direct

[CE2-bgp-default-ipv4] quit

[CE2-bgp-default] quit

配置完成后,在PE2设备上执行display bgp peer ipv4 vpn-instance命令,可以看到PE2与CE2之间的BGP对等体关系已建立,并达到Established状态。

[PE2] display bgp peer ipv4 vpn-instance vpn1

 BGP local router ID: 3.3.3.9

 Local AS number: 100

 Total number of peers: 1                  Peers in established state: 1

 

  Peer                  AS          MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  101.1.1.2             65430        4        4    0       2 13:35:25      Established

6. 在PE之间建立MP-IBGP对等体

(1)      配置PE 1

# 在PE 1上配置PE 2为BGP对等体,并指定连接时使用的接口为Loopback0接口。

[PE1] bgp 100

[PE1-bgp-default] peer 3.3.3.9 as-number 100

[PE1-bgp-default] peer 3.3.3.9 connect-interface loopback 0

# 进入BGP-VPNv4地址族视图,指定PE 2为对等体。

[PE1-bgp-default] address-family vpnv4

[PE1-bgp-default-vpnv4] peer 3.3.3.9 enable

[PE1-bgp-default-vpnv4] quit

[PE1-bgp-default] quit

(2)      配置PE 2

# 在PE 2上配置PE 1为BGP对等体,并指定连接时使用的接口为Loopback0接口。

[PE2] bgp 100

[PE2-bgp-default] peer 1.1.1.9 as-number 100

[PE2-bgp-default] peer 1.1.1.9 connect-interface loopback 0

# 进入BGP-VPNv4地址族视图,指定PE 1为对等体。

[PE2-bgp-default] address-family vpnv4

[PE2-bgp-default-vpnv4] peer 1.1.1.9 enable

[PE2-bgp-default-vpnv4] quit

[PE2-bgp-default] quit

配置完成后,在PE设备上执行display bgp peer vpnv4命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。

[PE1] display bgp peer vpnv4

 

 BGP local router ID: 1.1.1.9

 Local AS number: 100

 Total number of peers: 1                  Peers in established state: 1

 

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  3.3.3.9                100        8        8    0       0 00:00:08 Established

3.5  验证配置

在PE设备上执行display ip routing-table vpn-instance命令,可以看到去往对端CE的路由。

以PE 1上的vpn1为例:

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

 

Destinations : 13        Routes : 13

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

0.0.0.0/32          Direct 0    0            127.0.0.1       InLoop0

20.1.1.0/24         Direct  0   0            20.1.1.2        Tun0

20.1.1.0/32         Direct  0   0            20.1.1.2        Tun0

20.1.1.2/32         Direct  0   0            127.0.0.1       InLoop0

200.1.1.0/24        Direct 0    0            200.1.1.2       Vlan100

200.1.1.0/32        Direct 0    0            200.1.1.2       Vlan100

200.1.1.2/32        Direct 0    0            127.0.0.1       InLoop0

200.1.1.255/32      Direct 0    0            100.1.1.2       Vlan100

101.1.1.0/24        BGP    255  0            3.3.3.9         Vlan2

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

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

3.6  配置文件

·              PE 1

#

ip vpn-instance vpn1

 route-distinguisher 100:1

 vpn-target 100:1 import-extcommunity

 vpn-target 100:1 export-extcommunity

#

 service-loopback group 1 type tunnel

#

ospf 1

 area 0.0.0.0

  network 1.1.1.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

#

 mpls lsr-id 1.1.1.9

#

vlan 2

#

vlan 100

#

mpls ldp

#

interface LoopBack0

 ip address 1.1.1.9 255.255.255.255

#

interface Vlan-interface2

 ip address 10.1.1.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface100

 ip binding vpn-instance vpn1

 ip address 200.1.1.2 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 100

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 2

#

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel1 mode gre

 ip binding vpn-instance vpn1

 ip address 20.1.1.2 255.255.255.0

 source Vlan-interface100

 tunnel vpn-instance vpn1

 destination 100.1.1.1

#

bgp 100

 peer 3.3.3.9 as-number 100

 peer 3.3.3.9 connect-interface LoopBack0

 #

 address-family vpnv4

  peer 3.3.3.9 enable

 #

 ip vpn-instance vpn1

  peer 20.1.1.1 as-number 65410

  #

  address-family ipv4 unicast

   import-route direct

   peer 20.1.1.1 enable

#

 ip route-static vpn-instance vpn1 172.1.0.0 24 Tunnel1

·              P

#

ospf 1

 area 0.0.0.0

  network 2.2.2.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 10.1.4.0 0.0.0.255

#

 mpls lsr-id 2.2.2.9

#

vlan 2

#

vlan 5

#

mpls ldp

#

interface LoopBack0

 ip address 2.2.2.9 255.255.255.255

#

interface Vlan-interface2

 ip address 10.1.1.2 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface5

 ip address 10.1.4.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 2

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port access vlan 5

#

·              PE 2

#

ip vpn-instance vpn1

 route-distinguisher 100:1

 vpn-target 100:1 import-extcommunity

 vpn-target 100:1 export-extcommunity

#

ospf 1

 area 0.0.0.0

  network 3.3.3.9 0.0.0.0

  network 10.1.4.0 0.0.0.255

#

 mpls lsr-id 3.3.3.9

#

 lldp global enable

#

vlan 5

#

vlan 101

#

mpls ldp

#

interface LoopBack0

 ip address 3.3.3.9 255.255.255.255

#

interface Vlan-interface5

 ip address 10.1.4.2 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface101

 ip binding vpn-instance vpn1

 ip address 101.1.1.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 5

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 101

#

bgp 100

 peer 1.1.1.9 as-number 100

 peer 1.1.1.9 connect-interface LoopBack0

 #

 address-family vpnv4

  peer 1.1.1.9 enable

 #

 ip vpn-instance vpn1

  peer 101.1.1.2 as-number 65410

  #

  address-family ipv4 unicast

   import-route direct

   peer 101.1.1.2 enable

#

·              CE 1

#

ip vpn-instance vpn1

 route-distinguisher 100:1

 vpn-target 100:1 import-extcommunity

 vpn-target 100:1 export-extcommunity

#

 service-loopback group 1 type tunnel

#

vlan 101

#

interface Vlan-interface101

 ip binding vpn-instance vpn1

 ip address 100.1.1.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 101

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel1 mode gre

 ip binding vpn-instance vpn1

 ip address 20.1.1.1 255.255.255.0

 source Vlan-interface101

 tunnel vpn-instance vpn1

 destination 200.1.1.2

#

bgp 65410

 peer 20.1.1.2 as-number 100

 #

 address-family ipv4 unicast

  import-route direct

  peer 20.1.1.2 enable

#

 ip route-static vpn-instance vpn1 172.2.0.0 24 Tunnel1

#

·              CE 2

#

vlan 101

#

interface Vlan-interface101

 ip address 101.1.1.2 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 101

#

bgp 65410

 peer 101.1.1.1 as-number 100

 #

 address-family ipv4 unicast

  import-route direct

  peer 101.1.1.1 enable

#

4  相关资料

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

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

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

新华三官网
联系我们