• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

04-三層技術-IP業務配置舉例

目錄

04-H3C_接口借用其他接口IP地址典型配置舉例

本章節下載 04-H3C_接口借用其他接口IP地址典型配置舉例  (185.20 KB)

04-H3C_接口借用其他接口IP地址典型配置舉例

H3C 接口借用其他接口IP地址典型配置舉例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

資料版本:6W100-20200330

產品版本:Release 7585P05

 

Copyright © 2020 bobty下载软件 版權所有,保留一切權利。

非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。

除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。

本文檔中的信息可能變動,恕不另行通知。

 



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  配置步驟

4.2.1  Device A的配置

(1)       配置VLAN接口與Loopback0接口的IP地址。

# 配置VLAN接口12的IP地址。

<DeviceA> system-view

[DeviceA] interface vlan-interface 12

[DeviceA-Vlan-interface12] ip address 12.12.12.1 24

[DeviceA-Vlan-interface12] 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-GigabitEthernet3/0/3加入業務環回組1。

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

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

[DeviceA-Ten-GigabitEthernet3/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.2.2  Device B的配置

(1)       配置VLAN接口的IP地址。

# 配置VLAN接口12的IP地址。

<DeviceB> system-view

[DeviceB] interface vlan-interface 12

[DeviceB-Vlan-interface12] ip address 12.12.12.2 24

[DeviceB-Vlan-interface12] quit

# 請參考以上方法配置圖1中Device C的其它接口的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.2.3  Device C的配置

(1)       配置VLAN接口與Loopback0接口的IP地址。

# 配置VLAN接口10的IP地址。

<DeviceC> system-view

[DeviceC] interface vlan-interface 23

[DeviceC-Vlan-interface10] ip address 23.23.23.3 24

[DeviceC-Vlan-interface10] 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-GigabitEthernet3/0/3加入業務環回組1。

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

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

[DeviceC-Ten-GigabitEthernet3/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.3  驗證配置

# 查看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 Transmit Unit: 1476

Internet Address is 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的VLAN接口10可以 ping通 Device C的VLAN接口10。

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

·            Device A:

#

 service-loopback group 1 type tunnel

#

ospf 1

 area 0.0.0.0

  network 12.12.12.0 0.0.0.255

#

vlan 10

#

vlan 12

#

interface LoopBack0

 ip address 8.8.8.8 255.255.255.255

#

interface Vlan-interface10

 ip address 10.1.1.1 255.255.255.0

#

interface Vlan-interface12

 ip address 12.12.12.1 255.255.255.0

#

interface Ten-GigabitEthernet3/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

#

vlan 12

#

vlan 23

#

interface Vlan-interface12

 ip address 12.12.12.2 255.255.255.0

#

interface Vlan-interface23

 ip address 23.23.23.3 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

#

vlan 10

#

vlan 23

#

interface LoopBack0

 ip address 9.9.9.9 255.255.255.255

#

interface Vlan-interface10

 ip address 10.2.1.1 255.255.255.0

#

interface Vlan-interface23

 ip address 23.23.23.3 255.255.255.0

#

interface Ten-GigabitEthernet3/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 S10500係列交換機 三層技術-IP業務配置指導-R758X

·            H3C S10500係列交換機 三層技術-IP業務命令參考-R758X

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們