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

H3C S6850&S9850&S9820-64H 典型配置举例-Release 655x系列-6W100

目录

56-接口借用其他接口IP地址典型配置举例

本章节下载 56-接口借用其他接口IP地址典型配置举例  (164.56 KB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Typical_Configuration_Example/H3C_S6850_S9850_S9820-64H_CE-6W100/202008/1323952_30005_0.htm

56-接口借用其他接口IP地址典型配置举例

H3C S6850&S9850&S9820-64H 接口借用其他接口IP地址配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

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

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

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



1  简介

本文档介绍IP地址借用的配置举例。

IP地址借用是指一个接口上没有配置IP地址,但为了使该接口能正常使用,就向同一设备上其它有IP地址的接口借用一个IP地址。

2  配置前提

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

本文档假设您已了解IP地址借用特性。

3  使用限制

·            Loopback接口不能借用其它接口的地址。

·            被借用接口的地址本身不能为借用地址。

·            如果被借用接口有多个手动配置的IP地址,则只有手动配置的主IP地址能被借用。

4  配置举例

4.1  组网需求

图1所示,Device A和Device C分别连接IPv4私有网络Group A和Group B,Device A和Device C之间建立有GRE隧道。由于Tunnel 1接口不经常被使用,所以没有分配IP地址,要求通过借用Loopback接口的IP地址实现隧道的互通。

图1 IP地址借用配置组网图

 

4.2  适用产品及版本

表1 适用产品及版本

产品

软件版本

S6850系列

S9850系列

Release 6555P01

S9820-64H

Release 6555P01

 

4.3  配置步骤

1. Device A的配置

(1)       配置以太网接口与Loopback0接口的IP地址。

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

<DeviceA> system-view

[DeviceA] interface HundredGigE 1/0/1

[DeviceA-HundredGigE1/0/1] port link-mode route

[DeviceA-HundredGigE1/0/1] ip address 12.12.12.1 24

[DeviceA-HundredGigE1/0/1] quit

[DeviceA] interface loopback 0

[DeviceA-LoopBack0] ip address 8.8.8.8 32

[DeviceA-LoopBack0] quit

# 请参考以上方法配置图1中Device A的其它接口的IP地址,具体配置过程略。

(2)       配置OSPF路由协议

[DeviceA] ospf 1

[DeviceA-ospf-1] area 0

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

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

[DeviceA-ospf-1] quit

(3)       建立GRE隧道。

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

[DeviceA] service-loopback group 1 type tunnel

# 将接口HundredGigE1/0/3加入业务环回组1。

[DeviceA] interface HundredGigE 1/0/3

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

[DeviceA-HundredGigE1/0/3] quit

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

[DeviceA] interface tunnel 1 mode gre

# 配置Tunnel1接口的源地址。

[DeviceA-Tunnel1] source 12.12.12.1

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

[DeviceA-Tunnel1] destination 23.23.23.3

# 配置Tunnel1接口借用loopback0的IP地址。

[DeviceA-Tunnel1] ip address unnumbered interface loopback 0

[DeviceA-Tunnel1] quit

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

[DeviceA] ip route-static 10.2.1.0 255.255.255.0 tunnel 1

2. Device B的配置

(1)       配置以太网接口的IP地址。

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

<DeviceB> system-view

[DeviceB] interface HundredGigE 1/0/1

[DeviceB-HundredGigE1/0/1] port link-mode route

[DeviceB-HundredGigE1/0/1] ip address 12.12.12.2 24

[DeviceB-HundredGigE1/0/1] quit

# 请参考以上方法配置图1中Device B的其它接口的IP地址,具体配置过程略。

(2)       配置OSPF路由协议

[DeviceB] ospf 1

[DeviceB-ospf-1] area 0

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

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

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

[DeviceB-ospf-1] quit

3. Device C的配置

(1)       配置以太网接口与Loopback0接口的IP地址。

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

<DeviceC> system-view

[DeviceC] interface HundredGigE 1/0/1

[DeviceC-HundredGigE1/0/1] port link-mode route

[DeviceC-HundredGigE1/0/1] ip address 23.23.23.3 24

[DeviceC-HundredGigE1/0/1] quit

[DeviceC] interface loopback 0

[DeviceC-LoopBack0] ip address 9.9.9.9 32

[DeviceC-LoopBack0] quit

# 请参考以上方法配置图1中Device C的其它接口的IP地址,具体配置过程略。

(2)       配置OSPF路由协议

[DeviceC] ospf 1

[DeviceC-ospf-1] area 0

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

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

[DeviceC-ospf-1] quit

(3)       建立GRE隧道。

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

[DeviceC] service-loopback group 1 type tunnel

# 将接口HundredGigE1/0/3加入业务环回组1。

[DeviceC] interface HundredGigE 1/0/3

[DeviceC-HundredGigE1/0/3] port service-loopback group 1

[DeviceC-HundredGigE1/0/3] quit

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

[DeviceC] interface tunnel 1 mode gre

# 配置Tunnel1接口的源地址。

[DeviceC-Tunnel1] source 23.23.23.3

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

[DeviceC-Tunnel1] destination 12.12.12.1

# 配置Tunnel1接口借用loopback0的IP地址。

[DeviceC-Tunnel1] ip address unnumbered interface loopback 0

[DeviceC-Tunnel1] quit

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

[DeviceC] ip route-static 10.1.1.0 255.255.255.0 tunnel 1

4.4  验证配置

# 查看Tunnel1接口状态,可以看到Tunnel1接口借用了Loopback0接口的IP地址,以Device A为例。

[DeviceA] display interface tunnel 1

Tunnel1

Current state: UP

Line protocol state: UP

Description: Tunnel1 Interface

Bandwidth: 64kbps

Maximum transmission unit: 1476

Internet Address: 8.8.8.8/32 (Unnumbered)

Tunnel source 12.12.12.1, destination 23.23.23.3

Tunnel keepalive disabled

Tunnel TTL 255

Tunnel protocol/transport GRE/IP

    GRE key disabled

    Checksumming of GRE packets disabled

Last clearing of counters: Never

Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

Input: 11 packets, 924 bytes, 0 drops

Output: 10 packets, 840 bytes, 0 drops

# 从Device A的HundredGigE1/0/2可以 ping通 Device C的HundredGigE1/0/2。

[DeviceA] ping -a 10.1.1.1 10.2.1.1

Ping 10.2.1.1 (10.2.1.1) from 10.1.1.1: 56 data bytes, press CTRL_C to break

56 bytes from 10.2.1.1: icmp_seq=0 ttl=255 time=32.641 ms

56 bytes from 10.2.1.1: icmp_seq=1 ttl=255 time=4.881 ms

56 bytes from 10.2.1.1: icmp_seq=2 ttl=255 time=4.816 ms

56 bytes from 10.2.1.1: icmp_seq=3 ttl=255 time=26.393 ms

56 bytes from 10.2.1.1: icmp_seq=4 ttl=255 time=43.003 ms

 

--- Ping statistics for 10.2.1.1 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 4.816/22.347/43.003/15.241 ms

4.5  配置文件

·            Device A:

#

 service-loopback group 1 type tunnel

#

ospf 1

 area 0.0.0.0

  network 12.12.12.0 0.0.0.255

#

interface LoopBack0

 ip address 8.8.8.8 255.255.255.255

#

interface HundredGigE1/0/1

 port link-mode route

 ip address 12.12.12.1 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

#

interface HundredGigE1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel1 mode gre

 ip address unnumbered interface LoopBack0

 source 12.12.12.1

 destination 23.23.23.3

#

 ip route-static 10.2.1.0 24 Tunnel1

#

·            Device B :

#

ospf 1

 area 0.0.0.0

  network 12.12.12.0 0.0.0.255

  network 23.23.23.0 0.0.0.255

#

interface HundredGigE1/0/1

 port link-mode route

 ip address 12.12.12.2 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode route

 ip address 23.23.23.2 255.255.255.0

#

·            Device C:

#

 service-loopback group 1 type tunnel

#

ospf 1

 area 0.0.0.0

  network 23.23.23.0 0.0.0.255

#

interface LoopBack0

 ip address 9.9.9.9 255.255.255.255

#

interface HundredGigE1/0/1

 port link-mode route

 ip address 23.23.23.3 255.255.255.0

#

interface HundredGigE1/0/2

 port link-mode route

 ip address 10.2.1.1 255.255.255.0

#

interface HundredGigE1/0/3

 port link-mode bridge

 port service-loopback group 1

#

interface Tunnel1 mode gre

 ip address unnumbered interface LoopBack0

 source 23.23.23.3

 destination 12.12.12.1

#

 ip route-static 10.1.1.0 24 Tunnel1

#

5  相关资料

·            H3C S6850 & S9850系列以太网交换机 三层技术-IP业务配置指导-Release 655x系列

·            H3C S6850 & S9850系列以太网交换机 三层技术-IP业务命令参考-Release 655x系列

·            H3C S9820-64H交换机 三层技术-IP业务配置指导-Release 655x系列

·            H3C S9820-64H交换机 三层技术-IP业务命令参考-Release 655x系列

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

新华三官网
联系我们