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

H3C VSR1000虚拟路由器典型配置举例-6W100

目录

15-H3C VSR1000虚拟路由器GRE和OSPF结合使用典型配置举例

本章节下载 15-H3C VSR1000虚拟路由器GRE和OSPF结合使用典型配置举例  (146.15 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/NFV/H3C_VSR/Configure/Typical_Configuration_Example/H3C_VSR1000_CE-6W100/201411/845102_30005_0.htm

15-H3C VSR1000虚拟路由器GRE和OSPF结合使用典型配置举例

H3C VSR1000虚拟路由器GRE和OSPF结合使用典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2014 杭州华三通信技术有限公司 版权所有,保留一切权利。

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

并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。

H3C_彩色.emf

 



1  简介

本文档介绍了GRE隧道和OSPF相结合使用的典型配置举例。

2  配置前提

本文档不严格与具体软件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文假设您已了解GRE隧道和OSPF的相关特性。

3  配置举例

3.1  组网需求

图1所示,Device A为某机构总部网关,Device B和Device C为分支网关,运营商为各网关分配了公网IP地址,并保证网关之间可以通信,要求:

·     总部和分支之间建立GRE隧道,通过隧道使各总部、分支机构可以实现互访;

·     配置OSPF协议使网关上存在通过Tunnel接口到达目的地址的路由表项。

图1 GRE和OSPF结合使用典型配置举例组网图

设备

接口

IP地址

设备

接口

IP地址

Device A

GE1/0

191.2.1.1/24

Device B

GE1/0

191.3.1.1/24

 

GE2/0

10.1.1.1/24

 

GE2/0

10.7.1.1/24

 

Tunnel 1

10.5.1.1/24

 

Tunnel 1

10.5.1.2/24

 

Tunnel 2

10.6.1.1/24

 

 

 

Device C

GE1/0

191.4.1.1/24

 

 

 

 

GE2/0

10.8.1.1/24

 

 

 

 

Tunnel 2

10.6.1.2/24

 

 

 

 

3.2  使用版本

本举例是在E0301版本上进行配置和验证的。

3.3  配置步骤

3.3.1  配置准备

配置网关设备之间的IPv4路由协议,确保设备之间IPv4报文能够正常交互,具体配置过程略。

3.3.2  配置Device A

# 配置接口GigabitEthernet1/0的IP地址。

<DeviceA> system-view

[DeviceA] interface gigabitethernet 1/0

[DeviceA-GigabitEthernet1/0] ip address 191.2.1.1 255.255.255.0

[DeviceA-GigabitEthernet1/0] quit

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

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

[DeviceA] interface tunnel 1 mode gre

# 配置Tunnel1接口的IP地址。

[DeviceA-Tunnel1] ip address 10.5.1.1 24

# 配置Tunnel1接口的源接口为GigabitEthernet1/0。

[DeviceA-Tunnel1] source gigabitethernet 1/0

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

[DeviceA-Tunnel1] destination 191.3.1.1

[DeviceA-Tunnel1] quit

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

[DeviceA] interface tunnel 2 mode gre

# 配置Tunnel2接口的IP地址。

[DeviceA-Tunnel2] ip address 10.6.1.1 24

# 配置Tunnel2接口的源接口为GigabitEthernet1/0。

[DeviceA-Tunnel2] source gigabitethernet 1/0

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

[DeviceA-Tunnel2] destination 191.4.1.1

[DeviceA-Tunnel2] quit

# 启动OSPF,并配置其Router ID为10.6.1.1。

[DeviceA] router id 10.6.1.1

[DeviceA] ospf 1

[DeviceA-ospf-1] area 0

[DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[DeviceA-ospf-1-area-0.0.0.0] network 10.5.1.0 0.0.0.255

[DeviceA-ospf-1-area-0.0.0.0] network 10.6.1.0 0.0.0.255

[DeviceA-ospf-1-area-0.0.0.0] quit

3.3.3  配置Device B

# 配置接口GigabitEthernet1/0的IP地址。

<DeviceB> system-view

[DeviceB] interface gigabitethernet 1/0

[DeviceB-GigabitEthernet1/0] ip address 191.3.1.1 255.255.255.0

[DeviceB-GigabitEthernet1/0] quit

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

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

[DeviceB] interface tunnel 1 mode gre

# 配置Tunnel1接口的IP地址。

[DeviceB-Tunnel1] ip address 10.5.1.2 24

# 配置Tunnel1接口的源接口为GigabitEthernet1/0。

[DeviceB-Tunnel1] source GigabitEthernet 1/0

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

[DeviceB-Tunnel1] destination 191.2.1.1

[DeviceB-Tunnel1] quit

# 启动OSPF,并配置其Router ID为10.7.1.1。

[DeviceB] router id 10.7.1.1

[DeviceB] ospf 1

[DeviceB-ospf-1] area 0

[DeviceB-ospf-1-area-0.0.0.0] network 10.7.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] network 10.5.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] quit

3.3.4  配置Device C

# 配置接口GigabitEthernet1/0的IP地址。

<DeviceC> system-view

[DeviceC] interface gigabitethernet 1/0

[DeviceC-GigabitEthernet1/0] ip address 191.4.1.1 255.255.255.0

[DeviceC-GigabitEthernet1/0] quit

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

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

[DeviceC] interface tunnel 2 mode gre

# 配置Tunnel2接口的IP地址。

[DeviceC-Tunnel2] ip address 10.6.1.2 24

# 配置Tunnel1接口的源接口为GigabitEthernet1/0。

[DeviceC-Tunnel2] source GigabitEthernet 1/0

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

[DeviceC-Tunnel2] destination 191.2.1.1

[DeviceC-Tunnel2] quit

# 启动OSPF,并配置其Router ID为10.8.1.1。

[DeviceC] router id 10.8.1.1

[DeviceC] ospf 1

[DeviceC-ospf-1] area 0

[DeviceC-ospf-1-area-0.0.0.0] network 10.8.1.0 0.0.0.255

[DeviceC-ospf-1-area-0.0.0.0] network 10.6.1.0 0.0.0.255

[DeviceC-ospf-1-area-0.0.0.0] quit

3.4  验证配置

(1)     从Host A可以ping通Host B。

C:\> ping 10.7.1.2

 

Pinging 10.7.1.2 with 32 bytes of data:

 

Reply from 10.7.1.2: bytes=32 time=19ms TTL=253

Reply from 10.7.1.2: bytes=32 time<1ms TTL=253

Reply from 10.7.1.2: bytes=32 time<1ms TTL=253

Reply from 10.7.1.2: bytes=32 time<1ms TTL=253

 

Ping statistics for 10.7.1.2:

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

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 19ms, Average = 4ms

 

(2)     从Host A可以ping通Host C。

C:\> ping 10.8.1.2

 

Pinging 10.8.1.2 with 32 bytes of data:

 

Reply from 10.8.1.2: bytes=32 time=18ms TTL=253

Reply from 10.8.1.2: bytes=32 time<1ms TTL=253

Reply from 10.8.1.2: bytes=32 time<1ms TTL=253

Reply from 10.8.1.2: bytes=32 time<1ms TTL=253

 

Ping statistics for 10.8.1.2:

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

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 19ms, Average = 4ms

(3)     从Host B可以ping通Host C。

C:\> ping 10.8.1.2

 

Pinging 10.8.1.2 with 32 bytes of data:

 

Reply from 10.8.1.2: bytes=32 time=20ms TTL=251

Reply from 10.8.1.2: bytes=32 time<1ms TTL=251

Reply from 10.8.1.2: bytes=32 time<1ms TTL=251

Reply from 10.8.1.2: bytes=32 time<1ms TTL=251

 

Ping statistics for 10.8.1.2:

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

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 19ms, Average = 4ms

3.5  配置文件

·     Device A

#

 router id 10.6.1.1

#

ospf 1

 area 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 10.5.1.0 0.0.0.255

  network 10.6.1.0 0.0.0.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 191.2.1.1 255.255.255.0

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

#

interface Tunnel1 mode gre

 source GigabitEthernet1/0

 destination 191.3.1.1

 ip address 10.5.1.1 255.255.255.0

#

interface Tunnel2 mode gre

 source GigabitEthernet1/0

 destination 191.4.1.1

 ip address 10.6.1.1 255.255.255.0

#

·     Device B

#

 router id 10.7.1.1

#

ospf 1

 area 0.0.0.0

  network 10.7.1.0 0.0.0.255

  network 10.5.1.0 0.0.0.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 191.3.1.1 255.255.255.0

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 10.7.1.1 255.255.255.0

#

interface Tunnel1 mode gre

 source GigabitEthernet1/0

 destination 191.2.1.1

 ip address 10.5.1.2 255.255.255.0

#

·     Device C

#

 router id 10.8.1.1

#

ospf 1

 area 0.0.0.0

  network 10.8.1.0 0.0.0.255

  network 10.6.1.0 0.0.0.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 191.4.1.1 255.255.255.0

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 10.8.1.1 255.255.255.0

#

interface Tunnel2 mode gre

 source GigabitEthernet1/0

 destination 191.2.1.1

 ip address 10.6.1.2 255.255.255.0

#

4  相关资料

·     《H3C VSR1000虚拟路由器配置指导》中的“三层技术-IP业务配置指导”

·     《H3C VSR1000虚拟路由器命令参考》中的“三层技术-IP业务命令参考”

·     《H3C VSR1000虚拟路由器配置指导》中的“三层技术-IP路由配置指导”

·     《H3C VSR1000虚拟路由器命令参考》中的“三层技术-IP路由命令参考”

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

新华三官网
联系我们