幀中繼(Frame-relay)之全網互連

        一、幀中繼(Frame-Relay)是一種WAN連接技術;工作在OSI模型的第二層(數據鏈接層),是一種二層封裝技術,並且是一種面向連接的服務;通過VC實現兩個分支站點的遠程互連。
        FR於1990年首次被標準化。現已經取代X.25技術,它簡化了第2層的功能,只提供基本的錯誤檢測功能,提高了網絡對信息的處理效率(由於廣域網鏈路可靠性大大提高,不需要再像X.25那種結構效率太低)。
       在利用幀中繼做遠程互連時,用戶首先需要將自已的設備與ISP的設備連起來,在這個連接過程中,要用到以下三種設備。
       1、用戶前端設備(CPE)也叫CSU/DSU。用戶本地路由器所用的信令與電信的局端設備所用的信令是不一樣,CSU/DSU充當翻譯作用。
       2、數據終端設備(DTE)也就是用戶自已的路由器。
       3、數據通信設備(DCE)也就是電信的局端設備。
        二、FR連接運行在虛電路(VC)上,每條VC都由一個數據鏈路連接標識符(DLCI)標識。並將此DLCI映射到一個IP地址。DLCI號在幀中繼中相當於二層地址。
        VC分爲:永久虛電路(PVC)、交換虛電路(SVC)。
        PVC:需要不斷通過FR在DTE之間傳輸數據時使用。
        SVC:用於間歇性的通過FR在DTE之間傳輸數據。要考慮ISP是否支持。
        FR交換機將2臺路由器的DLCI關聯起來,從而創建1條PVC。
        DLCI只具有本地意義。
     DLCI的範圍(16-1007)
     0-15和1008-1023被保留
    1019和1020保留用於廣播
    1023保留用於Cisco LMI
    0保留用於LMI類型的ANSI和Q.933A

       DLCI地址映射:
    要通過FR傳輸數據,必須將本地DLCI和目的IP地址關聯。
    地址映射可手工配置,也可動態生成。
    動態生成時使用幀中繼反向地址解析協議(IARP)。

      本地管理接口(LMI)
  LMI是指路由器與電信的局端FR交換機之間通信的協議,負責管理設備之間的連接以及維護連接狀態。
      LMI是可以配置的,但路由器嘗試自動檢測FR交換機使用的LMI類型。
      LMI的三種類型:Cisco/ANSI/Q933A
      FR網絡是非廣播多路訪問(NBMA)網絡。

三、幀中繼(Frame-relay)之全網互連的配置

       1、拓樸圖如下:

2、R5模擬成幀中繼交換機,按如下步驟配置
----------------------------------------------------------------------------------
FR5(config)#no ip routing                                      #關閉路由功能
FR5(config)#frame-relay switching                     #將R5配置成幀中繼交換機
FR5(config)#int s1/1    
FR5(config-if)#encapsulation frame-relay ? 
  MFR   Multilink Frame Relay bundle interface
  ietf  Use RFC1490/RFC2427 encapsulation
  <cr>
FR5(config-if)#encapsulation frame-relay                   #默認是Cisco封裝類型,如果連接的是Cisco路由器,建議使用這種封裝,如果連接是非Cisco路由器,則選擇ietf。
FR5(config-if)#clock rate 64000                                    #在接口上配置時鐘頻率
FR5(config-if)#frame-relay lmi-type cisco                   #指定接口LMI的類型[cisco|ansi|q933a]
FR5(config-if)#frame-relay intf-type dce                      #將接口指定爲DCE接口
FR5(config-if)#frame-relay route 102 int s1/2 201    #寫幀中繼到R2的路由,實際上就是建立PVC;frame-relay route + 入接口DLCI號 + 出接口 + 出接口的DLCI號
FR5(config-if)#frame-relay route 103 int s1/3 301    #寫幀中繼到R3的路由
FR5(config-if)#frame-relay route 104 int s1/4 401    #寫幀中繼到R4的路由
FR5(config-if)#no shut                                                   #激活接口
FR5(config-if)#exit

FR5(config)#int s1/2
FR5(config-if)#encapsulation frame-relay
FR5(config-if)#clock rate 64000
FR5(config-if)#frame-relay lmi-type cisco
FR5(config-if)#frame-relay intf-type dce
FR5(config-if)#frame-relay route 201 int s1/1 102
FR5(config-if)#frame-relay route 203 int s1/3 302
FR5(config-if)#frame-relay route 204 int s1/4 402
FR5(config-if)#no shut
FR5(config-if)#exit

FR5(config)#int s1/3
FR5(config-if)#encapsulation frame
FR5(config-if)#clock rate 64000
FR5(config-if)#frame-relay intf-type dce 
FR5(config-if)#frame-relay lmi-type cisco
FR5(config-if)#frame-relay route 301 int s1/1 103
FR5(config-if)#frame-relay route 304 int s1/4 403
FR5(config-if)#frame-relay route 302 int s1/2 203
FR5(config-if)#no shutdown
FR5(config-if)#exit

FR5(config)#int s1/4
FR5(config-if)#encapsulation frame-relay
FR5(config-if)#clock rate 64000
FR5(config-if)#frame-relay lmi-type cisco
FR5(config-if)#frame-relay intf-type dce
FR5(config-if)#frame-relay route 402 int s1/2 204
FR5(config-if)#frame-relay route 403 int s1/3 304
FR5(config-if)#frame-relay route 401 int s1/1 104
FR5(config-if)#no shut
----------------------------------------------------------------------------------
到此,FR5幀中繼交換機就模擬好了!

3、北京總部R1路由器的配置
----------------------------------------------------------------------------------
R1(config)#int s1/1
R1(config-if)#ip add 12.0.0.1 255.255.255.0        #配置IP
R1(config-if)#encapsulation frame-relay              #封裝幀中繼
R1(config-if)#no shut                                                #激活接口
R1(config-if)#exit
R1(config)#int loopback 0                                       #迴環接口用於模擬內網測試
R1(config-if)#ip add 1.1.1.1 255.255.255.255   

用ping去測試網絡的連通性
R1(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/88/144 ms
R1(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/96/140 ms
R1(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/104/180 ms

R1(config-if)#do ping 12.0.0.1                            #R1不能夠ping通自己,通過show frame-relay map 可看到沒有指向自己的Map

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

R1(config-if)#do show frame-relay map           #查看frame-relay map
Serial1/1 (up): ip 12.0.0.2 dlci 102(0x66,0x1860), dynamic,
              broadcast,, status defined, active
Serial1/1 (up): ip 12.0.0.3 dlci 103(0x67,0x1870), dynamic,
              broadcast,, status defined, active
Serial1/1 (up): ip 12.0.0.4 dlci 104(0x68,0x1880), dynamic,
              broadcast,, status defined, active
----------------------------------------------------------------------------------

4、上海分部R2路由器的配置
----------------------------------------------------------------------------------
R2(config)#int s1/2
R2(config-if)#encapsulation frame-relay            #封裝幀中繼
R2(config-if)#ip add 12.0.0.2 255.255.255.0     #配置IP
R2(config-if)#no shut                                             #激活接口
R2(config-if)#exit
R2(config)#int lo 0                                                 #迴環接口用於模擬內網測試
R2(config-if)#ip add 2.2.2.2 2
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/79/108 ms
R2(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/88/112 ms
R2(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/76/120 ms

R2(config-if)#do ping 12.0.0.2                              #R2不能夠ping通自己,沒有指向自己的Map

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
                                    
R2(config-if)#do show frame-relay map             #查看frame-relay map
Serial1/2 (up): ip 12.0.0.1 dlci 201(0xC9,0x3090), dynamic,
              broadcast,, status defined, active
Serial1/2 (up): ip 12.0.0.3 dlci 203(0xCB,0x30B0), dynamic,
              broadcast,, status defined, active
Serial1/2 (up): ip 12.0.0.4 dlci 204(0xCC,0x30C0), dynamic,
              broadcast,, status defined, active
----------------------------------------------------------------------------------

5、深圳分部R3路由器的配置
----------------------------------------------------------------------------------
R3(config)#int s1/3
R3(config-if)#encapsulation frame-relay
R3(config-if)#ip add 12.0.0.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/68/104 ms
R3(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/88/148 ms
R3(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/73/108 ms

R3(config-if)#do ping 12.0.0.3                      #R3不能夠ping通自己,沒有指向自己的Map

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

R3(config-if)#do show frame-relay map    #查看frame-relay map
Serial1/3 (up): ip 12.0.0.1 dlci 301(0x12D,0x48D0), dynamic,
              broadcast,, status defined, active
Serial1/3 (up): ip 12.0.0.2 dlci 302(0x12E,0x48E0), dynamic,
              broadcast,, status defined, active
Serial1/3 (up): ip 12.0.0.4 dlci 304(0x130,0x4C00), dynamic,
              broadcast,, status defined, active
----------------------------------------------------------------------------------

6、廣州分部R4路由器的配置
----------------------------------------------------------------------------------
R4(config)#int s1/4
R4(config-if)#encapsulation frame-relay
R4(config-if)#ip add 12.0.0.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/76/100 ms
R4(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/89/140 ms
R4(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/96/172 ms

R4(config-if)#do ping 12.0.0.4            #R4不能夠ping通自己,沒有指向自己的Map

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

R4#show frame-relay map               #查看frame-relay map
Serial1/4 (up): ip 12.0.0.1 dlci 401(0x191,0x6410), dynamic,
              broadcast,, status defined, active
Serial1/4 (up): ip 12.0.0.2 dlci 402(0x192,0x6420), dynamic,
              broadcast,, status defined, active
Serial1/4 (up): ip 12.0.0.3 dlci 403(0x193,0x6430), dynamic,
              broadcast,, status defined, active
----------------------------------------------------------------------------------

通過show frame-relay map 可看到在R1、R2、R3、R4上所見到的幀中繼MAP都是Inverse-ARP動態(dynamic)映射過來的,並且都支持廣播;還有就是他們上面都沒有自己的map,所以不能ping通自己。

四、實際應用中通常都是手動映射的(配置靜態幀中繼)

1、R1上手動映射幀中繼MAP
----------------------------------------------------------------------------------
R1(config)#int s1/1
R1(config-if)#no frame-relay inverse-arp                      #關閉幀中繼的逆向ARP,不允許動態映射
R1(config-if)#do clear frame-relay inarp                       #清除逆向ARP留下的cache
R2(config-if)#do show frame-relay map                       #已清空ARP留下的緩存

R1(config-if)#frame-relay map ip 12.0.0.2 102 broadcast     #將IP地址靜態映射到DLCI,加broadcast參數實現僞廣播;frame-relay map ip +目的IP + 本地DLCI號 +模擬廣播
R1(config-if)#frame-relay map ip 12.0.0.3 103 broadcast     #同上
R1(config-if)#frame-relay map ip 12.0.0.4 104 broadcast     #同上
R1(config-if)#frame-relay map ip 12.0.0.1 102 broadcast     #指向自己的Map,此處的DLCI號也可以是103,104
用ping 測試網絡的連通性
R1(config-if)#do ping 12.0.0.1                                                     #可以ping 通自己了!

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 160/214/276 ms
R1(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/52/124 ms
R1(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/48/140 ms
R1(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/65/140 ms
----------------------------------------------------------------------------------

2、R2上手動映射幀中繼MAP
----------------------------------------------------------------------------------
R2(config)#int s1/2
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#do clear frame-relay inarp
R2(config-if)#do show frame-relay map                                   #已清空ARP留下的緩存

R2(config-if)#frame-relay map ip 12.0.0.1 201 broadcast
R2(config-if)#frame-relay map ip 12.0.0.3 203 broadcast
R2(config-if)#frame-relay map ip 12.0.0.4 204 broadcast
R2(config-if)#frame-relay map ip 12.0.0.2 201 broadcast    #此處的DLCI號也可以是203,204
R2(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/69/140 ms
R2(config-if)#do ping 12.0.0.2                                                 #可以ping 通自己了!

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/70/156 ms
R2(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/49/136 ms
R2(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/49/140 ms

3、R3上手動映射幀中繼MAP
----------------------------------------------------------------------------------
R3(config)#int s1/3
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#do clear frame-relay inarp
R3(config-if)#do show frame-relay map                                    #已清空ARP留下的緩存

R3(config-if)#frame-relay map ip 12.0.0.1 301 broadcast
R3(config-if)#frame-relay map ip 12.0.0.2 302 broadcast
R3(config-if)#frame-relay map ip 12.0.0.4 304 broadcast
R3(config-if)#frame-relay map ip 12.0.0.3 301 broadcast    #此處的DLCI號也可以是303,302
R3(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/45/112 ms
R3(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/52/124 ms
R3(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/77/172 ms
R3(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/44/112 ms

4、R4上手動映射幀中繼MAP
----------------------------------------------------------------------------------
R4(config)#int s1/4
R4(config-if)#no frame-relay inverse-arp
R4(config-if)#do clear frame-relay inarp
R4(config-if)#do show frame-relay map                                 #已清空ARP留下的緩存

R4(config-if)#frame-relay map ip 12.0.0.1 401 broadcast
R4(config-if)#frame-relay map ip 12.0.0.2 402 broadcast
R4(config-if)#frame-relay map ip 12.0.0.3 403 broadcast
R4(config-if)#frame-relay map ip 12.0.0.4 401 broadcast   #此處的DLCI號也可以是403,402
R4(config-if)#do ping 12.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/58/100 ms
R4(config-if)#do ping 12.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/52/112 ms
R4(config-if)#do ping 12.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/51/144 ms
R4(config-if)#do ping 12.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/70/160 ms

五、在R、R2、R3和R4上運行一種路由協議,宣告接口,此處用RIPv2

1、在R1上運行RIPv2路由協議
----------------------------------------------------------------------------
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 1.0.0.0
R1(config-router)#network 12.0.0.0
R1(config-router)#do show ip route      #在R2、R3、R4都啓用了路由協議纔可查看到所有路由條目
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 12.0.0.2, 00:01:01, Serial1/1
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/1] via 12.0.0.3, 00:01:01, Serial1/1
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 12.0.0.4, 00:01:01, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/1

2、在R2上運行RIPv2路由協議
----------------------------------------------------------------------------
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#netowrk 2.0.0.0
R2(config-router)#network 12.0.0.0
R2(config-router)#do show ip route      #在R1、R3、R4都啓用了路由協議纔可查看到所有路由條目
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
R       1.1.1.1 [120/1] via 12.0.0.1, 00:00:17, Serial1/2
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/2] via 12.0.0.3, 00:00:17, Serial1/2
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/2] via 12.0.0.4, 00:00:17, Serial1/2
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/2

3、在R3上運行RIPv2路由協議

----------------------------------------------------------------------------
R3(config)#router rip   
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 3.0.0.0
R3(config-router)#network 12.0.0.0
R3(config-router)#do show ip route     #在R1、R2、R4都啓用了路由協議纔可查看到所有路由條目
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
R       1.1.1.1 [120/1] via 12.0.0.1, 00:00:20, Serial1/3
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 12.0.0.2, 00:00:20, Serial1/3
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/2] via 12.0.0.4, 00:00:21, Serial1/3
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/3

4、在R4上運行RIPv2路由協議
----------------------------------------------------------------------------
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 4.0.0.0
R4(config-router)#network 12.0.0.0
R4(config-router)#do show ip route    #在R1、R2、R3都啓用了路由協議纔可查看到所有路由條目
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
R       1.1.1.1 [120/1] via 12.0.0.1, 00:00:24, Serial1/4
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 12.0.0.2, 00:00:24, Serial1/4
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/2] via 12.0.0.3, 00:00:24, Serial1/4
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/4


六、以上R1、R2、R3、R4之間實現了全網互連(full-mesh),可提供最大容錯能力,不過此連接成本最爲昂貴。
可以通過實現部分連接,只對重要結點採取多鏈路互連即可,並且從安全角度考慮,如允許總部訪問各分支機構,各分支機構只能訪問總部,不能相互訪問。又或者分支機構只能通過總部再訪問其他分支機構。
1、在幀中繼交換機FR5上No掉各分支機構互連的幀中繼路由,只保留去往總部的。
----------------------------------------------------------------------------
FR5(config)#int s1/2
FR5(config-if)#no frame-relay route 203 int s1/3 302
FR5(config-if)#no frame-relay route 204 int s1/4 402
FR5(config-if)#exit

FR5(config)#int s1/3
FR5(config-if)#no frame-relay route 304 int s1/4 403
FR5(config-if)#no frame-relay route 302 int s1/2 203
FR5(config-if)#exit

FR5(config)#int s1/4
FR5(config-if)#no frame-relay route 402 int s1/2 204
FR5(config-if)#no frame-relay route 403 int s1/3 304
FR5(config-if)#exit
此時,總部能與各分支機構通信,各分支機構之間已不能再通信。
----------------------------------------------------------------------------
2、幀中繼交換機FR5上已沒有各分支機構間的的幀中繼路由,所以可清除各分支機構R2、R3、R4上無用的靜態映射幀中繼MAP,見如下:
清除R2上無用的靜態映射幀中繼MAP
----------------------------------------------------------------------------------
R2(config)#int s1/2
R2(config-if)#do clear frame-relay inarp
R2(config-if)#no frame-relay map ip 12.0.0.3 203 broadcast
R2(config-if)#no frame-relay map ip 12.0.0.4 204 broadcast
清除R3上無用的靜態映射幀中繼MAP
----------------------------------------------------------------------------------
R3(config)#int s1/3
R3(config-if)#no frame-relay map ip 12.0.0.2 302 broadcast
R3(config-if)#no frame-relay map ip 12.0.0.4 304 broadcast

清除R4上無用的靜態映射幀中繼MAP
----------------------------------------------------------------------------------
R4(config)#int s1/4
R4(config-if)#do clear frame-relay inarp
R4(config-if)#no frame-relay map ip 12.0.0.2 402 broadcast
R4(config-if)#no frame-relay map ip 12.0.0.3 403 broadcast
----------------------------------------------------------------------------------

3、按以下方式可讓各分支構通過總部互訪。
----------------------------------------------------------------------------------
R2(config)#int s1/2                                                         
R2(config-if)#frame-relay map ip 12.0.0.4 201 broadcast
R2(config-if)#frame-relay map ip 12.0.0.3 201 broadcast
R2(config-if)#do clear ip route *

R2(config)#int s1/3
R3(config-if)#frame-relay map ip 12.0.0.2 301 broadcast
R3(config-if)#frame-relay map ip 12.0.0.4 301 broadcast
R2(config-if)#frame-relay map ip 12.0.0.3 201 broadcast
R3(config-if)#do clear ip route *

R2(config)#int s1/4
R4(config-if)#frame-relay map ip 12.0.0.2 401 broadcast
R4(config-if)#frame-relay map ip 12.0.0.3 401 broadcast
R4(config-if)#do clear ip route *

測試信息就不貼上了,大家有興趣可以做做,一塊討論哈!


   


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章