• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

H3C S6800 & S6860 & S6861係列以太網交換機 典型配置舉例-Release 27xx係列-6W100

目錄

61-MCE典型配置舉例

本章節下載 61-MCE典型配置舉例  (565.40 KB)

61-MCE典型配置舉例

H3C S6800&S6860&S6861產品 MCE典型配置舉例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2019 bobty下载软件 版權所有,保留一切權利。

非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。

除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。

本文檔中的信息可能變動,恕不另行通知。



1  簡介

本文檔介紹MCE的配置舉例。

MCE功能通過為每個VPN創建和維護獨立的路由轉發表,來隔離私網內不同VPN的報文轉發路徑,而且通過與PE間的配合,也能夠將每個VPN的路由正確發布至對端PE,保證了在MPLS L3VPN環境下VPN報文在公網內的正確傳輸。本文介紹了由MCE設備向PE 1設備發布VPN路由信息的典型配置案例。

2  配置前提

本文檔不嚴格與具體軟、硬件版本對應,如果使用過程中與產品實際情況有差異,請參考相關產品手冊,或以設備實際情況為準。

本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。

本文檔假設您已了解MCE特性。

3  MCE通過OSPF向PE發布VPN路由典型配置舉例

3.1  組網需求

圖1所示,某公司通過運營商提供的MPLS L3VPN服務實現總部與分支機構的VPN連接,運營商MPLS網絡左側為公司總部網絡,包括財務和研發部門,財務部中使用靜態路由,而研發部內部通過RIP維護路由信息。MPLS網絡右側為研發和財務的分支機構,兩個分支機構分別通過CE1和CE2接入MPLS網絡。

現要求通過在總部的出口設備上配置MCE功能,實現以下需求:

·            研發部和財務部的路由信息在出口設備上相互隔離;

·            出口設備與PE1之間通過OSPF交互路由信息,並可以通過PE1設備與遠端相同VPN內的站點之間實現各部門內部路由信息的單獨維護更新。

圖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站點。

圖2 使用VPN實例虛擬多個CE設備示意圖

 

3.3  適用產品及版本

表1 適用產品及版本

產品

軟件版本

S6800係列

S6860係列

S6861係列

Release 2702

 

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

# 配置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

# 配置Vlan-interface20接口與VPN2實例進行綁定,並配置IP地址為10.214.20.3/24。

[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

# 配置Vlan-interface30接口與VPN1實例進行綁定,並配置IP地址為172.16.30.1/24。

[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

# 配置Vlan-interface40接口與VPN2實例進行綁定,並配置IP地址為172.16.40.1/24。

[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設備上為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

# 配置PE1的Vlan-interface30和Vlan-interface40接口分別與VPN1和VPN2實例進行綁定,並配置IP地址分別為172.16.30.2/24和172.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上為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.1.0/24      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/24和10.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

[VR2-rip-20] undo summary

# 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

# 將網段OSPF路由引入到RIP中。

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

[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設備間的路由信息同步

# 配置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_INTRA 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.2.0/24     O_INTRA 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

 import-route ospf 20

#

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

#

 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

#

4  MCE通過BGP向PE發布VPN路由典型配置舉例

4.1  組網需求

圖3所示,某公司通過運營商提供的MPLS L3VPN服務實現總部與分支機構的VPN連接,組網示意,運營商MPLS網絡左側為公司總部網絡,包括財務和研發部門,財務部中使用OSPF路由協議,而研發部內部通過IBGP維護路由信息。MPLS網絡右側為研發和財務的分支機構,兩個分支機構分別通過CE1和CE2接入MPLS網絡。

現要求通過在總部的出口設備上配置MCE功能,實現以下需求:

·            研發部和財務部的路由信息在出口設備上相互隔離;

·            出口設備與PE1之間通過BGP交互路由信息,並可以通過PE1設備與遠端相同VPN內的站點之間實現各部門內部路由信息的單獨維護更新。

圖3 MCE通過BGP向PE發布VPN路由組網示意圖

 

4.2  配置思路

說明

本案例主要介紹MCE功能的典型配置,因此僅對組網中MCE設備以及與之配合的VR1、VR2、VR3和PE1設備的配置進行介紹,組網中其它設備的配置這裏不再列出。

 

在MCE設備和PE 1設備上都需要創建VPN實例,並將需要傳播該VPN數據的接口與相應的VPN實例綁定。MCE設備對各VPN內路由信息的處理順序如圖4所示,即:

(1)       通過創建VPN實例完成虛擬路由表的創建;

(2)       在VPN實例中引入VPN站點的路由信息。需要注意的是,研發部內部使用的是IBGP協議,IBGP協議要求全連接或配置路由反射器。在MCE組網中,要求將MCE設備配置為IBGP的路由反射器;

(3)       將VPN站點的路由信息通過EBGP協議發布給PE 1設備,並接收PE 1設備從遠端站點傳來的VPN路由信息;

(4)       將PE 1設備上的遠端VPN路由信息引入到本地VPN站點中。

圖4 使用VPN實例虛擬多個CE設備示意圖

 

4.3  適用產品及版本

表2 適用產品及版本

產品

軟件版本

S6800係列

S6860係列

S6861係列

Release 2702

 

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

# 配置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

# 配置Vlan-interface20接口與VPN2實例進行綁定,並配置IP地址為10.214.20.3/24。

[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

# 配置Vlan-interface21接口與VPN2實例進行綁定,並配置IP地址為10.214.50.3/24。

[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

# 創建VLAN30和VLAN40,將GigabitEthernet1/0/3端口以Trunk方式加入這兩個VLAN。並創建相應的VLAN接口,將VLAN30接口與VPN1綁定,VLAN40接口與VPN2綁定,並配置IP地址。

[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

# 配置Vlan-interface40接口與VPN2實例進行綁定,並配置IP地址為172.16.40.1/24。

[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設備上為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

# 配置PE1的Vlan-interface30和Vlan-interface40接口分別與vpn1和vpn2實例進行綁定,並配置IP地址分別為172.16.30.2/24和172.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

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

# 配置MCE的Loopback0接口與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.3(MCE),並將網段192.168.2.0/24和10.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.3(MCE),並將網段192.168.3.0/24和10.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-vpn2] 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

               a - additional-path

       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設備間的路由信息同步

(1)       配置MCE與PE 1設備間同步VPN1的路由信息

# 在MCE設備上,為VPN1創建BGP-VPN實例,指定172.16.30.2(PE 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設備上進入VPN1的BGP-VPN實例視圖,配置EBGP對等體地址為172.16.30.1(MCE),自治係統號為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設備VPN2的BGP-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設備上進入VPN2的BGP-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/24和192.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

#

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

#

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 S6800[60][61](R27xx) & S6820(R630x)係列以太網交換機 MPLS配置指導

·            H3C S6800[60][61](R27xx) & S6820(R630x)係列以太網交換機 MPLS命令參考

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們