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

H3C MSR系列路由器典型配置举例(V5)-6W100

目录

77-MSR系列路由器与Cisco路由器MPLS VPN多标签对接的典型配置举例

本章节下载 77-MSR系列路由器与Cisco路由器MPLS VPN多标签对接的典型配置举例  (165.2 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/MSR/MSR_50/Configure/Typical_Configuration_Example/H3C_MSR_(V5)-6W100/201401/812788_30005_0.htm

77-MSR系列路由器与Cisco路由器MPLS VPN多标签对接的典型配置举例

MSR系列路由器与Cisco路由器MPLS VPN多标签对接的典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H3C_彩色.emf

目  录

1 简介

2 配置前提

3 配置举例

3.1 组网需求

3.2 配置思路

3.3 使用版本

3.4 配置步骤

3.4.1 设备SPE 1配置

3.4.2 设备UPE 1配置

3.4.3 设备SPE 2配置

3.4.4 设备UPE 2配置

3.5 验证配置

3.6 配置文件

4 相关资料


1  简介

本文档介绍使用LDP与TDP做MPLS VPN多标签对接的典型案例。

2  配置前提

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

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

本文档假设您已了解LDP和TDP的特性。

3  配置举例

3.1  组网需求

图1所示,MSR路由器和Cisco路由器为MPLS VPN连接,MSR侧启用LDP标签,Cisco设备侧启用TDP标签,两侧均为SPE-UPE模式,在UPE设备上启用三层子接口通过交换机连接到主机。现要求:MSR侧的Host1与Cisco设备侧的Host 2能够通过MPLS VPN骨干网进行连通。

图1 MSR系列路由器与Cisco路由器MPLS VPN多标签对接案例组网图

设备

接口

IP地址

设备

接口

IP地址

SPE 1

Loop0

1.1.1.1/32

SPE 2

Loop0

2.2.2.2/32

 

Eth0/0

10.1.1.1/24

 

Eth0/0

10.1.1.2/24

 

Eth0/1

172.16.1.1/24

 

Eth0/1

172.16.2.1/24

UPE 1

Loop0

3.3.3.3/32

UPE 2

Loop0

4.4.4.4/32

 

Eth0/1

172.16.1.2/24

 

Eth0/1

172.16.2.2/24

 

Eth0/0.1

192.168.1.1/24

 

Eth0/0.1

192.168.2.1/24

Host 1

-

192.168.1.2/24

Host 2

-

192.168.2.2/24

 

3.2  配置思路

为了使同侧的PE路由器能够互相转发VPN路由,需要在SPE上指定对应的对等体UPE,将SPE的VPN路由发送给UPE,同时通过路由策略使得对端的UPE路由能够到达本端的UPE上。

3.3  使用版本

本举例是在Release 2311版本上进行配置和验证的。

3.4  配置步骤

3.4.1  设备SPE 1配置

# 配置设备接口地址。

<SPE1> system-view

[SPE1] interface loopback 0

[SPE1-LoopBack0] ip address 1.1.1.1 255.255.255.255

[SPE1-LoopBack0] quit

[SPE1] interface ethernet 0/0

[SPE1-Ethernet0/0] port link-mode route

[SPE1-Ethernet0/0] ip address 10.1.1.1 255.255.255.0

[SPE1-Ethernet0/0] quit

[SPE1] interface ethernet 0/1

[SPE1-Ethernet0/1] port link-mode route

[SPE1-Ethernet0/1] ip address 172.16.1.1 255.255.255.0

[SPE1-Ethernet0/1] quit

# 配置OSPF协议,使网络互通。

[SPE1] ospf 1

[SPE1-ospf-1] area 0.0.0.0

[SPE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0

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

[SPE1-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255

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

[SPE1-ospf-1] quit

# 配置MPLS LSR-ID,使能MPLS和MPLS LDP功能。

[SPE1] router id 1.1.1.1

[SPE1] mpls lsr-id 1.1.1.1

[SPE1] mpls

[SPE1-mpls] quit

[SPE1] mpls ldp

[SPE1-mpls-ldp] quit

# 在接口Ethernet0/0和Ethernet0/1配置MPLS和MPLS LDP功能。

[SPE1] interface ethernet 0/0

[SPE1-Ethernet0/0] mpls

[SPE1-Ethernet0/0] mpls ldp

[SPE1-Ethernet0/0] quit

[SPE1] interface ethernet 0/1

[SPE1-Ethernet0/1] mpls

[SPE1-Ethernet0/1] mpls ldp

[SPE1-Ethernet0/1] quit

# 创建VPN实例vpna,并配置RD和VPN Target属性。

[SPE1] ip vpn-instance vpna

[SPE1-vpn-instance-vpna] route-distinguisher 1:1

[SPE1-vpn-instance-vpna] vpn-target 1:1 export-extcommunity

[SPE1-vpn-instance-vpna] vpn-target 1:1 import-extcommunity

[SPE1-vpn-instance-vpna] quit

# 在PE间建立MP-IBGP对等体。

[SPE1] bgp 1

[SPE1-bgp] peer 2.2.2.2 as-number 1

[SPE1-bgp] peer 2.2.2.2 connect-interface loopback0

[SPE1-bgp] peer 3.3.3.3 as-number 1

[SPE1-bgp] peer 3.3.3.3 connect-interface loopback0

# 进入BGP-VPN实例视图,将直连路由引入到vpna的路由表。

[SPE1-bgp] ipv4-family vpn-instance vpna

[SPE1-bgp-ipv4-vpna] import-route direct

[SPE1-bgp-ipv4-vpna] quit

# 进入BGP-VPNv4子地址族视图,配置对等体2.2.2.2和3.3.3.3,将本地作为路由反射器,对等体2.2.2.2和3.3.3.3作为路由反射器客户端。

[SPE1-bgp] ipv4-family vpnv4

[SPE1-bgp-af-vpnv4] peer 2.2.2.2 enable

[SPE1-bgp-af-vpnv4] peer 2.2.2.2 reflect-client

[SPE1-bgp-af-vpnv4] peer 3.3.3.3 enable

[SPE1-bgp-af-vpnv4] peer 3.3.3.3 reflect-client

[SPE1-bgp-af-vpnv4] quit

[SPE1-bgp] quit

# 创建前缀列表,允许UPE 2的路由通过。

[SPE1] ip ip-prefix hope index 10 permit 192.168.2.0 24

# 定义策略路由policy1,匹配前缀列表hope

[SPE1] route-policy policy1 permit node 0

[SPE1-route-policy] if-match ip-prefix hope

[SPE1-route-policy] quit

# 指定对等体3.3.3.3SPE 1UPE,并向3.3.3.3发送通过路由策略policy1的路由信息。

[SPE1] bgp 1

[SPE1-bgp] ipv4-family vpnv4

[SPE1-bgp-af-vpnv4] peer 3.3.3.3 upe

[SPE1-bgp-af-vpnv4] peer 3.3.3.3 upe route-policy policy1 export

[SPE1-bgp-af-vpnv4] quit

[SPE1-bgp] quit

3.4.2  设备UPE 1配置

# 配置设备接口地址。

<UPE1> system-view

[UPE1] interface loopback 0

[UPE1-LoopBack0] ip address 3.3.3.3 255.255.255.255

[UPE1-LoopBack0] quit

[UPE1] interface ethernet 0/1

[UPE1-Ethernet0/1] ip address 172.16.1.2 255.255.255.0

[UPE1-Ethernet0/1] quit

# 配置子接口IP地址,使能VLAN终结。

[UPE1] interface ethernet 0/0.1

[UPE1-Ethernet0/0.1] vlan-type dot1q vid 2

[UPE1-Ethernet0/0.1] ip address 192.168.1.1 255.255.255.0

[UPE1-Ethernet0/0.1] quit

# 配置OSPF协议,使网络互通。

[UPE1] ospf 1

[UPE1-ospf-1] area 0.0.0.0

[UPE1-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0

[UPE1-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255

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

[UPE1-ospf-1] quit

# 配置MPLS LSR-ID,使能MPLSMPLS LDP功能。

[UPE1] router id 3.3.3.3

[UPE1] mpls lsr-id 3.3.3.3

[UPE1] mpls

[UPE1-mpls] quit

[UPE1] mpls ldp

[UPE1-mpls-ldp] quit

# 在接口Ethernet0/1配置MPLS和MPLS LDP功能。

[UPE1] interface ethernet 0/1

[UPE1-Ethernet0/1] mpls

[UPE1-Ethernet0/1] mpls ldp

[UPE1-Ethernet0/1] quit

# 创建VPN实例vpna,并配置RD和VPN Target属性。

[UPE1] ip vpn-instance vpna

[UPE1-vpn-instance-vpna] route-distinguisher 3:1

[UPE1-vpn-instance-vpna] vpn-target 1:1 export-extcommunity

[UPE1-vpn-instance-vpna] vpn-target 1:1 import-extcommunity

[UPE1-vpn-instance-vpna] quit

# 将子接口Ethernet0/0.1绑定到vpna上。

[UPE1] interface ethernet 0/0.1

[UPE1-Ethernet0/0.1] ip binding vpn-instance vpna

[UPE1-Ethernet0/0.1] ip address 192.168.1.1 255.255.255.0

[UPE1-Ethernet0/0.1] quit

# 在PE间建立MP-IBGP对等体。

[UPE1] bgp 1

[UPE1-bgp] peer 1.1.1.1 as-number 1

[UPE1-bgp] peer 1.1.1.1 connect-interface loopback0

# 进入BGP-VPN实例视图,将直连路由引入到vpna的路由表。

[UPE1-bgp] ipv4-family vpn-instance vpna

[UPE1-bgp-ipv4-vpna] import-route direct

[UPE1-bgp-ipv4-vpna] quit

# 进入BGP-VPNv4子地址族视图,配置对等体1.1.1.1。

[UPE1-bgp] ipv4-family vpnv4

[UPE1-bgp-af-vpnv4] peer 1.1.1.1 enable

[UPE1-bgp-af-vpnv4] quit

3.4.3  设备SPE 2配置

# 配置设备接口地址。

SPE2> enable

SPE2# configure terminal

SPE2(config)# interface loopback 0

SPE2(config-if)# ip address 2.2.2.2 255.255.255.255

SPE2(config-if)# exit

SPE2(config)# interface ethernet 0/0

SPE2(config-if)# ip address 10.1.1.2 255.255.255.0

SPE2(config-if)# exit

SPE2(config)# interface ethernet 0/1

SPE2(config-if)# ip address 172.16.2.1 255.255.255.0

SPE2(config-if)# exit

# 配置OSPF协议,使网络互通。

SPE2(config)# router ospf 1

SPE2(config-router)# network 2.2.2.2 0.0.0.0 area 0

SPE2(config-router)# network 10.1.1.0 0.0.0.255 area 0

SPE2(config-router)# network 172.16.2.0 0.0.0.255 area 0

SPE2(config-router)# exit

#使能MPLS TDP,MPLS LDP。

SPE2(config)# mpls label protocol tdp

SPE2(config)# mpls label protocol ldp

# 在接口Ethernet0/0配置MPLS和MPLS LDP功能。

SPE2(config)# interface ethernet 0/0

SPE2(config-if)# mpls ip

SPE2(config-if)# mpls label protocol ldp

SPE2(config-if)# exit

# 在接口Ethernet0/1配置MPLS和MPLS TDP功能,建立TDP LSP。

SPE2(config)# interface ethernet 0/1

SPE2(config-if)# mpls ip

SPE2(config-if)# mpls label protocol tdp

SPE2(config-if)# exit

# 创建VPN实例vpna,并配置RD和Route target属性。

SPE2(config)# ip vrf vpna

SPE2(config-vrf)# rd 2:1

SPE2(config-vrf)# route-target export 1:1

SPE2(config-vrf)# route-target import 1:1

SPE2(config-vrf)# exit

# 在SPE2上建立路由反射器,在PE间建立MP-IBGP对等体。

SPE2(config)# router bgp 1

SPE2(config-router)# neighbor RR peer-group

SPE2(config-router)# neighbor RR remote-as 1

SPE2(config-router)# neighbor RR update-source Loopback0

SPE2(config-router)# neighbor 1.1.1.1 peer-group RR

SPE2(config-router)# neighbor 4.4.4.4 peer-group RR

# 进入BGP-VPN实例视图,将直连路由引入到vpna的路由表。

SPE2(config-router)# address-family ipv4 vrf vpna

SPE2(config-router-af)# redistribute connected

SPE2(config-router-af)# exit

# 进入BGP-VPNv4子地址族视图,配置对等体1.1.1.1和4.4.4.4。

SPE2(config-router)# address-family vpnv4

SPE2(config-router-af)# neighbor 1.1.1.1 activate

SPE2(config-router-af)# neighbor 1.1.1.1 send-community extended

SPE2(config-router-af)# neighbor 1.1.1.1 route-reflector-client

SPE2(config-router-af)# neighbor 4.4.4.4 activate

SPE2(config-router-af)# neighbor 4.4.4.4 send-community extended

SPE2(config-router-af)# neighbor 4.4.4.4 route-reflector-client

SPE2(config-router-af)# exit

# 创建前缀列表hope,允许UPE 1的路由通过。

SPE2(config)# ip prefix-list hope seq 5 permit 192.168.1.0/24

# 定义策略路由信息hope,匹配前缀列表hope

SPE2(config)# route-map policy1 permit 10

SPE2(config-route-map)# match ip address prefix-list hope

SPE2(config-route-map)# exit

# 指定对等体4.4.4.4SPE 2UPE,并向4.4.4.4发送通过路由策略policy1的路由信息。

SPE2(config)# router bgp 1

SPE2(config-router)# address-family vpnv4

SPE2(config-router-af)# neighbor 4.4.4.4 route-map policy1 out

SPE2(config-router-af)# exit

SPE2(config-router)# exit

3.4.4  设备UPE 2配置

# 配置设备接口地址。

UPE2> enable

UPE2# configure terminal

UPE2(config)# interface loopback 0

UPE2(config-if)# ip address 4.4.4.4 255.255.255.255

UPE2(config-if)# exit

UPE2(config)# interface ethernet 0/1

UPE2(config-if)# ip address 172.16.2.2 255.255.255.0

UPE2(config-if)# exit

# 配置子接口IP地址,封装为dot1Q模式。

UPE2(config)# interface ethernet 0/0.1

UPE2(config-if)# encapsulation dot1q 2

UPE2(config-if)# ip address 192.168.2.1 255.255.255.0

UPE2(config-if)# exit

# 配置OSPF协议,使网络互通。

UPE2(config)# router ospf 1

UPE2(config-router)# network 4.4.4.4 0.0.0.0 area 0

UPE2(config-router)# network 172.16.2.0 0.0.0.255 area 0

UPE2(config-router)# exit

#使能MPLS TDP功能。

UPE2(config)# mpls label protocol tdp

# 在接口Ethernet0/1配置MPLS和MPLS TDP功能,建立TDP LSP。

UPE2(config)#interface ethernet 0/1

UPE2(config-if)# mpls label protocol tdp

UPE2(config-if)# mpls ip

UPE2(config-if)# exit

# 创建VPN实例vpna,并配置RD和Route target属性。

UPE2(config)# ip vrf vpna

UPE2(config-vrf)# rd 4:1

UPE2(config-vrf)# route-target export 1:1

UPE2(config-vrf)# route-target import 1:1

UPE2(config-vrf)# exit

# 将子接口Ethernet0/0.1绑定到vpna上。

UPE2(config)# interface ethernet 0/0.1

UPE2(config-if)# ip vrf forwarding vpna

UPE2(config-if)# ip address 192.168.2.1 255.255.255.0

UPE2(config-if)# exit

# 在PE间建立MP-IBGP对等体。

UPE2(config)#router bgp 1

UPE2(config-router)# neighbor 2.2.2.2 remote-as 1

UPE2(config-router)# neighbor 2.2.2.2 update-source Loopback0

# 进入BGP-VPN实例视图,将直连路由引入到vpna的路由表。

UPE2(config-router)# address-family ipv4 vrf vpna

UPE2(config-router-af)# redistribute connected

UPE2(config-router-af)# exit

# 进入BGP-VPNv4子地址族视图,配置对等体2.2.2.2。

UPE2(config-router)# address-family vpnv4

UPE2(config-router-af)# neighbor 2.2.2.2 activate

UPE2(config-router-af)# neighbor 2.2.2.2 send-community extended

UPE2(config-router-af)# exit

UPE2(config-router)# exit

3.5  验证配置

# 在Host 1上ping Host 2的接口地址,看能否ping通。

C:\Documents and Settings\Administrator> ping 192.168.2.2

 

Pinging 192.168.2.2 with 32 bytes of data:

 

Reply from 192.168.2.2: bytes=32 time=9ms TTL=253

Reply from 192.168.2.2: bytes=32 time<1ms TTL=253

Reply from 192.168.2.2: bytes=32 time<1ms TTL=253

Reply from 192.168.2.2: bytes=32 time<1ms TTL=253

 

Ping statistics for 192.168.2.2:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 9ms, Average = 2ms

3.6  配置文件

·     SPE 1:

#

 router id 1.1.1.1

#

 mpls lsr-id 1.1.1.1

#

ip vpn-instance vpna

 route-distinguisher 1:1

 vpn-target 1:1 export-extcommunity

 vpn-target 1:1 import-extcommunity

#

mpls

#

mpls ldp

#

interface Ethernet0/0

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

 mpls

 mpls ldp

#

interface Ethernet0/1

 port link-mode route

 ip address 172.16.1.1 255.255.255.0

 mpls

 mpls ldp

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

#

bgp 1

 undo synchronization

 peer 2.2.2.2 as-number 1

 peer 2.2.2.2 connect-interface LoopBack0

 peer 3.3.3.3 as-number 1

 peer 3.3.3.3 connect-interface LoopBack0

 #

 ipv4-family vpn-instance vpna

  import-route direct

 #

 ipv4-family vpnv4

  peer 2.2.2.2 enable

  peer 2.2.2.2 reflect-client

  peer 3.3.3.3 enable

  peer 3.3.3.3 reflect-client

  peer 3.3.3.3 upe

  peer 3.3.3.3 upe route-policy policy1 export

#

ospf 1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.0

  network 172.16.1.0 0.0.0.255

  network 10.1.1.0 0.0.0.255

#

route-policy policy1 permit node 0

 if-match ip-prefix hope

#

 ip ip-prefix hope index 10 permit 192.168.2.0 24

#

·     UPE 1:

#

 router id 3.3.3.3

#

 mpls lsr-id 3.3.3.3

#

ip vpn-instance vpna

 route-distinguisher 3:1

 vpn-target 1:1 export-extcommunity

 vpn-target 1:1 import-extcommunity

#

mpls

#

mpls ldp

#

interface Ethernet0/0.1

 vlan-type dot1q vid 2

 ip binding vpn-instance vpna

 ip address 192.168.1.1 255.255.255.0

#

interface Ethernet0/1

 ip address 172.16.1.2 255.255.255.0

 mpls

 mpls ldp

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

bgp 1

 undo synchronization

 peer 1.1.1.1 as-number 1

 peer 1.1.1.1 connect-interface LoopBack0

 #

 ipv4-family vpn-instance vpna

  import-route direct

 #

 ipv4-family vpnv4

  peer 1.1.1.1 enable

#

ospf 1

 area 0.0.0.0

  network 3.3.3.3 0.0.0.0

  network 172.16.1.0 0.0.0.255

#

·     SPE 2:

!

hostname SPE2

!

ip cef

!

ip vrf vpna

 rd 2:1

 route-target export 1:1

 route-target import 1:1

!

mpls label protocol tdp

mpls label protocol ldp

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

!

interface Ethernet0/0

 ip address 10.1.1.2 255.255.255.0

 mpls label protocol tdp

 mpls ip

!

interface Ethernet0/1

 ip address 172.16.2.1 255.255.255.0

 mpls label protocol tdp

 mpls ip

!

router ospf 1

 log-adjacency-changes

 network 2.2.2.2 0.0.0.0 area 0

 network 10.1.1.0 0.0.0.255 area 0

 network 172.16.2.0 0.0.0.255 area 0

!

router bgp 1

 bgp log-neighbor-changes

 neighbor RR peer-group

 neighbor RR remote-as 1

 neighbor RR update-source Loopback0

 neighbor 1.1.1.1 peer-group RR

 neighbor 4.4.4.4 peer-group RR

!

 address-family vpnv4

 neighbor 1.1.1.1 activate

 neighbor 1.1.1.1 send-community extended

 neighbor 1.1.1.1 route-reflector-client

 neighbor 4.4.4.4 activate

 neighbor 4.4.4.4 route-map policy1 out

 neighbor 4.4.4.4 send-community extended

 neighbor 4.4.4.4 route-reflector-client

 exit-address-family

 !

 address-family ipv4 vrf vpna

 redistribute connected

 no synchronization

 exit-address-family

!

ip prefix-list hope seq 5 permit 192.168.1.0/24

!

route-map policy1 permit 10

 match ip address prefix-list hope

!

·     UPE 2:

!

hostname UPE2

!

ip cef

!

ip vrf vpna

 rd 4:1

 route-target export 1:1

 route-target import 1:1

!

mpls label protocol tdp

!

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

!

interface Ethernet0/0.1

 encapsulation dot1Q 2

 ip vrf forwarding vpna

 ip address 192.168.2.1 255.255.255.0

!

interface Ethernet0/1

 ip address 172.16.2.2 255.255.255.0

 mpls label protocol tdp

 mpls ip

!

router ospf 1

 log-adjacency-changes

 network 4.4.4.4 0.0.0.0 area 0

 network 172.16.2.0 0.0.0.255 area 0

!

router bgp 1

 no synchronization

 bgp log-neighbor-changes

 neighbor 2.2.2.2 remote-as 1

 neighbor 2.2.2.2 update-source Loopback0

 no auto-summary

 !

 address-family vpnv4

 neighbor 2.2.2.2 activate

 neighbor 2.2.2.2 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf vpna

 redistribute connected

 no synchronization

 exit-address-family

!

4  相关资料

·     H3C MSR 系列路由器 命令参考(V5)-R2311

·     H3C MSR 系列路由器 配置指导(V5)-R2311

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

新华三官网
联系我们