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

04-三层技术-IP业务配置举例

目录

02-H3C_GRE隧道典型配置举例

本章节下载 02-H3C_GRE隧道典型配置举例  (158.89 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500-S/Configure/Typical_Configuration_Example/H3C_S12500-S_CE-R7577P04-6W100/04/201904/1173218_30005_0.htm

02-H3C_GRE隧道典型配置举例

H3C GRE隧道典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

资料版本:6W100-20190330

产品版本:Release 7577P04

 

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  配置注意事项

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

3.4  配置步骤

3.4.1  配置Device A

# 配置接口Vlan-interface 10的IP地址。

<DeviceA> system-view

[DeviceA] vlan 10

[DeviceA-vlan 10] port ten-gigabitethernet2/0/1

[DeviceA-vlan 10] quit

[DeviceA] interface vlan-interface 10

[DeviceA-Vlan-interface10] ip address 192.13.2.2 24

[DeviceA-Vlan-interface10] quit

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

# 创建隧道接口Tunnel1,并指定隧道模式为GRE over IPv4隧道。

[DeviceA] interface tunnel 1 mode gre

# 配置Tunnel1接口的IPv6地址。

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

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

[DeviceA-Tunnel1] source 192.13.2.2

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

[DeviceA-Tunnel1] destination 131.108.5.2

[DeviceA-Tunnel1] quit

# 配置从Device A经过Tunnel1接口到PC B的静态路由。

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

# 配置从DeviceA到达隧道目的端的静态路由。

[DeviceA] ip route-static 131.108.5.2 255.255.255.0 192.13.2.1

# 创建业务环回组1,并配置服务类型为tunnel

[DeviceA] service-loopback group 1 type tunnel

# 将接口Ten-GigabitEthernet3/0/2加入业务环回组1

[DeviceA] interface ten-gigabitethernet 3/0/2

[DeviceA-Ten-GigabitEthernet3/0/2] port service-loopback group 1

[DeviceA-Ten-GigabitEthernet3/0/2] quit

3.4.2  配置Device B

# 配置接口Vlan-interface 11的IP地址。

<DeviceB> system-view

[DeviceB] vlan 11

[DeviceB-vlan 11] port ten-gigabitethernet2/0/2

[DeviceB-vlan 11] quit

[DeviceB] interface vlan-interface 11

[DeviceB-Vlan-interface11] ip address 131.108.5.2 24

[DeviceB-Vlan-interface11] quit

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

# 创建隧道接口Tunnel1,并指定隧道模式为GRE over IPv4隧道。

[DeviceB] interface tunnel 1 mode gre

# 配置Tunnel1接口的IPv6地址。

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

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

[DeviceB-Tunnel1] source 131.108.5.2

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

[DeviceB-Tunnel1] destination 192.13.2.2

[DeviceB-Tunnel1] quit

# 配置从DeviceB经过Tunnel1接口到PC A的静态路由。

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

# 配置DeviceB到达隧道目的端的静态路由。

[DeviceB] ip route-static 192.13.2.2 255.255.255.0 131.108.5.1

# 创建业务环回组1,并配置服务类型为tunnel。

[DeviceB] service-loopback group 1 type tunnel

# 将接口Ten-GigabitEthernet3/0/2加入业务环回组1。

[DeviceB] interface ten-gigabitethernet 3/0/2

[DeviceB-Ten-GigabitEthernet3/0/2] port service-loopback group 1

[DeviceB-Ten-GigabitEthernet3/0/2] quit

3.4.3  配置Device C

# 配置接口Vlan-interface 10的IP地址。

<DeviceC> system-view

[DeviceC] vlan 10

[DeviceC-vlan 10] port ten-gigabitethernet2/0/1

[DeviceC-vlan 10] quit

[DeviceC] interface vlan-interface 10

[DeviceC-Vlan-interface10] ip address 192.13.2.1 24

[DeviceC-Vlan-interface10] quit

# 配置接口Vlan-interface 11的IP地址。

[DeviceC] vlan 11

[DeviceC-vlan 11] port ten-gigabitethernet2/0/2

[DeviceC-vlan 11] quit

[DeviceC] interface vlan-interface 11

[DeviceC-Vlan-interface11] ip address 131.108.5.1 24

[DeviceC-Vlan-interface11] quit

3.5  验证配置

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.6  配置文件

·              Device A:

#

 service-loopback group 1 type tunnel

#

vlan 10

#

vlan 20

#

interface Ten-GigabitEthernet2/0/1

 port link-mode bridge

 port access vlan 10

#

interface Ten-GigabitEthernet3/0/1

 port link-mode bridge

 port access vlan 20

#

interface Ten-GigabitEthernet3/0/2

 port link-mode route

 port service-loopback group 1

#

interface interface Vlan-interface 10

 port link-mode route

 ip address 192.13.2.2 255.255.255.0

#

interface interface Vlan-interface 20

 port link-mode route

 ipv6 address 1001::1/64

#

interface Tunnel1 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 1

#

·              Device B:

#

 service-loopback group 1 type tunnel

#

vlan 11

#

vlan 20

#

interface Ten-GigabitEthernet2/0/2

 port link-mode bridge

 port access vlan 11

#

interface Ten-GigabitEthernet3/0/1

 port link-mode bridge

 port access vlan 20

#

interface Ten-GigabitEthernet3/0/2

 port link-mode route

 port service-loopback group 1

#

interface interface Vlan-interface 11

 port link-mode route

 ip address 131.108.5.2 255.255.255.0

#

interface interface Vlan-interface 20

 port link-mode route

 ipv6 address 2001::1/64

#

interface Tunnel1 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 1

#

·              Device C:

#

vlan 10

#

vlan 11

#

interface Ten-GigabitEthernet2/0/1

 port link-mode bridge

 port access vlan 10

#

interface Ten-GigabitEthernet2/0/2

 port link-mode bridge

 port access vlan 11

#

interface interface Vlan-interface 10

 port link-mode route

 ip address 192.13.2.1 255.255.255.0

#

interface interface Vlan-interface 11

 port link-mode route

 ip address 131.108.5.1 255.255.255.0

#

4  相关资料

·              H3C S12500-S系列交换机 三层技术-IP业务配置指导-R757X

·              H3C S12500-S系列交换机 三层技术-IP业务命令参考-R757X

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

新华三官网
联系我们