ospf v3 实验

目录

1、地址规划表... 3

2、实验拓扑... 5

3、实验配置(该实验我是先做通了IPV4后在此基础上完成的IPV6)... 5

5、实验总结... 15

1、地址规划表

IPV6地址规划

路由器

接口

IPV6地址

R1

F0/0

2001:db8:120::1/64

 

F1/0

2017:db8:120:10::1/64

R2

F0/0

2001:db8:120::2/64

 

S2/0

2027:db8:120:10::2/64

R3

F0/0

2001:db8:120::3/64

 

S2/2

2001:db8:120:20::3/64

R5

S2/0

2001:db8:120:20::5/64

R6

S2/1

2001:db8:120:20::6/64

R7

S2/0

2027:db8:120:10::7/64

 

F1/0

2017:db8:120:10::7/64

 

F0/0

2078:db8:120::7/64

R8

F0/0

2078:db8:120::8/64

IPV6环回地址规划

路由器

环回地址

R1

2001:café:120:10::1/64

 

2011:café:120:10::1/64

R2

2001:café:120:20::2/64

R3

2001:café:120:30::3/64

R5

2001:café:120:30::5/64

R6

2001:café:120:30::6/64

R7

2001:café:120:70::7/64

R8

2001:café:120:80::8/64

IPV4地址规划

路由器

接口

IPV4地址

R1

F0/0

192.120.2.1/24

 

F1/0

192.120.6.1/24

R2

F0/0

192.120.2.2/24

 

S2/0

192.120.7.2/24

R3

F0/0

192.120.2.3/24

 

S2/2.1 multipoint

192.120.1.3/24

R5

S2/0.1 multipoint

192.120.1.5/24

R6

S2/1.1 multipoint

192.120.1.6/24

R7

S2/0

192.120.7.7/24

 

F1/0

192.120.6.7/24

 

F0/0

192.120.8.7/24

R8

F0/0

192.120.8.8/24

IPV4环回地址规划

路由器

环回地址/24

R1

120.1.1.1

R2

120.2.2.2

R3

120.3.3.3

R5

120.5.5.5

R6

120.6.6.6

R7

120.7.7.7

R8

120.8.8.8

2、实验拓扑

 

3、实验配置(该实验我是先做通了IPV4后在此基础上完成的IPV6)

1)帧中继配置

①IPV4

以R5为例配置R6,R3

r5(config)#interface Loopback0

r5(config-if)#ip address 120.1.1.1 255.255.255.0

r5(config-if)#ip ospf network point-to-point            使路由正常。

r5(config-if)#exit

r5(config)#interface Serial2/0

r5(config-if)#ip address 192.120.1.5 255.255.255.0

r5(config-if)#encapsulation frame-relay                封装成帧中继。

r5(config-if)#ip ospf network non-broadcast            配置成NBMA的网络。

r5(config-if)#ip ospf priority 255                    使R1成为DR。接口悠闲级。

r5(config-if)#frame-relay map ip 192.120.1.3 503 broadcast   用广播方式发送帧中继信息。静态映射。(注意:对方IP和己方DLCI)

r5(config-if)#frame-relay map ip 192.120.1.6 506 broadcast

r5(config-if)#no frame-relay inverse-arp                 关闭自动映射。

r5(config-if)#exit

r5(config)#router ospf 1

r5(config-router)#log-adjacency-changes

r5(config-router)#network 120.1.1.0 0.0.0.255 area 0

r5(config-router)#network 192.120.1.0 0.0.0.255 area 0

r5(config-router)#neighbor 192.120.1.3 priority 3         在NBMA的网络中,只能使用neighbor来指明邻居还可以指明邻居的优先级。

r5(config-router)#neighbor 192.120.1.6

配置R4为帧中继交换机

r4(config)#frame-relay switching              配置成帧中继交换机。此命令很重要。

r4(config-if)#interface Serial 2/0

r4(config-if)#no ip address

r4(config-if)#encapsulation frame-relay              封装成帧中继

r4(config-if)#frame-relay lmi-type cisco              配置帧中继的类型

r4(config-if)#frame-relay intf-type dce                配置帧中继为DCE

r4(config-if)#frame-relay route 503 interface Serial2/2 305    做帧中继映射

r4(config-if)#frame-relay route 506 interface Serial2/1 605

r4(config-if)#exit

r4(config)#interface Serial2/1

r4(config-if)#no ip address

r4(config-if)#encapsulation frame-relay

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

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

r4(config-if)#frame-relay route 603 interface Serial2/0 306

r4(config-if)#frame-relay route 605 interface Serial2/2 506

r4(config-if)#exit

r4(config)#interface Serial2/2

r4(config-if)#no ip address

r4(config-if)#encapsulation frame-relay

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

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

r4(config-if)#frame-relay route 305 interface Serial2/0 503

r4(config-if)#frame-relay route 306 interface Serial2/1 603

②IPV6

以R5为例配置R6

r5(config)#ipv6 nicast-routing

r5(config)#interface loopback 0

r5(config-if)#ipv6 address  2001:café:120:30::5/64

r5(config-if)#exit

r5(config)#interface serial 2/0

r5(config-if)#encapsulation  frame-relay

r5(config-if)#no shutdown

r5(config-if)#exit

r5(config)#interface serial 2/0.1 multipoint

r5(config-subif)#ipv6 address 2001:db8:120:20::5/64

r5(config-subif)#frame-relay map ipv6 2001:db8:120:20::3/64 503 broadcast

r5(config-subif)#frame-relay map ipv6 2001:db8:120:20::5/64 503 broadcast    

此映射是为了 ping 通本接口

r5(config-subif)#frame-relay map ipv6 2001:db8:120:20::6/64 503 broadcast   

 此映射必须

r5(config-subif)#  frame-relay  map  ipv6  FE80::C806:1BFF:FE9C:0  513  broadcast

此处配置映射 R6  的link-local 地址

r5(config-subif)#  frame-relay  map  ipv6  FE80::C803:3CFF:FED4:0  513  broadcast

此处配置映射 R3  的link-local 地址

r5(config)#ipv6 router ospf 1

r5(config-rtr)#exit

r5(config)#interface loopback 0

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

r5(config-if)#exit

r5(config)#interface serial 2/2.1

r5(config-subif)#ipv6 ospf 1 area 2

r5(config-subif)#ipv6 ospf priority 0     设置R5的优先级设置为 0,不让其参与 DR、BRD的选举

R3的配置

r3(config)#ipv6 unicast-routing            全局打开 IPv6 路由功能

r3(config)#interface loopback 0

r3(config-if)#ipv6 address 2001:café:120:30::3/64      配置 loopback0 接口地址

r3(config-if)#exit

r3(config)#interface fastEthernet 0/0

r3(config-if)#ipv6 address 2001:db8:120::1/64      配置 F0/0 接口地址

r3(config-if)#no shutdown

r3(config-if)#exit

r3(config)#interface serial 2/2

r3(config-if)#encapsulation frame-relay

r3(config-if)#no shutdown

r3(config-if)#exit

r3(config)#interface serial 2/2.1 multipoint

r3(config-subif)#ipv6 address 2001:db8:120:20::3/64    配置 FR 子接口地址

r3(config-subif)#frame-relay map ipv6 2001:db8:120:20::5 305 broadcast    

配置 IPv6 的静态帧中继映射

r3(config-subif)#frame-relay map ipv6 2001:db8:120:20::6 306 broadcast

r3(config-subif)#frame-relay map ipv6 2001:db8:120:20::3 306 broadcast

r3(config-subif)#frame-relay map ipv6 FE80::C806:1BFF:FE9C:0 306 broadcas

对帧中继邻居的 link-local 地址的映射不能忘记,因为 OSPFv3 的路由用的是 link-local 地址来交换 LSA。此处配置映射 R6 的 link-local 地址

r3(config-subif)#frame-relay map ipv6 FE80::C805:5FF:FE34:0 305 broadcast     

此处配置映射

r3(config)#interface serial 2/2.1

r3(config-subif)#ipv6 ospf neighbor FE80::C806:1BFF:FE9C:0     在接口下手动指邻居 R6,使用邻居的link-local 地址

r3(config-subif)#ipv6 ospf neighbor FE80::C805:5FF:FE34:0     在接口下手动指邻居 R5,使用邻居的link-local 地址

R4帧中继路由器的配置                  

r4(config)#interface Serial 2/0

r4(config-if)#frame-relay route 513 interface Serial2/2 315    做帧中继映射

r4(config-if)#frame-relay route 516 interface Serial2/1 615

r4(config)#exit

r4(config-if)#interface Serial2/1

r4(config-if)#frame-relay route 613 interface Serial2/0 316

r4(config-if)#frame-relay route 615 interface Serial2/2 516

r4(config-if)#exit

r4(config)interface Serial2/2

r4(config-if)frame-relay route 315 interface Serial2/0 513

r4(config-if)frame-relay route 316 interface Serial2/1 613

r4(config-if)exit

2)ospf的配置

①IPV4

以配置R3为例将R2、R1、R7各端口加入不同区域中

r3(config)#router ospf 1

(r3(config-router)#area 1 nssa)     配置区域 1 为 NSSA 区域(注:只将area 1 配置为nssa区域,即只有R1、R2、R7需要此命令)

r3(config-router)#interface loopback 0

r3(config-router)#ip address 120.3.3.3 255.255.255.0

r3(config-router)#network 192.120.2.0 255.255.255.0 area 2

r3(config-router)#network 192.120.1.0 255.255.255.0 area 0

r3(config-router)#network 120.3.3.0 255.255.255.0 area 0

r3(config-router)#exit

②IPV6

以配置R3为例将R2、R1、R7各端口加入不同区域中

r3(config)#ipv6 router ospf 1      启动 OSPFv3 进程

(r3(config-router)#area 1 nssa)       配置区域 1 为 NSSA 区域(注:只将area 1 配置为nssa区域,即只有R1、R2、R7需要此命令)

r3(config-router)#exit

r3(config)#interface fastEthernet 0/0

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

把 F0/0 接口宣告到 OSPFv3 进程 1,区域 ID 为 0

r3(config-if)#exit

r3(config)#interface loopback 0

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

r3(config-if) #exit

r3(config) #interface serial 2/2.1

r3(config-subif) #ipv6 ospf 1 area 2

r3(config-subif) #exit

3)RIP的路由注入

①IPV4

配置边界路由器R7

R7(config)#router ospf 1

R7(config-router)#network 120.7.7.0 0.0.0.255 area 1

R7(config-router)#network 192.120.6.0 0.0.0.255 area 1

R7(config-router)#network 192.120.7.0 0.0.0.255 area 1

R7(config-router)#redistribute rip subnets       将RIP路由重分布到OSPF区域

R7(config)#router rip

R7(config-router)#version 2

R7(config-router)#no auto-summary

R7(config-router)#network 192.168.8.0

R7(config-router)#redistribute ospf 1 metric 2

配置R8的rip

R8(config)#router rip

R8(config-router)#version 2

R8(config-router)#no auto-summary

R8(config-router)#network 120.0.0.0

R8(config-router)#network 192.120.8.0

②IPV6

在RI上新增换回地址,并重分布进入OSPFv3中

r1(config)#interface loopback 1

r1(config-if)#ipv6 address 2011:café:120:10::1/64

r1(config-if)#exit

r1(config)#ipv6 router ospf 1

r1(config-rtr)#redistribute connected

配置边界路由器R7

r7(config)#ipv6 router rip 2

r7(config-rtr)#redistribute ospf 1 metric 2

r7(config-rtr)#redistribute connected

r7(config-rtr)#exit

r7(config)#interface fastEthernet 0/0

r7(config-if)#ipv6 rip 2 enable

r7(config-if)#exit

r7(config)#ipv6 router ospf 1

r7(config-rtr)#redistribute rip 2           重分布 RIPng 到 OSPFv3

r7(config-rtr)#redistribute connected      由于重分布 RIPng,不能把连接 R8 的接口网段重分布进入OSPFv3,因此重分布直连,把连接 R8 的网段重分布到 OSPFv3

配置R8的RIP

r8(config)#ipv6 router rip 2

r8(config-rtr)#exit

r8(config)#interface fastEthernet 0/0

r8(config-if)#ipv6 rip 2 enable

r8(config-if)#exit

r8(config-if)#ipv6 rip 2 enable

4)路由汇总

①IPV4

配置R1(区域间路由汇总)

R1(config)#router ospf 1

R1(config-router)#network 192.120.2.0 255.255.255.0 area 0

R1(config-router)#network 192.120.6.0 255.255.255.0 area 1

R1(config-router)#network 120.1.1.0 255.255.255.0 area 0

R1(config-router)#area 0 range 120.0.0.0 255.0.0.0    配置区域间路由汇总

配置R7 (外部路由汇总)

R7(config-router)#summary-address 120.0.0.0 255.0.0.0    配置外部自治系统路由汇总

②IPV6

配置R3(区域间路由汇总)

r3(config)#ipv6 router ospf 1

r3(config-rtr)#area 0 range 2001:café:120:30::0/64

配置R1(外部路由汇总)

r1(config)#ipv6 router ospf 1

r1(config-rtr)#summary-prefix 2011:café:120:10::0/64

4、实验结果

1)IPV4

①连通性测试(R8 ping R5)

 

由最远端的R8 ping R5,连通。表示OSPF、RIP、帧中继配置正常

②R1的路由表(查看区域间路由)

 

 

 

 

③R7的路由表(查看外部路由汇总)

 

④R7的路由表(RIP配置)

 

 

⑤NSSA区域

 

2)IPV6

①联通性测试(R8 ping R5)

 

由最远端的R8 ping R5,连通。表示OSPF、RIP、帧中继配置正常

②R7的路由表(RIP配置)

 

③路由汇总

 

④NSSA区域

 

5、实验总结

在本次实验中,我收获到了许多。既复习了IPV4的ospfV2的相关配置以及知识,也学习到IPV6中的ospfV3的知识。通过一起做实验,也学习到它们之间的不同。如在IPV6中关于网络汇总后产生的路由可在所有路由器上查到。而IPV4只能在配置的路由器上查看。

在本次的实验中,我收获颇多。

猜你喜欢

转载自www.cnblogs.com/cool-cold/p/10770322.html
今日推荐