1. 掌握 OSPFv3 的配置方法oop
2. 掌握在幀中繼環境下 OSPFv3 的配置方法測試
3. 掌握 OSPFv3 NSSA 的配置方法spa
4. 掌握外部路由彙總的配置3d
5. 掌握區域間路由的彙總配置router
實驗拓撲圖blog
IPv4地址表接口
Device進程 |
Interfaceip |
IP Addressci |
R1 |
F 0/0 |
10.1.9.1 |
S 1/0 |
192.168.9.1 |
|
R3 |
S 1/0 |
192.168.9.3
|
R4 |
S 1/0 |
192.168.9.4 |
R5 |
F 0/0 |
10.1.9.5 |
S 1/0 |
12.1.9.5 |
|
R6 |
F 0/0 |
10.1.9.6 |
F 0/1 |
11.1.9.6 |
|
R7 |
F 0/1 |
11.1.9.7 |
S 1/0 |
12.1.9.7 |
步驟1:開啓幀中繼交換功能
R2(config)#frame-relay switching
步驟2:配置接口封裝
R2(config)#int s 0/2
R2(config-if)#no shutdown
R2(config-if)#clock rate 128000
R2(config-if)#encapsulation frame-relay
R2(config)#int s 0/0
R2(config-if)#no shutdown
R2(config-if)#clock rate 128000
R2(config-if)#encapsulation frame-relay
R2(config)#int s 0/1
R2(config-if)#no shutdown
R2(config-if)#clock rate 128000
R2(config-if)#encapsulation frame-relay
(3) 步驟3:配置LMI類型
R2(config)#int s 0/2
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
R2(config)#int s 0/0
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
R2(config)#int s 0/1
R2(config-if)#frame-relay lmi-type cisco
R2(config-if)#frame-relay intf-type dce
(4) 步驟4:配置幀中繼交換表
R2(config)#int s 0/2
R2(config-if)#frame-relay route 103 interface s 0/0 301
R2(config-if)#frame-relay route 104 interface s 0/1 401
R2(config)#int Serial 0/0
R2(config-if)#frame-relay route 301 interface Serial0/2 103
R2(config)#int Serial 0/1
R2(config-if)#frame-relay route 401 interface Serial0/2 104
此時「show frame-relay route」
檢查幀中繼交換機是否正常
(5)步驟5:配置R一、R三、R4,使得它們可以互相通訊
R1(config)#int s 0/0
R1(config-if)#ip address 192.168.9.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay lmi-type cisco
R1(config-if)#no frame-relay inverse-arp //關閉自動映射
R1(config-if)#frame-relay map ip 192.168.9.3 103 broadcast
R1(config-if)#frame-relay map ip 192.168.9.4 104 broadcast
R3(config)#int s 0/1
R3(config-if)#ip address 192.168.9.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#encapsulation frame-relay
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#frame-relay map ip 192.168.9.1 301 broadcast
R4(config)#int s 0/0
R4(config-if)#ip address 192.168.9.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#encapsulation frame-relay
R4(config-if)#no frame-relay inverse-arp
R4(config-if)#frame-relay map ip 192.168.9.1 401 broadcast
進行ping命令測試
從R1ping到R3與R4
R1#show frame-relay map
發現已有兩條本地鏈接
步驟6:開始配置ospf
先配置外部路由器ospf (R六、R1爲例,R5.R8同理)
R6(config)#router ospf 1
R6(config-router)#router-id 6.6.6.6
R6 (config-router)#area 1 nssa――配置區域 1 爲 NSSA 區域
R6(config)#interface loopback 0
R6(config-if)#ip add 6.6.6.6 255.255.255.255
R6(config)#int f 0/0
R6(config-if)#ip add 10.1.9.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#ip ospf 1 area 0
R6(config-if)#int f 0/1
R6(config-if)#ip add 11.1.9.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#ip ospf 1 area 1
R6(config-if)#ex
R6(config)#router ospf 1
R6(config-router)#network 6.6.6.6 0.0.0.0 area 0
R6(config-router)#network 10.1.9.0 0.0.0.255 area 0
R6(config-router)#network 11.1.9.0 0.0.0.255 area 0
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config)#interface loopback 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config)#int f 0/0
R1(config-if)#ip add 10.1.9.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ip ospf 1 area 0
R1(config-if)#int s 0/0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#ex
R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 10.1.9.0 0.0.0.255 area 0
R1(config-router)#network 192.168.9.0 0.0.0.255 area 0
R1(config-router)#neighbor 192.168.9.3
R1(config-router)#neighbor 192.168.9.4
步驟7:配置幀中繼中路由器的ospf (R3爲例,R4同理)
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#ex
R3(config)#int loopback 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#ip ospf 1 area 2
R3(config-if)#int s 0/1
R3(config-if)# ip ospf 1 area 2
R3(config-if)# ip ospf priority 0
R3(config)#router ospf 1
R3(config-router)#network 3.3.3.3 0.0.0.0 area 2
R3(config-router)#network 192.168.9.0 0.0.0.255 area 2
已完成OSPFv2配置
測試路由通斷狀況
在R5上測試得出結果以下(從內部到外部皆ping通,實驗完成)
IPv6地址表
Device |
Interface |
IPv6 Address |
R1 |
F 0/0 |
2123::9:1/64 |
S 1/0.1 |
2356::9:1/64 |
|
Loopback 0 |
2011::1/128 |
|
R3 |
S 1/0.1 |
2356::9:3/64
|
Loopback 0 |
2033::1/128 |
|
R4 |
S 1/0.1 |
2356::9:4/64
|
Loopback 0 |
2044::1/128 |
|
R5 |
F 0/0 |
2123::9:5/64 |
S 1/0 |
2027::9:5/64: |
|
Loopback 0 |
2055::1/128 |
|
R6 |
F 0/0 |
2123::9:6/64 |
Loopback 0 |
2066::1/128 |
|
R7 |
S 1/0 |
2027::9:7/64: |
Loopback 0 |
2077::1/128 |
幀中繼配置與ospfv2相同。
1.完成接口 IPv6 地址的配置,注意不要忘記配置 loopback0
如下只展現 R3 和 R5 的配置:(R6與R5同理)
R1(config)#ipv6 unicast-routing ―――全局打開 IPv6 路由功能
R1config)#interface loopback 0
R1(config-if)#ipv6 enable
R1(config-if)#ipv6 address 2011::9:1/128―――配置 loopback0 接口地址
R1(config-if)#int f 0/0
R1(config-if)#ipv6 enable
R1(config-if)# ipv6 address 2123::9:1/64
R1(config-if)#no shut
R1(config-if)#int s 1/0
R1(config-if)#ipv6 enable
R1(config-if)# encapsulation frame-relay
R1(config-if)#no shut
R1(config)#interface serial 1/0.1 multipoint
R1(config-subif)#ipv6 address 2356::9:1/64
R1(config-subif)#frame-relay map ipv6 2356::9:3 103 broadcast
R1(config-subif)#frame-relay map ipv6 2356::9:4 104 broadcast
R1(config-subif)#frame-relay map ipv6 2356::9:1 104 broadcast
R1(config-subif)#frame-relay map ipv6 FE80::C804:1CFF:FE48:8 104 broadcast
R1(config-subif)#frame-relay map ipv6 FE80::C803:1CFF:FE48:8 103 broadcast
R3(config)#ipv6 unicast-routing
R3(config)#interface loopback 0
R3(config-if)#ipv6 address 2033::1/128
R3(config-if)#int s 1/0
R3(config-if)#ipv6 enable
R3(config-if)# encapsulation frame-relay
R3(config-if)#no shutdown
R3(config)#interface serial 1/0.1 multipoint
R3(config-subif)#ipv6 address 2356::9:3/64
R3(config-subif)#frame-relay map ipv6 2356::9:1 301 broadcast (R4用401)
R3(config-subif)#frame-relay map ipv6 2356::9:4 301 broadcast (R4用401)
R3(config-subif)#frame-relay map ipv6 2356::9:3 301 broadcast (R4用401)
R3(config-subif)#frame-relay map ipv6 FE80::C804:1CFF:FE48:8 304 broadcast(R4用C803,403)
R3(config-subif)#frame-relay map ipv6 FE80::C801:1CFF:FE48:8 301 broadcast (R4用401)
用show frame-relay pvc命令查看,幀中繼配置完成
2. 按實驗拓撲圖標識的區域,完成 OSPFv3 的基本配置。區域 1 爲 NSSA 區域。
R6(config)#ipv6 unicast-routing
R6(config)#ipv6 router ospf 1―――啓動 OSPFv3 進程
R6(config-rtr)#router-id 6.6.6.6
R6(config-rtr)#area 1 nssa――配置區域 1 爲 NSSA 區域
R6(config-rtr)#int f 0/0
R6(config-if)#ipv6 enable
R6(config-if)# ipv6 ospf 1 area 0
R6(config-if)#no shutdown
R6(config-if)#int loopback 0
R6(config-if)#ipv6 enable
R6(config-if)#ipv6 address 2066::1/128
R6(config-if)# ipv6 ospf 1 area 0
R6(config-if)#int f 0/1
R6(config-if)#ipv6 enable
R6(config-if)# ipv6 ospf 1 area 1
R6(config-if)#no shutdown
R5(config)#ipv6 unicast-routing
R5(config)#ipv6 router ospf 1―――啓動 OSPFv3 進程
R5(config-rtr)#router-id 5.5.5.5
R5(config-rtr)#area 1 nssa――配置區域 1 爲 NSSA 區域
R5(config-rtr)#int f 0/0
R5(config-if)#ipv6 enable
R5(config-if)# ipv6 ospf 1 area 0
R5(config-if)#no shutdown
R5(config-if)#int loopback 0
R5(config-if)#ipv6 enable
R5(config-if)#ipv6 address 2055::1/128
R5(config-if)# ipv6 ospf 1 area 0
R5(config-if)#int s 1/0
R5(config-if)#ipv6 enable
R5(config-if)# ipv6 ospf 1 area 1
R5(config-if)#no shutdown
R1(config)#ipv6 unicast-routing
R1(config)#ipv6 router ospf 1―――啓動 OSPFv3 進程
R1(config-rtr)#router-id 1.1.1.1
R1(config-rtr)#int f 0/0
R1(config-if)#ipv6 enable
R1(config-if)# ipv6 ospf 1 area 0
R1(config-if)#no shutdown
R1(config-if)#int loopback 0
R1(config-if)#ipv6 enable
R1(config-if)#ipv6 address 2011::1/128
R1(config-if)# ipv6 ospf 1 area 0
R1(config-if)#int s 1/0.1
R1(config-subif)#ipv6 enable
R1(config-subif)# ipv6 ospf 1 area 2
R1(config-subif)#ipv6 ospf neighbor FE80::C803:1CFF:FE48:8
R1(config-subif)#ipv6 ospf neighbor FE80::C804:1CFF:FE48:8
R3(config)#ipv6 router ospf 1
R3(config-rtr)#router-id 3.3.3.3
R3(config-rtr)#int loopback 0
R3(config-if)#ipv6 enable
R3(config-if)#ipv6 address 2033::1/128
R3(config-if)# ipv6 ospf 1 area 2
R3(config-if)#int s 1/0.1
R3(config-subif)#ipv6 enable
R3(config-subif)# ipv6 ospf 1 area 2
R3(config-subif)# ipv6 ospf priority 0
R3(config-subif)# ipv6 address FE80::C803:1CFF:FE48:8 link-local
R4config)#ipv6 router ospf 1
R4config-rtr)#router-id 4.4.4.4
R4config-rtr)#int loopback 0
R4config-if)#ipv6 enable
R4(config-if)#ipv6 address 2044::1/128
R4(config-if)# ipv6 ospf 1 area 2
R4(config-if)#int s 1/0.1
R4(config-subif)#ipv6 enable
R4(config-subif)# ipv6 ospf 1 area 2
R4(config-subif)# ipv6 ospf priority 0
R4(config-subif)# ipv6 address FE80::C804:1CFF:FE48:8 link-local
R7(config)#ipv6 unicast-routing
R7(config)#ipv6 router ospf 1―――啓動 OSPFv3 進程
R7(config-rtr)#router-id 7.7.7.7
R7(config-rtr)#area 1 nssa――配置區域 1 爲 NSSA 區域
R7(config-rtr)#int s 1/0
R7(config-if)#ipv6 enable
R7(config-if)# ipv6 ospf 1 area 1
R7(config-if)#no shutdown
R7(config-if)#int loopback 0
R7(config-if)#ipv6 enable
R7(config-if)#ipv6 address 2077::1/128
R7(config-if)# ipv6 ospf 1 area 1
R7(config-if)#int f 0/1
R7(config-if)#ipv6 enable
R7(config-if)# ipv6 ospf 1 area 1
R7(config-if)#no shutdown
3.檢查 OSPFv3 的鄰居關係
在 R31上檢查,能夠看到鄰居的 Router-ID 都是用 IPv4 的地址格式標識
R1#show ipv6 ospf neighbor
4.測試路由通斷狀況在R3測試。Ospfv3配置成功。
實驗總結:
因爲上年的IPV4基礎沒打好,因此在完成OSPF上有點困難,看了不少文檔,搞了好久,仍是不會,最好請教了同窗。Ipv6的部分也作了不少晚上,須要配置的地方不少很複雜,一個不當心就會配置出錯,不是打錯地址就是漏打什麼,十分的考驗耐心。