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

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

目錄

13-GRE隧道典型配置舉例

本章節下載 13-GRE隧道典型配置舉例  (150.43 KB)

13-GRE隧道典型配置舉例

H3C S6890產品 GRE隧道典型配置舉例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

資料版本:6W100-20190628

 

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

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

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

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

 



1  簡介

本文檔介紹了GRE隧道的典型配置舉例。

2  配置前提

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

本文假設您已了解GRE隧道的相關特性。

3  配置舉例

3.1  組網需求

圖1所示,Device A、Device B、Device C之間通過IPv4網絡互連。Device A和Device B分別連接IPv6主機PC A和PC B。

要求通過在邊界的雙棧設備(Device A、Device B)之間建立GRE隧道,實現兩台IPv6主機PC A和PC B的通信。

圖1 GRE隧道配置組網圖

 

3.2  配置思路

·     為實現兩台IPv6主機PC A和PC B的通信,需要將GRE隧道模式為GRE over IPv4,隧道接口配置為IPv6地址;

·     為了使PC A發往PC B的報文經由GRE隧道進行轉發,需要在邊界設備Device A上建立Tunnel轉發的路由表項:目的地址是未進行GRE封裝的報文的目的地址(即PC B的IPv6地址),下一跳是GRE隧道對端Device B的Tunnel接口地址或者直接指定出接口為GRE隧道接口。該路由表項可以通過配置靜態路由來建立,也可以在Tunnel接口上和與PC A相連的三層接口上分別使能動態路由協議,由動態路由協議來建立。本例中選擇配置靜態路由方式。同理,Device B上也需進行相應配置;

·     對於GRE隧道,必須確保隧道源端和目的端之間IPv4路由可達,因此需要在Device A和Device B上分別配置到對端的靜態路由。

3.3  使用版本

本舉例是在S6890-CMW710-R2712版本上進行配置和驗證的。

3.4  配置注意事項

·     Tunnel兩端必須都配置隧道的源端地址和目的端地址,且本端配置的源端地址應該與對端配置的目的端地址相同、本端配置的目的端地址應該與對端配置的源端地址相同。

·     封裝後的報文不能根據目的地址和路由表進行第二次三層轉發,需要將封裝後的報文發送給業務環回組,由業務環回組將報文回送給轉發模塊後,再進行三層轉發。因此,需要創建tunnel類型的業務環回組,以實現隧道報文的接收和發送。

·     缺省情況下,S6890係列交換機的接口處於ADM(Administratively Down)狀態,請根據實際需要在對應接口視圖下使用undo shutdown命令開啟接口。

3.5  配置步驟

3.5.1  配置Device A

# 配置接口VLAN-interface20的IPv6地址。

<DeviceA> system-view

[DeviceA] vlan 20

[DeviceA-vlan20] port Ten-GigabitEthernet 1/0/1

[DeviceA-vlan20] quit

[DeviceA] interface vlan-interface 20

[DeviceA-vlan-interface20] ipv6 address 1001::1 64

[DeviceA-vlan-interface20] quit

# 請參考以上方法配置上圖中Device A其它接口的IP地址,配置步驟這裏省略。

# 創建業務環回組1,並配置服務類型為tunnel。

[DeviceA] service-loopback group 1 type tunnel

# 將接口GigabitEthernet1/0/3加入業務環回組1。

[DeviceA] interface Ten-GigabitEthernet 1/0/3

[DeviceA-Ten-GigabitEthernet1/0/3] port service-loopback group 1

[DeviceA-Ten-GigabitEthernet1/0/3] quit

# 創建隧道接口Tunnel0,並指定隧道模式為GRE over IPv4隧道。

[DeviceA] interface tunnel 0 mode gre

# 配置Tunnel0接口的IPv6地址。

[DeviceA-Tunnel0] ipv6 address 3001::1 64

# 配置Tunnel0接口的源端地址。

[DeviceA-Tunnel0] source 192.13.2.2

# 配置Tunnel0接口的目的端地址。

[DeviceA-Tunnel0] destination 131.108.5.2

[DeviceA-Tunnel0] quit

# 配置從Device A經過Tunnel0接口到PC B的靜態路由。

[DeviceA] ipv6 route-static 2001:: 64 tunnel 0

# 配置從DeviceA到達隧道目的端的靜態路由。

[DeviceA] ip route-static 131.108.5.2 255.255.255.0 192.13.2.1

3.5.2  配置Device B

# 配置接口VLAN-interface20的IP地址。

<DeviceB> system-view

[DeviceB] vlan 20

[DeviceB-vlan20] port Ten-GigabitEthernet 1/0/1

[DeviceB] interface vlan-interface 20

[DeviceB-Vlan-interface20] ipv6 address 2001::1 64

[DeviceB-Vlan-interface20] quit

# 請參考以上方法配置上圖中Device B其它接口的IP地址,配置步驟這裏省略。

# 創建業務環回組1,並配置服務類型為tunnel。

[DeviceB] service-loopback group 1 type tunnel

# 將接口GigabitEthernet1/0/3加入業務環回組1。

[DeviceB] interface Ten-GigabitEthernet 1/0/3

[DeviceB-Ten-GigabitEthernet1/0/3] port service-loopback group 1

[DeviceB-Ten-GigabitEthernet1/0/3] quit

# 創建隧道接口Tunnel0,並指定隧道模式為GRE over IPv4隧道。

[DeviceB] interface tunnel 0 mode gre

# 配置Tunnel0接口的IPv6地址。

[DeviceB-Tunnel0] ipv6 address 3001::2 64

# 配置Tunnel0接口的源端地址。

[DeviceB-Tunnel0] source 131.108.5.2

# 配置Tunnel0接口的目的端地址。

[DeviceB-Tunnel0] destination 192.13.2.2

[DeviceB-Tunnel0] quit

# 配置從DeviceB經過Tunnel0接口到PC A的靜態路由。

[DeviceB] ipv6 route-static 1001:: 64 Tunnel 0

# 配置DeviceB到達隧道目的端的靜態路由。

[DeviceB] ip route-static 192.13.2.2 255.255.255.0 131.108.5.1

3.5.3  配置Device C

# 配置接口VLAN-interface10的IP地址。

<DeviceC> system-view

[DeviceC] vlan 10

[DeviceC-vlan10] port Ten-GigabitEthernet 1/0/1

[DeviceC-vlan10] quit

[DeviceC] interface Vlan-interface 10

[DeviceC-Vlan-interface10] ip address 192.13.2.1 24

[DeviceC-Vlan-interface10] quit

# 配置接口VLAN-interface11的IP地址。

[DeviceC] vlan 11

[DeviceC-vlan11] port Ten-GigabitEthernet 1/0/2

[DeviceC-vlan11] quit

[DeviceC] interface vlan-interface 11

[DeviceC-Vlan-interface11] ip address 131.108.5.1 24

[DeviceC-Vlan-interface11] quit

3.6  驗證配置

PCA和PCB之間可以互相Ping通。

C:\>ping6 2001::2

 

Pinging 2001::2

from 1001::1 with 32 bytes of data:

 

Reply from 2001::2: bytes=32 time<1ms

Reply from 2001::2: bytes=32 time<1ms

Reply from 2001::2: bytes=32 time<1ms

Reply from 2001::2: bytes=32 time<1ms

 

Ping statistics for 2001::2:

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

Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 0ms, Average = 0ms

3.7  配置文件

·     Device A:

#

 service-loopback group 1 type tunnel

#

vlan 10

#

vlan 20

#

interface Vlan-interface10

 ip address 192.13.2.2 255.255.255.0

#

interface Vlan-interface20

 ipv6 address 1001::1/64

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 20

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 10

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel0 mode gre

 ipv6 address 3001::1/64

 source 192.13.2.2

 destination 131.108.5.2

#

 ip route-static 131.108.5.2 255.255.255.0 192.13.2.1

#

 ipv6 route-static 2001:: 64 Tunnel 0

#

·     Device B:

#

 service-loopback group 1 type tunnel

#

vlan 11

#

vlan 20

#

interface Vlan-interface11

 ip address 131.108.5.2 255.255.255.0

#

interface Vlan-interface20

 ipv6 address 2001::1/64

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 20

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 11

#

interface Ten-GigabitEthernet1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel0 mode gre

 ipv6 address 3001::2/64

 source 131.108.5.2

 destination 192.13.2.2

#

ip route-static 192.13.2.2 255.255.255.0 131.108.5.1

#

ipv6 route-static 1001:: 64 Tunnel 0

#

·     Device C:

#

vlan 10 to 11

#

interface Vlan-interface10

 ip address 192.13.2.1 255.255.255.0

#

interface Vlan-interface11

 ip address 131.108.5.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 10

#

interface Ten-GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 11

#

4  相關資料

·     H3C S6890係列交換機 三層技術-IP業務配置指導(R27xx)

·     H3C S6890係列交換機 三層技術-IP業務命令參考(R27xx)

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

BOB登陆
官網
聯係我們