iT邦幫忙

DAY 3
1

Cisco技術學習與實作系列 第 3

ip unnumber ( 借用ip )

借用: Router 上 該介面並沒有ip 卻想要使用,所以跟別的介面借ip,來使該介面可以正常使用

意義: 減少ip消耗

=======

一般使用環境類似於:

總公司HQ 要跟分公司( BO-1 、 BO-2 、 BO-3) 溝通

可跟不同介面溝通就要用不同ip

而最小網段也要消耗4個位址

可是保留下來的位址也僅僅只是用於溝通而已

所以 ip unnumber 因此而生

============

使用規則:

1.如果被借用方有多個ip位址,則只能借用主ip

2.被借方 其本身不可是 借用方 (即被借方的ip 須是以 ip address 得到而非使用 ip unnumbered 得到)

3.被借方的位址可以給多個介面借用

4.借用方不可以是 乙太網接口

5.point-to-point 會自動跟對方協商路由,而非point-to-point 則需手動設定靜態路由或使用動態路由

6.當介面是經由 ip unnumber 取得 ip 時 , 動態路由並不會去檢查 對方的 source ip ==> 雙方不同網段 也可建起鄰居

7.如果 被借方並無設定 ip位址 , 則借用方將取得 0.0.0.0

==========================================

前言: 這次使用 GNS3 做為模擬環境測試

R1 和 R2 的 Serial 1/0 皆向 Loopback 0 借用 ip , Loopback 1 則模擬各自內網

實驗: 讓彼此內網可以互通

## 以下所有實驗皆只示範 R1 的指令 , R2 跟 R1 相同 故不再重複贊述


基礎環境:

R1(config)#interface loopback 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#interface loopback 1
R1(config-if)#ip add 192.168.1.254 255.255.255.0
R1(config-if)#interface serial 1/0
R1(config-if)#ip unnumbered loopback 0 ## 向 looback 0 借 ip

## 看

R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
Serial1/0 1.1.1.1 YES TFTP up up
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 1.1.1.1 YES manual up up
Loopback1 192.168.1.254 YES manual up up
Tunnel0 unassigned YES unset up down

===============================================

1. Serial 使用非 point-to-point 封裝 (預設 Serial封裝是 HDLC 故不須更動)

a. 靜態路由設定:

R1(config)#ip route 2.2.2.2 255.255.255.255 serial 1/0 ## 要到對方 2.2.2.2 需由 serial 1/0 出去
R1(config)#ip route 192.168.2.0 255.255.255.0 2.2.2.2 ## 到對方內網 交給 2.2.2.2

## 測試雙方 內網互ping

R1#ping 192.168.2.254 source 192.168.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.254, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.254
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/23/32 ms

b. 使用動態路由 ( 這裡簡單方便,使用 RIPv2 )

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.1.0
R1(config-router)#network 1.0.0.0

## 看

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 2.2.2.2, 00:00:02, Serial1/0
C 192.168.1.0/24 is directly connected, Loopback1
R 192.168.2.0/24 [120/1] via 2.2.2.2, 00:00:02, Serial1/0

##當介面使用 ip unnumbered 時,動態路由協定並不會去檢查對方 source ip

2. Serial 使用 point-to-point 封裝 ( encapsulation ppp )

a. 靜態路由設定:

R1(config)#ip route 192.168.2.0 255.255.255.0 2.2.2.2 ## 到對方內網 交給 2.2.2.2

## 當使用 point-to-point 時 雙方會自動協商,所以一開始就可以互ping (R1 ping 2.2.2.2 應該要成功)

b. 使用動態路由

同上,不再贊述


上一篇
RIP。EIGRP。OSPF 產生default route
下一篇
使用 packet tracer 淺玩 voice
系列文
Cisco技術學習與實作16
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言