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

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

目录

40-MSR系列路由器MPLS L3VPN + OSPF多实例的典型配置举例

本章节下载 40-MSR系列路由器MPLS L3VPN + OSPF多实例的典型配置举例  (156.39 KB)

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

40-MSR系列路由器MPLS L3VPN + OSPF多实例的典型配置举例

MSR系列路由器MPLS L3VPN + OSPF多实例的典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H3C_彩色.emf

 



1  简介

本文档介绍使用MPLS L3VPN + OSPF多实例的典型配置举例。

2  配置前提

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

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

本文档假设您已了解MPLS L3VPN和OSPF多实例的特性。

3  配置举例

3.1  组网需求

图1所示,在MPLS L3VPN网络中,客户端CE 1和CE 2路由器分别与PE 1和PE 2设备相连。PE间运行OSPF协议实现PE内部的互通,并且互为MP-IBGP对等体,PE与CE运行OSPF协议。现要求:在PE上配置OSPF多实例,实现CE站点间互通。

图1 MSR路由器普通OSPF VPN方式组网图

设备

接口

IP地址

设备

接口

IP地址

CE1

Loopback0

1.1.1.1/32

PE2

Loopback0

4.4.4.4/32

 

Eth0/0

11.11.11.1/24

 

Eth0/0

33.33.33.2/24

PE1

Loopback0

2.2.2.2/32

 

Eth0/1

44.44.44.1/24

 

Eth0/0

22.22.22.1/24

CE2

Loopback0

5.5.5.5/32

 

Eth0/1

11.11.11.2/24

 

Eth0/0

44.44.44.2/24

P

Loopback0

3.3.3.3/32

 

 

 

 

Eth0/0

22.22.22.2/24

 

 

 

 

Eth0/1

33.33.33.1/24

 

 

 

 

3.2  配置思路

为了使能OSPF多实例,实现PE向CE间发布VPN路由,需要在PE的OSPF域上为同一个VPN实例配置相同的域ID,使得对端CE路由发布到本端CE的路由条目为区域间LSA。

3.3  使用版本

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

3.4  配置注意事项

应用MP-BGP时必须启动MPLS,因此必须配置MPLS VPN才能正常工作。

3.5  配置步骤

3.5.1  CE 1配置

# 配置设备接口地址。

<CE1> system-view

[CE1] interface ethernet 0/0

[CE1-Ethernet0/0] ip address 11.11.11.1 24

[CE1-Ethernet0/0] quit

[CE1] interface loopback 0

[CE1-LoopBack0] ip address 1.1.1.1 32

[CE1-LoopBack0] quit

# 配置OSPF,使网络互通。

[CE1] ospf 1

[CE1-ospf-1] area 0.0.0.0

[CE1-ospf-1-area-0.0.0.0] network 11.11.11.0 0.0.0.255

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

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

[CE1-ospf-1] quit

3.5.2  CE 2配置

# 配置设备接口地址。

<CE2> system-view

[CE2] interface ethernet 0/0

[CE2-Ethernet0/0] ip address 44.44.44.2 24

[CE2-Ethernet0/0] quit

[CE2] interface loopback 0

[CE2-LoopBack0] ip address 5.5.5.5 32

[CE2-LoopBack0] quit

# 配置OSPF,使网络互通。

[CE2] ospf 1

[CE2-ospf-1] area 0.0.0.0

[CE2-ospf-1-area-0.0.0.0] network 44.44.44.0 0.0.0.255

[CE2-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0

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

[CE2-ospf-1] quit

3.5.3  PE 1配置

# 配置设备接口地址。

<PE1> system-view

[PE1] interface ethernet 0/0

[PE1-Ethernet0/0] ip address 22.22.22.1 24

[PE1-Ethernet0/0] quit

[PE1] interface ethernet 0/1

[PE1-Ethernet0/1] ip address 11.11.11.2 24

[PE1-Ethernet0/1] quit

[PE1] interface LoopBack 0

[PE1-LoopBack0] ip address 2.2.2.2 32

[PE1-LoopBack0] quit

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

[PE1]ospf 1

[PE1-ospf-1] area 0

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

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

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

[PE1-ospf-1] quit

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

[PE1] mpls lsr-id 2.2.2.2

[PE1] mpls

[PE1-mpls] quit

[PE1] mpls ldp

[PE1-mpls-ldp] quit

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

[PE1] interface ethernet 0/0

[PE1-Ethernet0/0] mpls

[PE1-Ethernet0/0] mpls ldp

[PE1-Ethernet0/0] quit

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

[PE1] bgp 100

[PE1-bgp] peer 4.4.4.4 as-number 100

[PE1-bgp] peer 4.4.4.4 connect-interface loopback 0

[PE1-bgp] ipv4-family vpnv4

[PE1-bgp-af-vpnv4] peer 4.4.4.4 enable

[PE1-bgp-af-vpnv4] quit

[PE1-bgp] quit

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

[PE1] ip vpn-instance 1

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

[PE1-vpn-instance-1] vpn-target 111:1

[PE1-vpn-instance-1] quit

# 配置VPN实例1与Ethernet0/1接口绑定。

[PE1] interface ethernet 0/1

[PE1-Ethernet0/1] ip binding vpn-instance 1

[PE1-Ethernet0/1] ip address 11.11.11.2 24

[PE1-Ethernet0/1] quit

# 配置PE 1与CE 1之间的OSPF多实例。

[PE1] ospf 2 vpn-instance 1

[PE1-ospf-2] domain-id 0.0.0.10

[PE1-ospf-2] area 0.0.0.0

[PE1-ospf-2-area-0.0.0.0] network 11.11.11.0 0.0.0.255

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

[PE1-ospf-2] import-route bgp

[PE1-ospf-2] quit

# 配置PE 1将到本端CE 1的路由引入VPN路由表中,以发布给对端PE 2。

[PE1] bgp 100

[PE1-bgp] ipv4-family vpn-instance 1

[PE1-bgp-ipv4-1] import-route ospf 2

[PE1-bgp-ipv4-1] import-route direct

[PE1-bgp-ipv4-1] quit

[PE1-bgp] quit

3.5.4  P配置

# 配置接口IP地址。

<P> system-view

[P] interface ethernet 0/0

[P-Ethernet0/0] ip address 22.22.22.2 24

[P-Ethernet0/0] quit

[P] interface ethernet 0/1

[P-Ethernet0/1] ip address 33.33.33.1 24

[P-Ethernet0/1] quit

[P] interface LoopBack 0

[P-LoopBack0] ip address 3.3.3.3 32

[P-LoopBack0] quit

# 配置P的OSPF,使网络互通。

[P] ospf 1

[P-ospf-1] area 0.0.0.0

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

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

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

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

[P-ospf-1] quit

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

[P] mpls lsr-id 3.3.3.3

[P] mpls

[P-mpls] quit

[P] mpls ldp

[P-mpls-ldp] quit

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

[P] interface ethernet 0/0

[P-Ethernet0/0] mpls

[P-Ethernet0/0] mpls ldp

[P-Ethernet0/0] quit

[P] interface ethernet 0/1

[P-Ethernet0/1] mpls

[P-Ethernet0/1] mpls ldp

[P-Ethernet0/1] quit

3.5.5  PE 2配置

# 配置接口IP地址。

<PE2> system-view

[PE2] interface ethernet 0/0

[PE2-Ethernet0/0] ip address 33.33.33.2 24

[PE2-Ethernet0/0] quit

[PE2] interface ethernet 0/1

[PE2-Ethernet0/1] ip address 44.44.44.1 24

[PE2-Ethernet0/1] quit

[PE2] interface loopback 0

[PE2-LoopBack0] ip address 4.4.4.4 32

[PE2-LoopBack0] quit

# 配置PE 2的OSPF,使网络互通。

[PE2]ospf 1

[PE2-ospf-1] area 0

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

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

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

[PE2-ospf-1] quit

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

[PE2] mpls lsr-id 4.4.4.4

[PE2] mpls

[PE2-mpls] quit

[PE2] mpls ldp

[PE2-mpls-ldp] quit

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

[PE2] interface ethernet 0/0

[PE2-Ethernet0/0] mpls

[PE2-Ethernet0/0] mpls ldp

[PE2-Ethernet0/0] quit

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

[PE2] bgp 100

[PE2-bgp] peer 2.2.2.2 as-number 100

[PE2-bgp] peer 2.2.2.2 connect-interface loopback 0

[PE2-bgp] ipv4-family vpnv4

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

[PE2-bgp-af-vpnv4] quit

[PE2-bgp] quit

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

[PE2] ip vpn-instance 1

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

[PE2-vpn-instance-1] vpn-target 111:1

[PE2-vpn-instance-1] quit

# 配置VPN实例1与Eth0/1接口绑定:

[PE2] interface ethernet 0/1

[PE2-Ethernet0/1] ip binding vpn-instance 1

[PE2-Ethernet0/1] quit

# 配置PE 2与CE 2之间的OSPF多实例

[PE2] ospf 2 vpn-instance 1

[PE2-ospf-2] domain-id 0.0.0.10

[PE2-ospf-2] area 0.0.0.0

[PE2-ospf-2-area-0.0.0.0] network 44.44.44.0 0.0.0.255

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

[PE2-ospf-2] import-route bgp

[PE2-ospf-2] quit

# 配置PE 2将到本端CE 2的路由引入VPN路由表中,以发布给对端PE 1

[PE2] bgp 100

[PE2-bgp] ipv4-family vpn-instance 1

[PE2-bgp-ipv4-1] import-route ospf 2

[PE2-bgp-ipv4-1] import-route direct

[PE2-bgp-ipv4-1] quit

[PE2-bgp] quit

3.6  验证配置

# 在CE 1上ping CE 2的接口IP地址,能够ping通。

<CE1> ping 44.44.44.2

  PING 44.44.44.2: 56  data bytes, press CTRL_C to break

    Reply from 44.44.44.2: bytes=56 Sequence=0 ttl=253 time=1 ms

    Reply from 44.44.44.2: bytes=56 Sequence=1 ttl=253 time=1 ms

    Reply from 44.44.44.2: bytes=56 Sequence=2 ttl=253 time=1 ms

    Reply from 44.44.44.2: bytes=56 Sequence=3 ttl=253 time=1 ms

    Reply from 44.44.44.2: bytes=56 Sequence=4 ttl=253 time=1 ms

 

  --- 44.44.44.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

round-trip min/avg/max = 1/1/1 ms

# 查看CE 1的路由表,查看路由条目。

<CE1> display ip routing-table

Routing Tables: Public

  Destinations : 9    Routes : 9

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

1.1.1.1/32          Direct 0    0            127.0.0.1       InLoop0

5.5.5.5/32          OSPF   10   3            11.11.11.2      GE0/3

11.11.11.0/24       Direct 0    0            11.11.11.1      GE0/3

11.11.11.1/32       Direct 0    0            127.0.0.1       InLoop0

44.44.44.0/24       O_ASE  150  1            11.11.11.2      GE0/3

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

192.168.100.0/24    Direct 0    0            192.168.100.164 GE0/0

192.168.100.164/32  Direct 0    0            127.0.0.1       InLoop0

# 在CE 1上查看CE 2具体的路由条目。

<CE1> display ip routing-table 44.44.44.0 verbose

Routing Table : Public

Summary Count : 1

 

  Destination: 44.44.44.0/24

     Protocol: O_ASE           Process ID: 1

   Preference: 150                   Cost: 1

 IpPrecedence:                    QosLcId:

      NextHop: 11.11.11.2       Interface: GigabitEthernet0/3

    BkNextHop: 0.0.0.0        BkInterface:

  RelyNextHop: 0.0.0.0          Neighbor : 0.0.0.0

    Tunnel ID: 0x0                  Label: NULL

  BKTunnel ID: 0x0                BKLabel: NULL

        State: Active Adv             Age: 00h04m20s

          Tag: 3489661028

# 查看CE 1的OSPF数据库,观察到CE 2的主机路由为Sum-Net LSA,CE 2的直连路由仍为External(Type5 LSAs)。

<CE1>display ospf lsdb

   OSPF Process 1 with Router ID 1.1.1.1

       Link State Database

 

               Area: 0.0.0.0

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    11.11.11.2      11.11.11.2         144  36    80000011       0

 Router    1.1.1.1         1.1.1.1            142  48    80000013       0

 Network   11.11.11.2      11.11.11.2         144  32    80000004       0

 Sum-Net   5.5.5.5         11.11.11.2         678  28    80000001       2

 

       AS External Database

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 External  44.44.44.0      11.11.11.2         634  36    80000007       1

3.7  配置文件

·     CE1:

#

 sysname CE1

#

interface Ethernet0/0

 port link-mode route

 ip address 11.11.11.1 255.255.255.0

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

ospf 1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.0

  network 11.11.11.0 0.0.0.255

#

·     CE2:

#

 sysname CE2

#

interface LoopBack0

 ip address 5.5.5.5 255.255.255.255

#

interface Ethernet0/0

 port link-mode route

 ip address 44.44.44.2 255.255.255.0

#

ospf 1

area 0.0.0.0

  network 44.44.44.0 0.0.0.255

  network 5.5.5.5 0.0.0.0

#

·     PE1:

#

 sysname PE1

#

 mpls lsr-id 2.2.2.2

#

ip vpn-instance 1

 route-distinguisher 100:1

 vpn-target 111:1 export-extcommunity

 vpn-target 111:1 import-extcommunity

#

mpls

#

mpls ldp

#

interface Ethernet0/0

 port link-mode route

 ip address 22.22.22.1 255.255.255.0

 mpls

 mpls ldp

#

interface Ethernet0/1

 port link-mode route

 ip binding vpn-instance 1

 ip address 11.11.11.2 255.255.255.0

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

bgp 100

 undo synchronization

 peer 4.4.4.4 as-number 100

 peer 4.4.4.4 connect-interface LoopBack0

 #

 ipv4-family vpn-instance 1

  import-route direct

  import-route ospf 2

 #

 ipv4-family vpnv4

  peer 4.4.4.4 enable

#

ospf 1

 area 0.0.0.0

  network 22.22.22.0 0.0.0.255

  network 2.2.2.2 0.0.0.0

#

ospf 2 vpn-instance 1

 import-route bgp

 domain-id 0.0.0.10

 area 0.0.0.0

  network 11.11.11.0 0.0.0.255

#

·     P:

#

 sysname P

#

 mpls lsr-id 3.3.3.3

#

mpls

#

mpls ldp

#

interface Ethernet0/0

 port link-mode route

 ip address 22.22.22.2 255.255.255.0

 mpls

 mpls ldp

#

interface Ethernet0/1

 port link-mode route

 ip address 33.33.33.1 255.255.255.0

 mpls

 mpls ldp

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

ospf 1

 area 0.0.0.0

  network 22.22.22.0 0.0.0.255

  network 33.33.33.0 0.0.0.255

  network 3.3.3.3 0.0.0.0

#

·     PE2:

#

 sysname PE2

#

 mpls lsr-id 4.4.4.4

#

ip vpn-instance 1

 route-distinguisher 100:2

 vpn-target 111:1 export-extcommunity

 vpn-target 111:1 import-extcommunity

#

mpls

#

mpls ldp

#

interface Ethernet0/0

 port link-mode route

 ip address 33.33.33.2 255.255.255.0

 mpls

 mpls ldp

#

interface Ethernet0/1

 port link-mode route

 ip binding vpn-instance 1

 ip address 44.44.44.1 255.255.255.0

#

interface LoopBack0

 ip address 4.4.4.4 255.255.255.255

#

bgp 100

 undo synchronization

 peer 2.2.2.2 as-number 100

 peer 2.2.2.2 connect-interface LoopBack0

 #

 ipv4-family vpn-instance 1

  import-route direct

  import-route ospf 2

 #

 ipv4-family vpnv4

  peer 2.2.2.2 enable

#

ospf 1

 area 0.0.0.0

  network 22.22.22.0 0.0.0.255

  network 2.2.2.2 0.0.0.0

#

ospf 2 vpn-instance 1

 import-route bgp

 domain-id 0.0.0.10

 area 0.0.0.0

  network 44.44.44.0 0.0.0.255

#

4  相关资料

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

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

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

新华三官网
联系我们