OSPFv3與OSPF的配置


IPv6 路由-OSPFv3

實驗目的

1.   掌握 OSPFv3 的配置方法

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

3.   掌握 OSPFv3 NSSA 的配置方法

4.   掌握外部路由匯總的配置

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

實驗拓撲圖

 

IPv4地址表

Device

Interface

IP Address

R1

F 0/0

10.1.99.1

S 0/0

192.168.99.1

R3

S 0/0

192.168.99.3

R4

S 0/0

192.168.99.4

R5

F 0/0

10.1.99.5

S 0/0

12.1.99.5

R6

F 0/0

10.1.99.6

F 0/1

11.1.99.6

R8

F 0/1

11.1.99.8

S 0/0

12.1.99.8

 

R2(config)#frame-relay switching

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

 

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)#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

 

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 route 103 interface s 0/1 301

 R2(config-if)#frame-relay route 104 interface s 0/2 401

 

R2(config)#int s 0/1

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

 

R2(config)#int s 0/2

R2(config-if)#frame-relay route 401 interface Serial0/0 104

show frame-relay route檢查幀中繼交換機是否正常

 

 

 

 

R1(config)#int s 0/0

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

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

 

R3(config)#int s 0/0

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

 

R4(config)#int s 0/0

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

 

進行ping命令測試

從R1ping到R3與R4

 

 

 

R1#show frame-relay map

 

 

 

配置ospf

 

先配置外部路由器ospf  (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.99.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.99.6 255.255.255.0

R6(config-if)#no shut

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

R6(config-router)#network 11.1.99.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 add 1.1.1.1 255.255.255.255

R1(config)#int f 0/0

R1(config-if)#ip add 10.1.99.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)#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.99.0 0.0.0.255 area 0

R1(config-router)#network 192.168.99.0 0.0.0.255 area 0

R1(config-router)#neighbor 192.168.99.3

R1(config-router)#neighbor 192.168.99.4

配置幀中繼中路由器的ospf  (R4)

R3(config)#router ospf 1

R3(config-router)#router-id 3.3.3.3

R3(config-router)#exit

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

 

已完成OSPFv2配置,在R1上查ospf鄰居關系

R1#show ipv6 ospf neighbor

 

 

 

測試路由通斷情況

在R5上測試得出結果如下(從內部到外部皆ping通,實驗完成)

 

 

 

 

 

 

 

IPV6地址規划

Device

Interface

IP Address

R4

S0/0

2001:DB8:99:1::2/64

R3

S0/0

2001:DB8:99:1::1/64

R2

S0/0

2001:DB8:99:1::3/64

F0/0

2001:DB8:99:2::1/64

R6

F0/0

2001:DB8:99:2::2/64

F0/1

2001:DB8:99:3::1/64

R7

F0/0

2001:DB8:99:2::3/64

F0/1

2001:DB8:99:4::1/64

R8

F0/0

2001:DB8:99:3::2/64

F0/1

2001:DB8:99:4::2/64

F1/0

2001:DB8:99:5::2/64

R5

F0/0

2001:DB8:99:5::1/64

在R1,R2,R3,R4,上配置幀中繼,R1作為幀中繼交換機

R1:

R1(config)#frame-relay switching

R1(config)#int s0/0

R1(config-if)#encapsulation frame-relay

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

R1(config-if)#clock rate 64000

R1(config-if)#frame-relay route 102 interface serial 0/1 201

R1(config-if)#frame-relay route 103 interface  serial 0/2 301

R1(config-if)#no shutdown

R1(config)#int s0/1

R1(config-if)#encapsulation frame-relay

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

R1(config-if)#clock rate 64000

R1(config-if)#frame-relay route 201 interface serial 0/0 102

R1(config-if)#frame-relay route 104 interface  serial 0/2 401

R1(config-if)#no shutdown

R1(config)#int s0/2

R1(config-if)#encapsulation frame-relay

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

R1(config-if)#clock rate 64000

R1(config-if)#frame-relay route 301 interface serial 0/0 103

R1(config-if)#frame-relay route 401 interface  serial 0/1 104

R1(config-if)#no shutdown

 

R3:

R3(config)#ipv6 unicast-routing

R3(config)#ipv6 router ospf 1

R3(config-rtr)#router-id 1.1.1.5

R3(config-rtr)#int s0/0

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

R3(config-if)#ipv6  enable

R3(config-if)#ipv6 address 2001:db8:99:1::1/64

R3(config-if)#encapsulation frame-relay

R3(config-if)#frame-relay map ipv6 2001:db8:99:1::2 102 broadcast

R3(config-if)#frame-relay map ipv6 2001:db8:99:1::3 103 broadcast

R3(config-if)#frame-relay map ipv6 FE80::C604:7FF:FE83:0 102 broadcast

R3(config-if)#frame-relay map ipv6 FE80::C602:7FF:FE65:0 103 broadcast

R3(config-if)#no shutdown

 

R4:

R4(config)#ipv6 unicast-routing

R4(config)#ipv6 router ospf 1

R4(config-rtr)#router-id 1.1.1.6

R4(config-rtr)#int s0/0

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

R4(config-if)#ipv6  enable

R4(config-if)#ipv6 address 2001:db8:99:1::2/64

R4(config-if)#encapsulation frame-relay

R4(config-if)#frame-relay map ipv6 2001:db8:99:1::1 201 broadcast

R4(config-if)#frame-relay map ipv6 2001:db8:99:1::3 104 broadcast

R4(config-if)#frame-relay map ipv6 FE80::C603:7FF:FE74:0 201 broadcast

R4(config-if)#frame-relay map ipv6 FE80::C602:7FF:FE65:0 104 broadcast

R4(config-if)#no shutdown

 

R2:

R2(config)#ipv6 unicast-routing

R2(config)#ipv6 router ospf 1

R2(config-rtr)#router-id 1.1.1.1

R2(config)#int serial 0/0

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

R2(config-if)#ipv6  enable

R2(config-if)#ipv6 address 2001:db8:99:4::3/64

R2(config-if)#encapsulation frame-relay

R2(config-if)#frame-relay map ipv6 2001:db8:99:1::1 301 broadcast

R2(config-if)#frame-relay map ipv6 2001:db8:99:1::2 401 broadcast

R2(config-if)#frame-relay map ipv6 FE80::C603:7FF:FE74:0 301 broadcast

R2(config-if)#frame-relay map ipv6 FE80::C604:7FF:FE83:0 401 broadcast

R2(config-if)#ipv6 ospf neighbor FE80::C603:7FF:FE74:0 priority 0

R2(config-if)#ipv6 ospf neighbor FE80::C604:7FF:FE83:0 priority 0

R2(config-if)#no shutdown

幀中繼網絡部分配置完成,R3 pingR2,R4測試結果如下:

 

 

 

配置R2,R6,R7的ospfv3,為area0。

R2:

R2(config)#int fastEthernet 0/0

R2(config-if)#ipv6 enable

R2(config-if)#ipv6 address 2001:db8:99:2::1/64

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

R2(config-if)#no shutdown

 

R6:

R6(config)#ipv6 unicast-routing

R6(config)#ipv6 router ospf 1

R6(config-rtr)#router-id 1.1.1.2

R6(config-rtr)#exit

R6(config)#int fastEthernet 0/0

R6(config-if)#ipv6 enable

R6(config-if)#ipv6 address 2001:db8:99:2::2/64

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

R6(config-if)#no shutdown

 

R7:

R7(config)#ipv6 unicast-routing

R7(config)#ipv6 router ospf 1

R7(config-rtr)#router-id 1.1.1.3

R7(config-rtr)#exit

R7(config)#int fastEthernet 0/0

R7(config-if)#ipv6 enable

R7(config-if)#ipv6 address 2001:db8:99:2::3/64

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

R7(config-if)#no shutdown

 

然后查看R7在area0的ospf的鄰居關系

R7#show ipv6 ospf neighbor

 

 

 

配置R6 F0/1,R7 F0/1,R8 F0/0 F0/1ospf area1為nssa 區域

R6:

R6(config)#ipv6 router ospf 1

R6(config-rtr)#area 1 nssa

R6(config-rtr)#int f0/1

R6(config-if)#ipv6 enable

R6(config-if)#ipv6 address 2001:db8:99:3::1/64

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

R6(config-if)#no shutdown

 

R7:

R7(config)#ipv6 router ospf 1

R7(config-rtr)#area 1 nssa

R7(config-rtr)#int f0/1

R7(config-if)#ipv6 enable

R7(config-if)#ipv6 address 2001:db8:99:4::1/64

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

R7(config-if)#no shutdown

 

R8:

R8(config)#ipv6 unicast-routing

R8(config)#ipv6 router ospf 1

R8(config-rtr)#router-id 1.1.1.4

R8(config-rtr)#area 1 nssa

R8(config-rtr)#int f0/0

R8(config-if)#ipv6 enable

R8(config-if)#ipv6 address 2001:db8:99:3::2/64

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

R8(config-if)#no shutdown

R8(config-rtr)#int f0/1

R8(config-if)#ipv6 enable

R8(config-if)#ipv6 address 2001:db8:99:4::2/64

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

R8(config-if)#no shutdown

查看R8 ospfv3路由表

 

 

 

到此ipv6 ospfv3部分配置完成,測試R4 ping R8成功

 

 

 

配置R5到R8 RIPng部分並且重分布到ospfv3

R5:

R5(config)#ipv6 unicast-routing

R5(config)#ipv6 router rip 1

R5(config)#int fastEthernet 0/0

R5(config-if)#ipv6 enable

R5(config-if)#ipv6 address 2001:Db8:99:5::1/64

R5(config-if)#ipv6 rip 1 enable

R5(config-if)#no shutdown

 

R8:

R8(config)#ipv6 router rip 1

R8(config)#int fastEthernet 1/0

R8(config-if)#ipv6 enable

R8(config-if)#ipv6 address 2001:Db8:99:5::2/64

R8(config-if)#ipv6 rip 1 enable

R8(config-if)#no shutdown

R8(config-if)#exit

R8(config)#ipv6 router ospf 1

R8(config-rtr)#redistribute rip 1

R8(config-rtr)#redistribute connected

R8(config-rtr)#exit

R8(config)#ipv6 router rip 1

R8(config-rtr)#redistribute ospf 1

R8(config-rtr)#redistribute connected

查看R5路由表,可獲取area1,無法獲取area 0和area2,可ping通R8

Ipv6的部分也做了一晚上,需要配置的地方很多很復雜,一個不小心就會配置出錯,不是打錯地址就是漏打什么,十分的考驗耐心。配置已經到了最后的階段,僅剩的幾行代碼,最后的實驗結果就要出來了,可是正好十一點到了,電腦斷網導致Vmware橋接模式的GNS3虛擬機IP失效了,GNS3也找不到服務器IP崩潰,我沉默了很久,放棄了再一次的配置。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM