OSPFv3綜合實驗(GNS3)

1、實驗目的redis

1.  掌握 OSPFv3(v2) 的配置方法網絡

2.  掌握在幀中繼環境下 OSPFv3 (v2)的配置方法oop

3.  掌握 OSPFv3(v2) NSSA 的配置方法學習

4.  掌握外部路由彙總的配置測試

5.  掌握區域間路由的彙總配置spa

2、OSPFv2實驗拓撲圖3d

 

3、OSPFv2網絡地址規劃router

IPv4地址表blog

Device接口

Interface

IP Address

R1

F0/0

10.1.19.1

S1/0

192.168.19.1

R3

S1/0

192.168.19.3

R4

S1/0

192.168.19.4

R5

F0/0

10.1.19.5

S1/0

12.1.19.5

R6

F0/0

10.1.19.6

F0/1

11.1.19.6

R7

F0/1

11.1.19.7

S1/0

12.1.19.7

R8

 

 

 

 

4、OSPFv2配置步驟

步驟1:開啓R2幀中繼交換功能

R2(config)#frame-relay switching

步驟2:配置各接口封裝

R2(config)#interface Serial 1/2

R2(config-if)#no shutdown

R2(config-if)#clock rate 128000   

R2(config-if)#encapsulation frame-relay

 

R2(config)#interface Serial 1/0

R2(config-if)#no shutdown

R2(config-if)#clock rate 128000 

R2(config-if)#encapsulation frame-relay

 

R2(config)#interface Serial 1/1

R2(config-if)#no shutdown

R2(config-if)#clock rate 128000 

R2(config-if)#encapsulation frame-relay

步驟3:配置LMI類型

R2(config)#interface Serial 1/2

R2(config-if)#frame-relay lmi-type cisco

R2(config-if)#frame-relay intf-type dce

 

R2(config)#interface Serial 1/0

R2(config-if)#frame-relay lmi-type cisco

R2(config-if)#frame-relay intf-type dce

 

R2(config)#interface Serial 1/1

R2(config-if)#frame-relay lmi-type cisco

R2(config-if)#frame-relay intf-type dce

步驟4:配置幀中繼交換表

R2(config)#interface Serial 1/2

R2(config-if)#frame-relay route 103 interface Serial 1/0 301

R2(config-if)#frame-relay route 104 interface Serial 1/1 401

 

R2(config)#interface Serial 1/0

R2(config-if)#frame-relay route 301 interface Serial 1/2 103

 

R2(config)#interface Serial 1/1

R2(config-if)#frame-relay route 401 interface Serial 1/2 104

此時執行命令「show frame-relay route」來檢查幀中繼交換機是否正常:

步驟5:配置R一、R三、R4,使得它們可以互相通訊

R1(config)#interface Serial 1/0

R1(config-if)#ip address 192.168.19.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.19.3 103 broadcast

R1(config-if)#frame-relay map ip 192.168.19.4 104 broadcast

 

R3(config)#interface Serial 1/0

R3(config-if)#ip address 192.168.19.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.19.1 301 broadcast

 

R4(config)#interface Serial 1/0

R4(config-if)#ip address 192.168.19.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.19.1 401 broadcast

 

執行ping命令測試:

R1 ping R3與R4

在R1執行命令「show frame-relay PVC」

 

顯示存在兩條本地鏈接。

步驟6:開始配置OSPF

先配置外部路由器OSPF(配置以R六、R1爲例,R五、R7同理)

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 address 6.6.6.6 255.255.255.255

R6(config)#interface FastEthernet 0/0

R6(config-if)#ip address 10.1.19.6 255.255.255.0

R6(config-if)#no shutdown

R6(config-if)#ip ospf 1 area 0

R6(config-if)#interface FastEthernet 0/1

R6(config-if)#ip address 11.1.19.6 255.255.255.0

R6(config-if)#no shutdown

R6(config-if)#ip ospf 1 area 1

R6(config-if)#exit

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.19.0 0.0.0.255 area 0

R6(config-router)#network 11.1.19.0 0.0.0.255 area 1

R1(config)#router ospf 1

R1(config-router)#router-id 1.1.1.1

R1(config)#interface loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config)#interface FastEthernet 0/0

R1(config-if)#ip add 10.1.19.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#ip ospf 1 area 0

R1(config-if)#interface Serial 1/0

R1(config-if)#ip ospf 1 area 0

R1(config-if)#exit

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.19.0 0.0.0.255 area 0

R1(config-router)#network 192.168.19.0 0.0.0.255 area 2

R1(config-router)#neighbor 192.168.19.3

R1(config-router)#neighbor 192.168.19.4

 

步驟7:配置幀中繼中路由器的OSPF(以R3爲例,R4同理)

R3(config)#router ospf 1

R3(config-router)#router-id 3.3.3.3

R3(config-router)#exit

R3(config)#interface loopback 0

R3(config-if)#ip address 3.3.3.3 255.255.255.255

R3(config-if)#ip ospf 1 area 2

R3(config-if)# interface Serial 1/0

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.19.0 0.0.0.255 area 2

此時已完成OSPFv2配置,在R1上查OSPF鄰居關係:

R1#show ipv6 ospf neighbor

 

接着測試路由通斷狀況,在R5上測試得出結果以下:

 

從內部到外部皆ping通,實驗完成。

5、OSPFv3實驗拓撲圖

 

 

6、OSPFv3網絡地址規劃

IPv6地址表

Device

Interface

IPv6 Address

R1

F0/0

2123::19:1/64

S1/0.1

2356::19:1/64

Loopback 0

2011:19::1/128

R3

S1/0.1

2356::19:3/64

Loopback 0

2033:19::1/128

R4

S1/0.1

2356::19:4/64

Loopback 0

2044:19::1/128

R5

F0/0

2123::19:5/64

S1/0

2027::19:5/64

Loopback 0

2055:19::1/128

R6

F0/0

2123::19:6/64

Loopback 0

2066:19::1/128

Loopback 1

2166:19::1/128

R7

S1/0

2027::19:7/64

Loopback 0

2077:19::1/128

7、OSPFv3配置步驟

幀中繼R2配置與第二部分OSPFv2相同。

步驟1:完成接口 IPv6地址的配置,而且在路由上配置 loopback0

R1(config)#ipv6 unicast-routing              //全局打開 IPv6路由功能

R1config)#interface loopback 0

R1(config-if)#ipv6 enable

R1(config-if)#ipv6 address 2011:19::1/128    //配置 loopback0接口地址

R1(config-if)#interface FastEthernet 0/0

R1(config-if)#ipv6 enable

R1(config-if)#ipv6 address 2123::19:1/64

R1(config-if)#no shutdown

R1(config-if)#interface Serial 1/0

R1(config-if)#ipv6 enable

R1(config-if)# encapsulation frame-relay

R1(config-if)#no shutdown

R1(config)#interface serial 1/0.1 multipoint

R1(config-subif)#ipv6 address 2356::19:1/64

R1(config-subif)#frame-relay map ipv6 2356::19:3 103 broadcast 

R1(config-subif)#frame-relay map ipv6 2356::19:4 104 broadcast

R1(config-subif)#frame-relay map ipv6 2356::19: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:19::1/128

R3(config-if)# interface Serial 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::19:3/64

R3(config-subif)#frame-relay map ipv6 2356::19:1 301 broadcast 

R3(config-subif)#frame-relay map ipv6 2356::19:4 301 broadcast

R3(config-subif)#frame-relay map ipv6 2356::19:3 301 broadcast

R3(config-subif)#frame-relay map ipv6 FE80::C804:1CFF:FE48:8 304 broadcast

R3(config-subif)#frame-relay map ipv6 FE80::C801:1CFF:FE48:8 301 broadcast

 

R4(config)#ipv6 unicast-routing

R4(config)#interface loopback 0

R4(config-if)#ipv6 address 2044:19::1/128

R4(config-if)# interface Serial 1/0

R4(config-if)#ipv6 enable

R4(config-if)# encapsulation frame-relay

R4(config-if)#no shutdown

R4(config)#interface serial 1/0.1 multipoint

R4(config-subif)#ipv6 address 2356::19:4/64

R4(config-subif)#frame-relay map ipv6 2356::19:1 401 broadcast 

R4(config-subif)#frame-relay map ipv6 2356::19:4 401 broadcast

R4(config-subif)#frame-relay map ipv6 2356::19:3 401 broadcast

R4(config-subif)#frame-relay map ipv6 FE80::C803:1CFF:FE48:8 403 broadcast

R4(config-subif)#frame-relay map ipv6 FE80::C801:1CFF:FE48:8 401 broadcast

 

執行ping命令測試:

嘗試R1上ping通 R3和R4

 

用「show frame-relay pvc」命令查看:

幀中繼配置完成。

 

步驟2:按實驗拓撲圖標識的區域,完成 OSPFv3的基本配置。其中區域 1NSSA 區域。

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)#interface FastEthernet 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:19::1/128

R6(config-if)# ipv6 ospf 1 area 0

R6(config-if)#interface FastEthernet 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)#interface FastEthernet 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:19::1/128

R5(config-if)# ipv6 ospf 1 area 0

R5(config-if)#interface Serial 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)#interface FastEthernet 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:19::1/128

R1(config-if)# ipv6 ospf 1 area 0

R1(config-if)#interface Serial 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

R1(config-subif)# ipv6 address FE80::C801:1CFF:FE48:8 link-local

 

R3(config)#ipv6 router ospf 1

R3(config-rtr)#router-id 3.3.3.3

R3(config-rtr)#interface loopback 0

R3(config-if)#ipv6 enable

R3(config-if)#ipv6 address 2033:19::1/128

R3(config-if)# ipv6 ospf 1 area 2

R3(config-if)#interface Serial 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)#interface loopback 0

R4config-if)#ipv6 enable

R4(config-if)#ipv6 address 2044:19::1/128

R4(config-if)# ipv6 ospf 1 area 2

R4(config-if)#interface Serial 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:19::1/128

R7(config-if)# ipv6 ospf 1 area 1

R7(config-if)#interface FastEthernet 0/1

R7(config-if)#ipv6 enable

R7(config-if)# ipv6 ospf 1 area 1

R7(config-if)#no shutdown

步驟3:檢查 OSPFv3的鄰居關係

    R3上檢查,能夠看到鄰居的 Router-ID都是用 IPv4的地址格式標識

R1#show ipv6 ospf neighbor

 

步驟4:測試路由通斷狀況在R4測試,OSPFv3配置成功

 

在本實驗步驟基礎上引入外部路由類型 5和外部路由類型 7

(1) 在 R6上新增長一個loopback1接口,地址爲2166::1/128,而後重分佈進入OSPFv3:

R6(config)#interface loopback 1

R6(config-if)#ipv6 address 2166:19::1/128

R6(config-if)#exit

R6(config)#ipv6 router ospf 1

R6(config-rtr)#redistribute connected

(2)配置R7和R8的RIPng,而後重分佈RIPng 到OSPFv3:

R8(config)#ipv6 router rip yeslab

R8(config-rtr)#exit

R8(config)#interface FastEthernet 0/0

R8(config-if)#ipv6 rip yeslab enable

R8(config-if)#exit

 

R7(config)#ipv6 router rip yeslab

R7(config-rtr)#exit

R7(config)#interface FastEthernet 0/0

R7(config-if)#ipv6 rip yeslab enable

R7(config-if)#exit

R7(config)#ipv6 router ospf 1

R7(config-rtr)#redistribute rip yeslab         //重分佈RIPng到OSPFv3

R7(config-rtr)#redistribute connected        

//因爲重分佈RIPng,不能把鏈接R7的接口網段重分佈進入OSPFv3,所以重分佈直連,把鏈接R7的網段重分佈到OSPFv3

8、心得體會

本次實驗在IPv4的OSPFv2實驗配置基礎上進行IPv6的OSPFv3實驗配置,在配置中遇到了許多問題,包括IPv6地址的路由分配以及在OSPFv3的步驟基礎上引入RIPng重分佈,在與小組成員的討論中合理進行了組網規劃並肯定好OSPF區域,在這一環節上加深了對OSPF的理解。經過OSPFv2以及OSPFv3對比實驗,也讓我明白了IPv4和IPv6的異同,爲以後的IP課程學習打下了良好的基礎。

相關文章
相關標籤/搜索