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

H3C 园区盒式交换机典型配置举例-6W100

目录

14-GRE隧道典型配置举例

本章节下载 14-GRE隧道典型配置举例  (179.34 KB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Typical_Configuration_Example/H3C_CE-B70D022-6W100/202012/1371439_30005_0.htm

14-GRE隧道典型配置举例


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  适用产品及版本

表1 适用产品及版本

产品

软件版本

S5560X-EI系列

Release 63xx系列

S5560X-HI系列

Release 63xx系列

S5500V2-EI系列

Release 63xx系列

MS4520V2-30F

Release 63xx系列

S6520X-HI系列

S6520X-EI系列

Release 63xx系列

S6520X-SI系列

S6520-SI系列

Release 63xx系列

S5000-EI系列

Release 63xx系列

MS4600系列

Release 63xx系列

S5560S-EI系列

S5560S-SI系列

Release 63xx系列

S5130S-HI系列

S5130S-EI系列

S5130S-SI系列

S5130S-LI系列

不支持

S5120V2-SI系列

S5120V2-LI系列

不支持

S3100V3-EI系列

S3100V3-SI系列

不支持

S5110V2系列

不支持

S5110V2-SI系列

不支持

S5000V3-EI系列

不支持

S5000E-X系列

不支持

E128C

E152C

E500C系列

E500D系列

不支持

MS4520V2系列(除MS4520V2-30F)

Release 63xx系列

MS4320V2系列

MS4300V2系列

MS4320系列

MS4200系列

不支持

WS5850-WiNet系列

Release 63xx系列

WS5820-WiNet系列

WS5810-WiNet系列

不支持

WAS6000系列

不支持

 

3.4  配置注意事项

Tunnel两端必须都配置隧道的源端地址和目的端地址,且本端配置的源端地址应该与对端配置的目的端地址相同、本端配置的目的端地址应该与对端配置的源端地址相同。

3.5  配置步骤

3.5.1  配置Device A

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

<DeviceA> system-view

[DeviceA] vlan 20

[DeviceA-vlan20] port 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地址,配置步骤这里省略。

# 创建隧道接口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 GigabitEthernet 1/0/1

[DeviceB] interface vlan-interface 20

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

[DeviceB-Vlan-interface20] quit

# 请参考以上方法配置上图中Device B其它接口的IP地址,配置步骤这里省略。

# 创建隧道接口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 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 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  配置文件

说明

部分交换机的配置文件中会显示port link-mode bridge命令,请以实际情况为准。

 

·            Device A:

#

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 GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 20

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 10

#

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:

#

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 GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 20

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 11

#

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 GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 10

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 11

#

 

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

新华三官网
联系我们