0×1.幀中繼概述
Frame Relay,簡稱FR,可以將它看做X.25協議的簡化版本,幀中繼網絡中不考慮傳輸差錯問題,其中的結點只做幀的轉發操作,不需要執行接收確認和請求重發等操作;幀中繼是一種嚴格意義上的二層協議。
在幀中繼網絡中使用VC(Virtual Circuit,虛電路)來互連各個分支,并不需要兩個分支之間有單獨的物理鏈路。下面是物理專線和幀中繼虛電路的示意圖:

使用虛電路的最主要好處就是配置方便,建立和拆除虛電路只需要使用命令配置即可,所以虛電路并非真正的物理鏈路,只是在現有網絡的基礎上添加的一系列轉發規則,就好像在源和目的間存在一條專線一樣;相比之下專線則需要綜合布線施工,建立和拆除難度較大。
幀中繼的工作范圍在DTE設備和幀中繼交換機之間。
a.幀中繼術語
1)VC(Virtual Circuit,虛電路)
幀中繼網絡中兩臺DTE設備之間的連接稱為虛電路,現在常用的虛電路為PVC(Permanent Virtual Circuit,永久虛電路),PVC由運營商預先配置。
2)DLCI(Data Link Connection Identifier,數據鏈路連接標識符)

3)LMI(Local Management Interface,本地管理接口)
LMI是用戶端和幀中繼交換機之間的信令標準,負責管理設備之間的連接,維護設備的狀態。LMI被用來獲知路由器被分配了哪些DLCI,確定PVC的操作狀態,有哪些可用的PVC,另外還用來發送維持分組,確保PVC處于激活狀態。LMI的類型有三種:ANSI、Cisco、Q933A,DTE端的LMI配置要和幀中繼上的一致,否則LMI不能正常工作,進而導致PVC失敗。思科路由上默認的LMI類型為Cisco。
除了上面三個比較常見外,還有下面這些術語,有興趣的朋友可以自己去查一下每個術語的解釋:
承諾信息速率(CIR)承諾突發(BC)超量突發(BE)前向顯示擁塞通知(FECN)后向顯示擁塞通知(BECN)允許丟棄(DE)
b.幀中繼運行方式
這一部分結合下面的圖三來介紹幀中繼是如何工作的,數據包是如何被轉發的。

幀中繼的幀和以太網幀一樣,也工作在數據鏈路層,幀的格式如下圖:

Flag標志:標志幀的開始和結束地址:地址字段2個字節中包含了DLCI號(幀中繼的幀中只有一個DLCI號,即去往的目的地的DLCI號,2個字節中的10個比特用來儲存這個DLCI號);擁塞控制(Congestion Control)占3比特,其中包括1比特的FECN位,1比特的BECN位和1比特的DE位;除此之外地址域中還包含3個比特的其他值。數據:是一個可變長的字段,包含了封裝的上層協議數據。幀效驗序列:用來保證傳輸數據的完整性。
2)幀中繼中的幀轉發方式
在圖三中,假設R1要將數據發往R3,R1封裝DLCI號103(至于為什么R1知道發往R3要封裝103這個在下面的幀中繼尋址方式中會詳細的介紹),將封裝好的幀發往幀中繼交換機FR1。根據FR1上管理員的配置,FR1知道如果從接口1接收到DLCI號為103的幀,應該將DLCI號修改成112并從接口3發出。此時幀到達FR3,FR3也根據配置得知,從自己的1接口接收到的DLCI號為112的幀,應該將DLCI號修改成301,并從3號接口發出。此時R3接收到FR3發過來的幀中繼幀,解封裝后交給上層處理。 從上面的工作方式中可以看出,只要R1封裝DLCI號103的幀,就能將數據發往R3,幀中繼網云使用DLCI號103和DLCI號301在R1和R3之間建立了一條永久虛電路(PVC),同理R1到R4可以封裝104,R4到R1可以封裝401。
3)幀中繼交換表
在圖三的幀中繼網絡中,FR1-3三臺幀中繼交換機上都維護著一個幀中繼交換表,下面是FR1的幀中繼交換表的樣式:

這一部分將介紹"反向ARP(Inverse ARP)",幀中繼中的反向ARP是根據DLCI號解析IP的一個過程,和以太網中通過ARP解析MAC地址很相似。下圖描述了這一過程是如何進行的:

幀中繼交換機通知R1,DLCI號103和104是激活的(圖中第3步),可以使用。對于每個激活的DLCI號,R1發送一個反向ARP請求分組,宣告自己的IP,并且封裝對應的DLCI號(圖中第4步)。
從這一點可以看出,幀中繼是不支持廣播的,幀中繼網絡默認是NBMA(Non-Broadcast Multiple Access,非廣播多路訪問),但可以通過發送多個幀拷貝來解決廣播問題。
幀中繼網云將R1發來的DLCI號103替換成301發往R3(圖中第5步,實際幀中繼網絡中可能存在很多幀中繼交換機,這里假設中間只有一臺,便于講解)。
R3收到幀中繼交換機發來的幀,DLCI號是301,R3處理該數據幀并進行應答,R3封裝DLCI號為301,并且告知自己的IP是123.1.1.3(圖片中第6步),然后從自己的物理接口發回。
幀中繼交換機收到這個DLCI號是301的幀,根據自己的交換表,將DLCI號改成103發往R1,R1收到這個應答后在本地的映射中添加R3的IP123.1.1.3和對應的DLCI號103,以后發往123.1.1.3的數據幀就用DLCI號103封裝。
最后圖中第7步,R1繼續發送維持消息,默認10秒一次,此維持消息可以驗證幀中繼交換機是否處于激活狀態。反向ARP默認的發送時間是60秒。
同理R3和R4也可以使用相同的方法獲得對方的IP地址和對應的DLCI號。
d.幀中繼水平分隔潛在問題
有時候不需要建立全互連型幀中繼網絡,比如下面這中情況:

解決這一問題的方法是關閉水平分隔,或者使用多個點到點子接口,在后面的配置實例中會詳細介紹到。
0×2.幀中繼配置實例
a.配置幀中繼路由器
幀中繼的所有實驗都在GNS3中完成,配置下面這張拓撲圖,圖中四臺路由器均為c3640,將R2配置成幀中繼交換機,用來模擬幀中繼網云,R1、R3、R4是DTE端的路由器配置幀中繼封裝:

R2配置:
01
Router>
en
02
Router#
conf
t
03
Router(config)#
host
Frame-relay-SW
04
/配置成幀中繼交換機/
05
Frame-relay-SW(config)#
frame-relay
switching
06
/進入和R1相連的接口/
07
Frame-relay-SW(config)#
int
s 0/0
08
09
/使用幀中繼封裝/
10
Frame-relay-SW(config-if)#
encapsulation
frame-relay
11
12
/*
13
- 配置幀中繼LMI類型為ANSI,這一句是可選配置,
14
- 如果不配置,思科使用Cisco作為默認的LMI類型
15
*/
16
Frame-relay-SW(config-if)#
frame-relay
lmi-type
ansi
17
18
/*
19
- 為了幀中繼交換需要將接口改變成DCE,
20
- 這和具體鏈接的是DCE還是DTE接口無關。
21
*/
22
Frame-relay-SW(config-if)#
frame-relay
intf-type
dce
23
24
/*
25
- 將s0/0接口接收到的DLCI號103的幀,替換成301從s0/1接口發出。
26
- 將s0/0接收到的DLCI號104的幀,替換成401從s0/2接口發出。
27
*/
28
Frame-relay-SW(config-if)#
frame-relay
route
103
interface
s 0/1 301
29
Frame-relay-SW(config-if)#
frame-relay
route
104
interface
s 0/2 401
30
Frame-relay-SW(config-if)#
no
shut
/打開接口/
31
32
/配置和R3相連的s0/1接口/
33
Frame-relay-SW(config-if)#
int
s 0/1
34
Frame-relay-SW(config-if)#
encapsulation
frame-relay
35
Frame-relay-SW(config-if)#
frame-relay
lmi-type
ansi
36
Frame-relay-SW(config-if)#
frame-relay
intf-type
dce
37
Frame-relay-SW(config-if)#
frame-relay
route
301
interface
s 0/0 103
38
Frame-relay-SW(config-if)#
frame-relay
route
304
interface
s 0/2 403
39
Frame-relay-SW(config-if)#
no
shut
40
41
/配置和R4相連的s0/2接口/
42
Frame-relay-SW(config-if)#
int
s 0/2
43
Frame-relay-SW(config-if)#
encapsulation
frame-relay
44
Frame-relay-SW(config-if)#
frame-relay
lmi-type
ansi
45
Frame-relay-SW(config-if)#
frame-relay
intf-type
dce
46
Frame-relay-SW(config-if)#
frame-relay
route
403
interface
s 0/1 304
47
Frame-relay-SW(config-if)#
frame-relay
route
401
interface
s 0/0 104
48
Frame-relay-SW(config-if)#
no
shut
49
Frame-relay-SW(config-if)#
end
幀中繼交換機配置完成后繼續下面的配置,配置幀中繼網絡中其他路由器(R1、R3、R4)。
b.配置其他路由器使用幀中繼網絡
R1配置:
1
/配置與幀中繼相連的接口使用幀中繼封裝,再配置IP地址/
2
R1(config)#
int
s 0/0
3
R1(config-if)#
encapsulation
frame-relay
4
R1(config-if)#
ip
add
123.1.1.1 255.255.255.0
5
R1(config-if)#
no
shut
6
R1(config-if)#
end
R3配置:
1
R3(config)#
int
s 0/1
2
R3(config-if)#enc f /命令簡寫/
3
R3(config-if)#
ip
add
123.1.1.3 255.255.255.0
4
R3(config-if)#
no
shut
5
R3(config-if)#
end
R4配置:
1
R4(config)#
int
s 0/2
2
R4(config-if)#
ip
add
123.1.1.4 255.255.255.0
3
R4(config-if)#enc f
4
R4(config-if)#
no
shut
5
R4(config-if)#
end
配置完成后測試R1、R3、R4都能互相ping通,使用下面的命令可以查看幀中繼DLCI號的映射情況:
01
R1#
show
frame-relay
map
02
/*
03
"ip 123.1.1.3 dlci 103"
04
- 去往123.1.1.3的幀,封裝的DLCI號是103,
05
- 本文在幀中繼的反向ARP中介紹過這個映射是如何得到的。
06
07
"dynamic"
表示這種映射關系是動態學習到的。
08
09
"broadcast"
表示幀中繼上支持廣播。
10
11
"active"
表示鏈路是正常的。
12
*/
13
Serial0/0 (up):
ip
123.1.1.3 dlci 103(0x67,0x1870), dynamic,
14
broadcast
,,
status
defined, active
15
16
/同理,發往123.1.1.4的幀用DLCI號104封裝。/
17
Serial0/0 (up):
ip
123.1.1.4 dlci 104(0x68,0x1880), dynamic,
18
broadcast
,,
status
defined, active
通過下面的命令查看PVC建立和DLCI號的分配情況:
01
R1#
show
frame-relay
pvc
02
03
PVC Statistics for
interface
Serial0/0 (Frame Relay DTE)
04
05
/*
06
- 主要介紹下面這兩句,其中的詳細參數暫時不需要了解,
07
- R1使用LMI從幀中繼交換機(R2)那學到了兩條本地可用的DLCI號,
08
- 103和104,
"STATUS=ACTIVE"
表示PVC鏈路工作正常,
09
- 如果
"STATUS=INACTIVE"
表示不可用,一般是遠端配置有問題,
10
"STATUS=DELETED"
則表示本地配置可能有問題。
11
*/
12
DLCI=103,DLCI USAGE=LOCAL, PVC STATUS=ACTIVE, INTERFACE=Serial0/0
13
....
14
15
DLCI=104,DLCI USAGE=LOCAL, PVC STATUS=ACTIVE, INTERFACE=Serial0/0
16
....
通過下面的命令查看R1接口的LMI類型:
1
R1#
show
frame-relay
lmi
2
3
/*
4
- R1會自動調整默認的LMI類型和幀中繼交換機上配置的一致,
5
"TYPE=ANSI"
表示R1的s0/0接口的LMI類型是ANSI。
6
*/
7
LMI Statistics for
interface
Serial0/0(Frame Relay DTE) LMI TYPE=ANSI
在上面的配置中可能出現下面的問題:
如果使用"show frame-relay pvc"查看路由器上面學不到DLCI號,請檢查物理接口是否打開(包括幀中繼交換機上的物理接口),本地和幀中繼交換機相連的接口的封裝協議是否被配置成了幀中繼,本地接口的LMI類型是否和幀中繼交換機的一致。
可以通過查看接口信息來驗證:
01
/*
02
- 接口是否開啟
"Serial0/0 is up, line protocol is up"
03
- 封裝協議
"Encapsulation FRAME-RELAY"
04
- LMI類型
"LMI type is ANSI"
05
*/
06
R1#
show
interfaces
s 0/0
07
Serial0/0 is up, line protocol is up
08
....
09
Encapsulation FRAME-RELAY, crc 16,
loopback
not set
10
....
11
LMI DLCI 0 LMI type is ANSI Annex D frame relay DTE
12
....
現在R1、R3、R4都能互相ping通對方,但是還存在一個問題,他們ping不通自己的IP,從上面的"show frame-relay map"也可以看出,R1的幀中繼映射中沒有自己的"123.1.1.1"的映射,它不知道發往這個IP需要封裝什么DLCI號,下面繼續配置,讓他們都能ping通自己。
c.配置幀中繼能夠ping通自己
為了它們能夠ping通自己的IP,需要使用靜態映射命令:
01
/*
02
"IP地址"
是要去往的目的地址,
03
"DLCI號"
是這個IP對應的DLCI,
04
"[broadcast]"
可選參數使鏈路支持廣播,
05
- 配置動態路由協議時必須攜帶此參數,
06
"[cisco|ietf]"
中有兩個可選參數,
07
- 如果網絡中不全是思科設備,存在不同設備互連,
08
- 建議使用
"ietf"
參數。
09
*/
10
R1(config-if)#
frame-relay
map
ip
ip
地址 DLCI號 [
broadcast
] [cisco|
ietf
]
R1、R3、R4添加能ping通自己的靜態映射;
R1配置:
1
R1(config)#
int
s 0/0
2
R1(config-if)#
frame-relay
map
ip
123.1.1.1 103
broadcast
ietf
3
R1(config-if)#
end
R3配置:
1
R3(config)#
int
s 0/1
2
R3(config-if)#
frame-relay
map
ip
123.1.1.3 301
broadcast
ietf
3
R3(config-if)#
end
R4配置:
1
R4(config)#
int
s 0/2
2
R4(config-if)#
frame-relay
map
ip
123.1.1.4 401
broadcast
ietf
3
R4(config-if)#
end
這樣R1、R3、R4就能夠ping通自己的IP了:
01
/查看幀中繼映射/
02
R1#
show
frame-relay
map
03
Serial0/0 (up):
ip
123.1.1.3 dlci 103(0x67,0x1870), dynamic,
04
broadcast
,,
status
defined, active
05
Serial0/0 (up):
ip
123.1.1.4 dlci 104(0x68,0x1880), dynamic,
06
broadcast
,,
status
defined, active
07
08
/*
09
- 這一條是我們添加的靜態映射,在沒有指定ieft的時候,
10
- 默認的幀中繼封裝是CISCO。
11
*/
12
Serial0/0 (up):
ip
123.1.1.1 dlci 103(0x67,0x1870),
static
,
13
broadcast
,
14
IETF,
status
defined, active
15
16
/*
17
- 測試
ping
自己,雖然是
ping
自己,但是根據前面的映射可以得知,
18
- 數據是到達了R3后再返回的,如果R3關閉物理接口s0/2,
19
- 這里就會
ping
不通,大家可以測試一下。
20
*/
21
R1#
ping
123.1.1.1
22
!!!!!
到這里為止,幀中繼網絡中的三臺路由器都使用了反向ARP從幀中繼交換機上獲取到DLCI和對應的IP地址,下面一部分將介紹如何關閉反向ARP,使用全手動靜態配置來配置幀中繼映射。
d.配置幀中繼使用靜態映射
這一部分手動配置DLCI的靜態映射,首先關閉反向ARP,然后清除通過反向ARP學習到的動態映射緩存,然后使用手動配置。
R1配置:
01
R1(config)#
int
s 0/0
02
/關閉反向ARP/
03
R1(config-if)#
no
frame-relay
inverse-arp
04
R1(config-if)#
end
05
/清除反向ARP學到的映射緩存/
06
R1#clear
frame-relay
inarp
07
R1#
conf
t
08
/在接口下添加靜態映射/
09
R1(config)#
int
s 0/0
10
R1(config-if)#
frame-relay
map
ip
123.1.1.3 103
broadcast
ietf
11
R1(config-if)#
frame-relay
map
ip
123.1.1.4 104
broadcast
ietf
12
R1(config-if)#
end
R3配置:
1
R3(config)#
int
s 0/1
2
R3(config-if)#
no
frame-relay
inverse-arp
3
R3(config-if)#
end
4
R3#clear
frame-relay
inarp
5
R3#
conf
t
6
R3(config)#
int
s 0/1
7
R3(config-if)#
frame-relay
map
ip
123.1.1.1 301
broadcast
ietf
8
R3(config-if)#
frame-relay
map
ip
123.1.1.4 304
broadcast
ietf
9
R3(config-if)#
end
R4配置:
1
R4(config)#
int
s 0/2
2
R4(config-if)#
no
frame-relay
inverse-arp
3
R4(config-if)#
end
4
R4#clear
frame-relay
inarp
5
R4#
conf
t
6
R4(config)#
int
s 0/2
7
R4(config-if)#
frame-relay
map
ip
123.1.1.1 401
broadcast
ietf
8
R4(config-if)#
frame-relay
map
ip
123.1.1.3 403
broadcast
ietf
9
R4(config-if)#
end
配置完成后在R1上查看幀中繼映射表:
01
/可以看到狀態全部變成了
"static"
即靜態映射。/
02
R1#
show
frame-relay
map
03
Serial0/0 (up):
ip
123.1.1.3 dlci 103(0x67,0x1870),
static
,
04
broadcast
,
05
IETF,
status
defined, active
06
Serial0/0 (up):
ip
123.1.1.4 dlci 104(0x68,0x1880),
static
,
07
broadcast
,
08
IETF,
status
defined, active
09
Serial0/0 (up):
ip
123.1.1.1 dlci 103(0x67,0x1870),
static
,
10
broadcast
,
11
IETF,
status
defined, active
e.RIP over 幀中繼
幀中繼作為二層鏈路,上面可以運行各種動態路由協議。在GNS3中完成下圖配置,在幀中繼網絡中運行RIP協議。

R2被配置成幀中繼交換機,其中只有兩條虛電路R1-R3和R1-R4,R1 s0/0的IP為123.1.1.1,R3 s0/1的IP為123.1.1.3,R4 s0/2的IP為123.1.1.4,它們上面各有一個回環接口,這些接口都被發布到RIP協議中。
首先將R2配置成幀中繼交換機:
01
Router>
en
02
Router#
conf
t
03
Router(config)#
host
FR-SW
04
FR-SW(config)#
frame-relay
switching
05
06
FR-SW(config)#
int
s 0/0
07
FR-SW(config-if)#
encapsulation
frame-relay
08
FR-SW(config-if)#
frame-relay
lmi-type
ansi
09
FR-SW(config-if)#
frame-relay
intf-type
dce
10
/僅配置R1-R3以及R1-R4的虛電路/
11
FR-SW(config-if)#
frame-relay
route
103
interface
s 0/1 301
12
FR-SW(config-if)#
frame-relay
route
104
interface
s 0/2 401
13
14
FR-SW(config-if)#
int
s 0/1
15
FR-SW(config-if)#
encapsulation
frame-relay
16
FR-SW(config-if)#
frame-relay
lmi-type
ansi
17
FR-SW(config-if)#
frame-relay
intf-type
dce
18
FR-SW(config-if)#
frame-relay
route
301
interface
s 0/0 103
19
FR-SW(config-if)#
no
shut
20
21
FR-SW(config-if)#
int
s 0/2
22
FR-SW(config-if)#
encapsulation
frame-relay
23
FR-SW(config-if)#
frame-relay
lmi-type
ansi
24
FR-SW(config-if)#
frame-relay
intf-type
dce
25
FR-SW(config-if)#
frame-relay
route
401
interface
s 0/0 104
26
FR-SW(config-if)#
no
shut
27
FR-SW(config-if)#
end
R1配置:
01
R1(config)#
int
s 0/0
02
/使用幀中繼封裝/
03
R1(config-if)#
encapsulation
frame-relay
04
/關閉反向ARP,使用手動靜態映射配置/
05
R1(config-if)#
no
frame-relay
inverse-arp
06
07
/配置靜態映射/
08
R1(config-if)#
frame-relay
map
ip
123.1.1.3 103
broadcast
ietf
09
R1(config-if)#
frame-relay
map
ip
123.1.1.1 103
broadcast
ietf
10
R1(config-if)#
frame-relay
map
ip
123.1.1.4 104
broadcast
ietf
11
R1(config-if)#
ip
add
123.1.1.1 255.255.255.0
12
R1(config-if)#
no
shut
13
14
R1(config-if)#
int
lo
0
15
R1(config-if)#
ip
add
1.1.1.1 255.255.255.0
16
R1(config-if)#
no
shut
17
18
R1(config-if)#router
rip
/配置RIP,宣告所有接口/
19
R1(config-router)#
net
1.0.0.0
20
R1(config-router)#
net
123.0.0.0
21
R1(config-router)#
end
R3配置:
01
R3(config)#
int
s 0/1
02
R3(config-if)#
encapsulation
frame-relay
03
R3(config-if)#
no
frame-relay
inverse-arp
04
R3(config-if)#
frame-relay
map
ip
123.1.1.1 301
broadcast
ietf
05
06
/讓R3能
ping
通自己/
07
R3(config-if)#
frame-relay
map
ip
123.1.1.3 301
broadcast
ietf
08
09
/因為R3和R4之間并沒有虛電路,所以發往R4的數據要先封裝成301發往R1/
10
R3(config-if)#
frame-relay
map
ip
123.1.1.4 301
broadcast
ietf
11
R3(config-if)#
ip
add
123.1.1.3 255.255.255.0
12
R3(config-if)#
no
shut
13
14
R3(config-if)#
int
lo0
15
R3(config-if)#
ip
add
3.3.3.3 255.255.255.0
16
R3(config-if)#
no
shut
17
R3(config-if)#router
rip
18
R3(config-router)#
net
3.0.0.0
19
R3(config-router)#
net
123.0.0.0
20
R3(config-router)#
end
R4配置:
01
R4(config)#
int
s 0/2
02
R4(config-if)#
encapsulation
frame-relay
03
R4(config-if)#
no
frame-relay
inverse-arp
04
R4(config-if)#
frame-relay
map
ip
123.1.1.1 401
broadcast
05
06
/讓R4能
ping
通自己/
07
R4(config-if)#
frame-relay
map
ip
123.1.1.4 401
broadcast
08
09
/因為R4和R3之間沒有配置虛電路,發往R3的數據先發往R1/
10
R4(config-if)#
frame-relay
map
ip
123.1.1.3 401
broadcast
11
R4(config-if)#
ip
add
123.1.1.4 255.255.255.0
12
R4(config-if)#
no
shut
13
14
R4(config-if)#
int
lo
0
15
R4(config-if)#
ip
add
4.4.4.4 255.255.255.0
16
R4(config-if)#
no
shut
17
18
R4(config-if)#router
rip
19
R4(config-router)#
net
4.0.0.0
20
R4(config-router)#
net
123.0.0.0
21
R4(config-router)#
end
配置完成后全網后能互相通信,在R4上查看路由表和幀中繼映射表:
01
/顯示R4已經學習到R1和R3上面的回環接口信息/
02
R4#
show
ip
route
03
04
Gateway of last resort is not set
05
06
R 1.0.0.0/8 [120/1] via 123.1.1.1, 00:00:18, Serial0/2
07
R 3.0.0.0/8 [120/2] via 123.1.1.1, 00:00:18, Serial0/2
08
4.0.0.0/24 is subnetted, 1 subnets
09
C 4.4.4.0 is directly connected, Loopback0
10
123.0.0.0/24 is subnetted, 1 subnets
11
C 123.1.1.0 is directly connected, Serial0/2
12
13
/靜態映射全部是激活可用的/
14
R4#
show
frame-relay
map
15
Serial0/2 (up):
ip
123.1.1.3 dlci 401(0x191,0x6410),
static
,
16
broadcast
,
17
IETF,
status
defined, active
18
Serial0/2 (up):
ip
123.1.1.4 dlci 401(0x191,0x6410),
static
,
19
broadcast
,
20
IETF,
status
defined, active
21
Serial0/2 (up):
ip
123.1.1.1 dlci 401(0x191,0x6410),
static
,
22
broadcast
,
23
IETF,
status
defined, active
24
25
/*
26
- 這個時候假設R4去
ping
3.3.3.3,首先R4查詢路由表,
27
- 發現
"3.0.0.0/8 [120/2] via 123.1.1.1"
,
28
- 發往3.0.0.0/8網段的數據要發給123.1.1.1即R1,
29
- R4再查詢幀中繼映射表,發現
"ip 123.1.1.1 dlci 401"
30
- 所以R4用DLCI號401封裝這個幀發往R1。
31
*/
從上面的輸出中并沒有出現上面"幀中繼水平分隔潛在問題"中提到的水平分隔問題,這是因為幀中繼物理接口默認關閉了水平分隔,在R1上查看接口信息:
1
R1#
show
ip
int
s 0/0
2
Serial0/0 is up, line protocol is up
3
....
4
Split horizon is disabled /水平分隔是關閉的/
5
....
可以使用下面的命令打開水平分隔:
1
R1(config)#
int
s 0/0
2
R1(config-if)#
ip
split-horizon
3
R1(config-if)#
end
打開水平分隔后稍等一段時間,RIP收斂后,R3上面就看不到R4回環接口的路由了,同樣R4上面也看不到R3的回環接口路由了。
除了關閉水平分隔外,還可以使用接下來介紹的方法,使用點到點子接口來解決水平分隔在幀中繼網絡中導致的問題。
f.配置幀中繼子接口
這一部分來配置一個稍微復雜一點的拓撲,在這個拓撲中會綜合運用到兩種子接口:點到點子接口(Point-to-Point)、多點子接口(Multipoint)。

如上圖所示,R5被配置成幀中繼交換機,其中有三條虛電路R1-R2,R1-R3,R1-R4,在R1的s0/0接口上啟用了子接口,其中s0/0.1用來連接R2,是一個點到點子接口,s0/0.2被用來連接R3和R4,是一個多點子接口。R1 s0/0.1的IP為12.1.1.1、s0/0.2的IP地址為134.1.1.1,R2的s0/1的IP地址為12.1.1.2,R3的s0/2的IP地址為134.1.1.3,R4的s0/3的IP地址為134.1.1.4。每個路由上都有一個回環接口,IP如圖所示。在這個幀中繼網絡上運行RIP協議,測試多點子接口存在的水平分隔問題。
首先配置R5成為幀中繼交換機:
01
Router>
en
02
Router#
conf
t
03
Router(config)#
host
RF-SW
04
RF-SW(config)#
frame-relay
switch
05
RF-SW(config)#
int
s 0/0
06
RF-SW(config-if)#encap frame
07
RF-SW(config-if)#frame
lmi-type
ansi
08
RF-SW(config-if)#frame
intf-type
dce
09
RF-SW(config-if)#frame
route
102
int
s 0/1 201
10
RF-SW(config-if)#frame
route
103
int
s 0/2 301
11
RF-SW(config-if)#frame
route
104
int
s 0/3 401
12
RF-SW(config-if)#
no
shut
13
RF-SW(config-if)#
int
s 0/1
14
RF-SW(config-if)#encap frame
15
RF-SW(config-if)#frame
lmi-type
ansi
16
RF-SW(config-if)#frame
intf-type
dce
17
RF-SW(config-if)#frame
route
201
int
s 0/0 102
18
RF-SW(config-if)#
no
shut
19
RF-SW(config-if)#
int
s 0/2
20
RF-SW(config-if)#encap frame
21
RF-SW(config-if)#frame
lmi-type
ansi
22
RF-SW(config-if)#frame
intf-type
dce
23
RF-SW(config-if)#frame
route
301
int
s 0/0 103
24
RF-SW(config-if)#
no
shut
25
RF-SW(config-if)#
int
s 0/3
26
RF-SW(config-if)#encap frame
27
RF-SW(config-if)#frame
lmi-type
ansi
28
RF-SW(config-if)#frame
intf-type
dce
29
RF-SW(config-if)#frame
route
401
int
s 0/0 104
30
RF-SW(config-if)#
no
shut
31
RF-SW(config-if)#
end
在R1上配置點到點和多點子接口:
01
R1(config)#
int
s 0/0
02
R1(config-if)#encap frame
03
R1(config-if)#
no
frame
inverse-arp
04
R1(config-if)#
no
shut
/物理接口只需要打開即可/
05
06
/配置點到點子接口/
07
R1(config-if)#
int
s 0/0.1
point-to-point
08
R1(config-subif)#
ip
add
12.1.1.1 255.255.255.0
09
/*
10
- 點到點子接口不需要和物理接口一樣配置靜態映射,
11
- 只要指明該接口使用的DLCI號即可,
12
- 點到點子接口上去往該子接口的IP地址(12.1.1.1)
13
- 或遠端(R2的12.1.1.2)的數據都使用這個DLCI號封裝。
14
*/
15
R1(config-subif)#
frame-relay
interface
-dlci 102
16
17
/配置多點子接口/
18
R1(config-fr-dlci)#
int
s 0/0.2 multipoint
19
R1(config-subif)#
ip
add
134.1.1.1 255.255.255.0
20
21
/多點子接口的靜態映射和物理接口相同/
22
R1(config-subif)#
frame-relay
map
ip
134.1.1.1 103
broadcast
ietf
23
R1(config-subif)#
frame-relay
map
ip
134.1.1.4 104
broadcast
ietf
24
R1(config-subif)#
frame-relay
map
ip
134.1.1.3 103
broadcast
ietf
25
R1(config-subif)#
int
lo
0
26
R1(config-if)#
ip
add
1.1.1.1 255.255.255.0
27
R1(config-if)#
no
shut
28
R1(config-if)#router
rip
/啟用RIP協議/
29
R1(config-router)#
net
1.0.0.0
30
R1(config-router)#
net
12.0.0.0
31
R1(config-router)#
net
134.1.0.0
32
R1(config-router)#
end
R2配置:
01
R2(config)#
int
s 0/1
02
R2(config-if)#
encapsulation
frame-relay
03
R2(config-if)#
no
frame-relay
inverse-arp
04
R2(config-if)#
frame-relay
map
ip
12.1.1.1 201
broadcast
ietf
05
R2(config-if)#
frame-relay
map
ip
12.1.1.2 201
broadcast
ietf
06
R2(config-if)#
ip
add
12.1.1.2 255.255.255.0
07
R2(config-if)#
no
shut
08
R2(config-if)#
int
lo
0
09
R2(config-if)#
ip
add
2.2.2.2 255.255.255.0
10
R2(config-if)#
no
shut
11
R2(config-if)#router
rip
12
R2(config-router)#
net
2.0.0.0
13
R2(config-router)#
net
12.0.0.0
14
R2(config-router)#
end
R3配置:
01
R3(config)#
int
s 0/2
02
R3(config-if)#
encapsulation
frame-relay
03
R3(config-if)#
no
frame-relay
inverse-arp
04
05
/配置靜態映射,去往R1/
06
R3(config-if)#
frame-relay
map
ip
134.1.1.1 301
broadcast
ietf
07
/因為R3和R4之間沒有配置虛電路,所以去往R4要先發往R1/
08
R3(config-if)#
frame-relay
map
ip
134.1.1.4 301
broadcast
ietf
09
/配置R3能夠
ping
通自己/
10
R3(config-if)#
frame-relay
map
ip
134.1.1.3 301
broadcast
ietf
11
R3(config-if)#
ip
add
134.1.1.3 255.255.255.0
12
R3(config-if)#
no
shut
13
R3(config-if)#
int
lo
0
14
R3(config-if)#
ip
add
3.3.3.3 255.255.255.0
15
R3(config-if)#
no
shut
16
17
R3(config-if)#router
rip
18
R3(config-router)#
net
3.0.0.0
19
R3(config-router)#
net
134.1.0.0
20
R3(config-router)#
end
R4配置:
01
R4(config)#
int
s 0/3
02
R4(config-if)#
encapsulation
frame-relay
03
R4(config-if)#
no
frame-relay
inverse-arp
04
R4(config-if)#
frame-relay
map
ip
134.1.1.1 401
broadcast
ietf
05
R4(config-if)#
frame-relay
map
ip
134.1.1.3 401
broadcast
ietf
06
R4(config-if)#
frame-relay
map
ip
134.1.1.4 401
broadcast
ietf
07
R4(config-if)#
ip
add
134.1.1.4 255.255.255.0
08
R4(config-if)#
no
shut
09
R4(config-if)#
int
lo
0
10
R4(config-if)#
ip
add
4.4.4.4 255.255.255.0
11
R4(config-if)#
no
shut
12
R4(config-if)#router
rip
13
R4(config-router)#
net
4.0.0.0
14
R4(config-router)#
net
134.1.0.0
15
R4(config-router)#
end
可以在R1上查看子接口信息來驗證默認情況下,點到點子接口和多點子接口的水平分隔都是打開的:
01
R1#
show
ip
interface
s 0/0.1
02
Serial0/0.1 is up, line protocol is up
03
....
04
Split horizon is enabled
05
....
06
07
R1#
show
ip
interface
s 0/0.2
08
Serial0/0.2 is up, line protocol is up
09
....
10
Split horizon is enabled
11
....
在R2的多點子接口上連接了兩臺路由器R3和R4,查看R3的路由表:
1
R3#
show
ip
route
2
/從路由表中看不到R4的回環接口的信息/
3
R 1.0.0.0/8 [120/1] via 134.1.1.1, 00:00:28, Serial0/2
4
R 2.0.0.0/8 [120/2] via 134.1.1.1, 00:00:28, Serial0/2
5
3.0.0.0/24 is subnetted, 1 subnets
6
C 3.3.3.0 is directly connected, Loopback0
7
R 12.0.0.0/8 [120/1] via 134.1.1.1, 00:00:28, Serial0/2
8
134.1.0.0/24 is subnetted, 1 subnets
9
C 134.1.1.0 is directly connected, Serial0/2
同樣,在R4上面也看不到R3回環接口的信息,這就是因為R1上s0/0.2接口上默認的水平分隔設置導致的,用下面的命令關閉R1的s0/0.2子接口的水平分隔:
1
R1(config)#
int
s 0/0.2
2
R1(config-subif)#
no
ip
split-horizon
3
R1(config-subif)#
end
再次查看R3的路由表:
01
R3#
show
ip
route
02
03
R 1.0.0.0/8 [120/1] via 134.1.1.1, 00:00:13, Serial0/2
04
R 2.0.0.0/8 [120/2] via 134.1.1.1, 00:00:13, Serial0/2
05
3.0.0.0/24 is subnetted, 1 subnets
06
C 3.3.3.0 is directly connected, Loopback0
07
/已經學習到了R4的回環接口信息/
08
R 4.0.0.0/8 [120/2] via 134.1.1.1, 00:00:13, Serial0/2
09
R 12.0.0.0/8 [120/1] via 134.1.1.1, 00:00:13, Serial0/2
10
134.1.0.0/24 is subnetted, 1 subnets
11
C 134.1.1.0 is directly connected, Serial0/2
12
13
/測試
ping
R4回環接口/
14
R3#
ping
4.4.4.4
15
!!!!! /成功/
這一部分演示了路由器子接口配置(點到點子接口和多點子接口)以及多點子接口上面需要注意的水平分隔問題。
0×3.EIGRP over 幀中繼
這一部分使用的拓撲圖如下:

R4是幀中繼交換機,圖中配置了兩條虛電路R1-R2,R1-R3,R1-3各有一個回環接口IP如圖所示。
首先配置R4成為幀中繼交換機:
01
Router>
en
02
Router#
conf
t
03
Router(config)#
host
RF-SW
04
RF-SW(config)#
frame-relay
switching
05
RF-SW(config)#
int
s 0/0
06
RF-SW(config-if)#
encapsulation
frame-relay
07
RF-SW(config-if)#
frame-relay
lmi-type
ansi
08
RF-SW(config-if)#
frame-relay
intf-type
dce
09
RF-SW(config-if)#
frame-relay
route
103
int
s 0/1 301
10
RF-SW(config-if)#
frame-relay
route
102
int
s 0/2 201
11
RF-SW(config-if)#
no
shut
12
RF-SW(config-if)#
int
s 0/1
13
RF-SW(config-if)#
encapsulation
frame-relay
14
RF-SW(config-if)#
frame-relay
lmi-type
ansi
15
RF-SW(config-if)#
frame-relay
intf-type
dce
16
RF-SW(config-if)#
frame-relay
route
301
int
s 0/0 103
17
RF-SW(config-if)#
no
shut
18
RF-SW(config-if)#
int
s 0/2
19
RF-SW(config-if)#
encapsulation
frame-relay
20
RF-SW(config-if)#
frame-relay
lmi-type
ansi
21
RF-SW(config-if)#
frame-relay
intf-type
dce
22
RF-SW(config-if)#
frame-relay
route
201
int
s 0/0 102
23
RF-SW(config-if)#
no
shut
24
RF-SW(config-if)#
end
a.在幀中繼物理接口上運行EIGRP
配置R1、R2、R3的物理接口使用幀中繼封裝,并且在上面運行EIGRP協議。
R1配置:
01
R1(config)#
int
s 0/0
02
R1(config-if)#
encapsulation
frame-relay
03
R1(config-if)#
no
frame-relay
inverse-arp
04
R1(config-if)#
frame-relay
map
ip
123.1.1.1 102
broadcast
ietf
05
R1(config-if)#
frame-relay
map
ip
123.1.1.2 102
broadcast
ietf
06
R1(config-if)#
frame-relay
map
ip
123.1.1.3 103
broadcast
ietf
07
R1(config-if)#
ip
add
123.1.1.1 255.255.255.0
08
R1(config-if)#
no
shut
09
R1(config-if)#
int
lo
0
10
R1(config-if)#
ip
add
1.1.1.1 255.255.255.0
11
R1(config-if)#
no
shut
12
R1(config-if)#router
eigrp
100
13
R1(config-router)#
net
1.1.1.0 0.0.0.255
14
R1(config-router)#
net
123.1.1.0 0.0.0.255
15
R1(config-router)#
end
R2配置:
01
R2(config)#
int
s 0/2
02
R2(config-if)#
encapsulation
frame-relay
03
R2(config-if)#
no
frame-relay
inverse-arp
04
R2(config-if)#
frame-relay
map
ip
123.1.1.1 201
broadcast
ietf
05
R2(config-if)#
frame-relay
map
ip
123.1.1.2 201
broadcast
ietf
06
R2(config-if)#
frame-relay
map
ip
123.1.1.3 201
broadcast
ietf
07
R2(config-if)#
ip
add
123.1.1.2 255.255.255.0
08
R2(config-if)#
no
shut
09
R2(config-if)#
int
lo
0
10
R2(config-if)#
ip
add
2.2.2.2 255.255.255.0
11
R2(config-if)#
no
shut
12
R2(config-if)#router
eigrp
100
13
R2(config-router)#
net
2.2.2.0 0.0.0.255
14
R2(config-router)#
net
123.1.1.0 0.0.0.255
15
R2(config-router)#
end
R3配置:
01
R3(config)#
int
s 0/1
02
R3(config-if)#
encapsulation
frame-relay
03
R3(config-if)#
no
frame-relay
inverse-arp
04
R3(config-if)#
frame-relay
map
ip
123.1.1.1 301
broadcast
ietf
05
R3(config-if)#
frame-relay
map
ip
123.1.1.2 301
broadcast
ietf
06
R3(config-if)#
frame-relay
map
ip
123.1.1.3 301
broadcast
ietf
07
R3(config-if)#
ip
add
123.1.1.3 255.255.255.0
08
R3(config-if)#
no
shut
09
R3(config-if)#
int
lo
0
10
R3(config-if)#
ip
add
3.3.3.3 255.255.255.0
11
R3(config-if)#
no
shut
12
R3(config-if)#router
eigrp
100
13
R3(config-router)#
net
3.3.3.0 0.0.0.255
14
R3(config-router)#
net
123.1.1.0 0.0.0.255
15
R3(config-router)#
end
配置完成后在R2上面查看路由表:
1
R2#
show
ip
route
2
3
D 1.0.0.0/8 [90/2297856] via 123.1.1.1, 00:00:02, Serial0/2
4
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
5
C 2.2.2.0/24 is directly connected, Loopback0
6
D 2.0.0.0/8 is a summary, 00:05:45, Null0
7
123.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
8
C 123.1.1.0/24 is directly connected, Serial0/2
9
D 123.0.0.0/8 is a summary, 00:05:45, Null0
在這里發現了問題,R2上面并沒有學到去往R3的回環接口3.3.3.3的路由條目,同樣R3上面也沒有學習到R2的回環接口的條目,這是因為在R1的物理接口s0/0上開啟了對EIGEP的水平分隔,通過下面的命令來關閉它:
1
R1(config)#
int
s 0/0
2
R1(config-if)#
no
ip
split-horizon
eigrp
100
3
R1(config-if)#
end
關閉之后再次查看R2的路由表,就可以學習到去往R3回環接口的路由條目了。
b.在幀中繼子接口上運行EIGRP
R2、R3、R4配置保持不變,直接右擊R1選擇"stop",然后再次右擊R1選擇"Start"重啟這臺路由器,由于沒有保存配置,R1將恢復初始狀態,現在要在它的物理接口s0/0上配置多點子接口:
01
R1(config)#
int
s 0/0
02
R1(config-if)#
encapsulation
frame-relay
03
R1(config-if)#
no
frame-relay
inverse-arp
04
R1(config-if)#
no
shut
/物理接口只需要打開即可/
05
R1(config-if)#
exit
06
R1(config)#
int
s 0/0.1 multipoint /配置多點子接口/
07
R1(config-subif)#
ip
add
123.1.1.1 255.255.255.0
08
R1(config-subif)#
frame-relay
map
ip
123.1.1.1 102
broadcast
ietf
09
R1(config-subif)#
frame-relay
map
ip
123.1.1.2 102
broadcast
ietf
10
R1(config-subif)#
frame-relay
map
ip
123.1.1.3 103
broadcast
ietf
11
12
/多點子接口默認對EIGRP的水平分隔也是開啟的,現在關閉它/
13
R1(config-subif)#
no
ip
split-horizon
eigrp
100
14
R1(config-subif)#
int
lo
0
15
R1(config-if)#
ip
add
1.1.1.1 255.255.255.0
16
R1(config-if)#
no
shut
17
R1(config-if)#router
eigrp
100
18
R1(config-router)#
net
1.1.1.0 0.0.0.255
19
R1(config-router)#
net
123.1.1.0 0.0.0.255
20
R1(config-router)#
end
c.在幀中繼點到點接口上運行EIGRP
R4幀中繼交換機的配置保持不變,直接右擊R1、R2、R3選擇"stop",然后再次右擊選擇"Start"重啟這幾臺路由器,將他們恢復初始狀態, 現在要在R1的物理接口s0/0上配置點到點子接口,由于多點子接口下所有對應的路由屬于同一網段,而點到點子接口,每個子接口對應了一個單獨網段,每個子接口就像一個單獨的物理接口一樣工作,所以不會出現水平分隔的問題:
R1配置:
01
R1(config)#
int
s 0/0
02
R1(config-if)#
encapsulation
frame-relay
03
R1(config-if)#
no
frame-relay
inverse-arp
04
R1(config-if)#
no
shut
/物理接口只需要開啟/
05
06
/使用點到點子接口/
07
R1(config-if)#
int
s 0/0.1
point-to-point
08
R1(config-subif)#
ip
add
12.1.1.1 255.255.255.0
09
/*
10
- 點到點子接口只需要封裝DLCI號即可,
11
- 從封裝的DLCI號可以得知,這個點到點子接口是用來連接R2的。
12
*/
13
R1(config-subif)#
frame-relay
interface
-dlci 102
14
15
/連接R3的點到點子接口/
16
R1(config-fr-dlci)#
int
s 0/0.2
point-to-point
17
R1(config-subif)#
ip
add
13.1.1.1 255.255.255.0
18
R1(config-subif)#
frame-relay
interface
-dlci 103
19
20
R1(config-fr-dlci)#
int
lo
0
21
R1(config-if)#
ip
add
1.1.1.1 255.255.255.0
22
R1(config-if)#
no
shut
23
R1(config-if)#router
eigrp
100
24
R1(config-router)#
net
1.1.1.0 0.0.0.255
25
R1(config-router)#
net
12.1.1.0 0.0.0.255
26
R1(config-router)#
net
13.1.1.0 0.0.0.255
27
R1(config-router)#
end
R2配置:
01
R2(config)#
int
s 0/2
02
R2(config-if)#
ip
add
12.1.1.2 255.255.255.0
03
R2(config-if)#
no
shut
04
R2(config-if)#
encapsulation
frame-relay
05
R2(config-if)#
no
frame-relay
inverse-arp
06
R2(config-if)#
frame-relay
map
ip
12.1.1.1 201
broadcast
ietf
07
R2(config-if)#
frame-relay
map
ip
12.1.1.2 201
broadcast
ietf
08
R2(config-if)#
int
lo
0
09
R2(config-if)#
ip
add
2.2.2.2 255.255.255.0
10
R2(config-if)#router
eigrp
100
11
R2(config-router)#
net
2.2.2.0 0.0.0.255
12
R2(config-router)#
net
12.1.1.0 0.0.0.255
13
R2(config-router)#
end
R3配置:
01
R3(config)#
int
s 0/1
02
R3(config-if)#
encapsulation
frame-relay
03
R3(config-if)#
no
frame-relay
inverse-arp
04
R3(config-if)#
frame-relay
map
ip
13.1.1.3 301
broadcast
ietf
05
R3(config-if)#
frame-relay
map
ip
13.1.1.1 301
broadcast
ietf
06
R3(config-if)#
ip
add
13.1.1.3 255.255.255.0
07
R3(config-if)#
no
shut
08
R3(config-if)#
int
lo
0
09
R3(config-if)#
ip
add
3.3.3.3 255.255.255.0
10
R3(config-if)#
no
shut
11
R3(config-if)#router
eigrp
100
12
R3(config-router)#
net
3.3.3.0 0.0.0.255
13
R3(config-router)#
net
13.1.1.0 0.0.0.255
14
R3(config-router)#
end
點到點子接口可以有效的避免水平分割帶來的問題,但點到點子接口會占用更多的IP地址。