• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 关于我们

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

目录

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

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

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


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

产品

软件版本

S6805系列

Release 6710Pxx版本,Release 6715及以上版本

S6825系列

Release 6710Pxx版本,Release 6715及以上版本

S6850系列

Release 6710Pxx版本,Release 6715及以上版本

S9850系列

Release 6710Pxx版本,Release 6715及以上版本

S9820-64H

Release 6710Pxx版本,Release 6715及以上版本

S9820-8C

Release 6710Pxx版本,Release 6715及以上版本

S6800系列

Release 6710Pxx版本,Release 6715及以上版本

S6860系列

Release 6710Pxx版本,Release 6715及以上版本

S6826系列

不支持

S9826系列

不支持

 

4.3  配置步骤

4.3.1  Device A的配置

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

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

<DeviceA> system-view

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] port link-mode route

[DeviceA-Ten-GigabitEthernet1/0/1] ip address 12.12.12.1 24

[DeviceA-Ten-GigabitEthernet1/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

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

# 创建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

4.3.2  Device B的配置

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

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

<DeviceB> system-view

[DeviceB] interface ten-gigabitethernet 1/0/1

[DeviceB-Ten-GigabitEthernet1/0/1] port link-mode route

[DeviceB-Ten-GigabitEthernet1/0/1] ip address 12.12.12.2 24

[DeviceB-Ten-GigabitEthernet1/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

4.3.3  Device C的配置

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

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

<DeviceC> system-view

[DeviceC] interface ten-gigabitethernet 1/0/1

[DeviceC-Ten-GigabitEthernet1/0/1] port link-mode route

[DeviceC-Ten-GigabitEthernet1/0/1] ip address 23.23.23.3 24

[DeviceC-Ten-GigabitEthernet1/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

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

[DeviceC] interface ten-gigabitethernet 1/0/3

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

[DeviceC-Ten-GigabitEthernet1/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的Ten-GigabitEthernet1/0/2可以 ping通 Device C的Ten-GigabitEthernet1/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 Ten-GigabitEthernet1/0/1

 port link-mode route

 ip address 12.12.12.1 255.255.255.0

#

interface Ten-GigabitEthernet1/0/2

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

#

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

 port link-mode route

 ip address 12.12.12.2 255.255.255.0

#

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

 port link-mode route

 ip address 23.23.23.3 255.255.255.0

#

interface Ten-GigabitEthernet1/0/2

 port link-mode route

 ip address 10.2.1.1 255.255.255.0

#

interface Ten-GigabitEthernet1/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  相关资料

请参考对应产品和版本的如下手册:

·     三层技术-IP业务配置指导

·     三层技术-IP业务命令参考

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

新华三官网
联系我们