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

H3C S6800 & S6860 & S6861系列以太网交换机 典型配置举例-Release 27xx系列-6W100

目录

16-GRE隧道典型配置举例

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

docurl=/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Typical_Configuration_Example/H3C_S6800_S6860_S6861_CERelease_27xx-6W100/202001/1259303_30005_0.htm

16-GRE隧道典型配置举例

H3C S6800&S6860&S6861产品IPv6 over IPv4 GRE隧道典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2019 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



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

产品

软件版本

S6800系列

S6860系列

S6861系列

Release 2702

 

3.4  配置注意事项

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

·            封装后的报文不能根据目的地址和路由表进行第二次三层转发,需要将封装后的报文发送给业务环回组,由业务环回组将报文回送给转发模块后,再进行三层转发。因此,需要创建tunnel类型的业务环回组,以实现隧道报文的接收和发送。

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

# 将接口Ten-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

# 将接口Ten-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 S6800[60][61](R27xx) & S6820(R630x)系列以太网交换机 三层技术-IP业务配置指导

·            H3C S6800[60][61](R27xx) & S6820(R630x)系列以太网交换机 三层技术-IP业务命令参考

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

新华三官网
联系我们