59-接口借用其他接口IP地址典型配置舉例
本章節下載: 59-接口借用其他接口IP地址典型配置舉例 (137.23 KB)
Copyright © 2018 bobty下载软件 版權所有,保留一切權利。 非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。本文檔中的信息可能變動,恕不另行通知。 |
|
目 錄
本文檔介紹IP地址借用的配置舉例。
IP地址借用是指一個接口上沒有配置IP地址,但為了使該接口能正常使用,就向同一設備上其它有IP地址的接口借用一個IP地址。
本文檔中的配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下舉例中的配置不衝突。
本文檔假設您已了解IP地址借用特性。
· Loopback接口不能借用其它接口的地址。
· 如果被借用接口有多個手動配置的IP地址,則隻有手動配置的主IP地址能被借用。
如圖1所示,Device A和Device C分別連接IPv4私有網絡Group A和Group B,Device A和Device C之間建立有GRE隧道。由於Tunnel 1接口不經常被使用,所以沒有分配IP地址,要求通過借用Loopback接口的IP地址實現隧道的互通。
圖1 IP地址借用配置組網圖
本舉例是在S6800-CMW710-R2609版本上進行配置和驗證的。
(1) 配置以太網接口與Loopback0接口的IP地址。
# 配置接口Ten-GigabitEthernet1/0/1的IP地址。
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 1/0/1
[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] 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
(1) 配置以太網接口的IP地址。
# 配置接口Ten-GigabitEthernet1/0/1的IP地址。
<DeviceB> system-view
[DeviceB] interface ten-gigabitethernet 1/0/1
[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
(1) 配置以太網接口與Loopback0接口的IP地址。
# 配置接口Ten-GigabitEthernet1/0/1的IP地址。
<DeviceC> system-view
[DeviceC] interface ten-gigabitethernet 1/0/1
[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
# 查看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的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
· 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
#
· H3C 6800交換機三層技術-IP業務配置指導-Release 26xx係列
· H3C 6800交換機三層技術-IP業務命令參考-Release 26xx係列
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!