OSPF综合实验

拓扑图如下:

 

 

 

地址表如下:

Device

Interface

IP Address

R1

F 0/0

10.1.92.6

F 0/1

12.1.92.5

R2

F 0/0

10.1.92.5

S 1/0

11.1.92.6

R3

F 0/0

10.1.92.1

S 1/0

192.168.92.1

R5

S 1/0

192.168.92.3

R6

S 1/0

192.168.92.4

R7

F 0/0

192.168.92.7

F 0/1

12.1.92.8

S 1/0

11.1.92.8

R8

F 0/0

192.168.92.8

 

 

 

 

 

配置过程

首先配置帧中继交换机

把R4当成帧中继交换机

步骤1:开启帧中继交换功能

R4(config)#frame-relay switching

步骤2:配置接口封装

给端口1/0,1/1,1/2用相同方法进行配置,以1/0为例

R4(config)#int s 1/0

R4(config-if)#no shutdown

R4(config-if)#clock rate 128000   

R4(config-if)#encapsulation frame-relay

步骤3:配置LMI类型

给端口1/0,1/1,1/2用相同方法进行配置,以1/0为例

R4(config)#int s 1/0

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

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

步骤4:配置帧中继交换表

R4(config)#int s 1/2

R4(config-if)#frame-relay route 103 interface s 1/0 301

R4(config-if)#frame-relay route 104 interface s 1/1 401

 

R4(config)#int Serial 1/0

R4(config-if)#frame-relay route 301 interface Serial1/2 103

 

R4(config)#int Serial 1/1

R4(config-if)#frame-relay route 401 interface Serial1/2 104

R4#show frame-relay route

如图

 

 

 

配置R3,R5,R6,使他们能够互通

R3(config)#int s 1/0

R3(config-if)#ip address 192.168.92.1 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#encapsulation frame-relay

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

R3(config-if)#no frame-relay inverse-arp   

R3(config-if)#frame-relay map ip 192.168.92.3 103 broadcast

R3(config-if)#frame-relay map ip 192.168.92.4 104 broadcast

 

R5(config)#int s 1/0

R5(config-if)#ip address 192.168.92.3 255.255.255.0

R5(config-if)#no shutdown

R5(config-if)#encapsulation frame-relay

R5(config-if)#no frame-relay inverse-arp

R5(config-if)#frame-relay map ip 192.168.92.1 301 broadcast

 

R6(config)#int s 1/0

R6(config-if)#ip address 192.168.92.4 255.255.255.0

R6(config-if)#no shutdown

R6(config-if)#encapsulation frame-relay

R6(config-if)#no frame-relay inverse-arp

R6(config-if)#frame-relay map ip 192.168.92.1 401 broadcast

从R3pingR5

 

Ping通

 

R3#show frame-relay pvc

 

可看出 有两条本地连接

 

步骤6:开始配置ospf

配置外部路由器ospf

R1与R3,R2和R7采用相同方法配置,以R1和R3为例子

R1(config)#router ospf 1

R1(config-router)#router-id 6.6.6.6

R1(config-router)#area 1 nssa

R1(config)#interface loopback 0

R1(config-if)#ip add 6.6.6.6 255.255.255.255

R1(config)#int f 0/0

R1(config-if)#ip add 10.1.92.6 255.255.255.0

R1(config-if)#no shut

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

R1(config-if)#int f 0/1

R1(config-if)#ip add 12.1.92.5 255.255.255.0

R1(config-if)#no shut

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

R1(config-if)#ex

R1(config)#router ospf 1

R1(config-router)#network 6.6.6.6 0.0.0.0 area 0

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

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

  

R3(config)#router ospf 1

R3(config-router)#router-id 1.1.1.1

R3(config)#interface loopback 0

R3(config-if)#ip add 1.1.1.1 255.255.255.255

R3(config)#int f 0/0

R3(config-if)#ip add 10.1.92.1 255.255.255.0

R3(config-if)#no shut

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

R3(config-if)#int s 1/0

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

R3(config-if)#ex

R3(config)#router ospf 1

R3(config-router)#network 1.1.1.1 0.0.0.0 area 0

R3(config-router)#network 10.1.92.0 0.0.0.255 area 0

R3(config-router)#network 192.168.92.0 0.0.0.255 area 0

R3(config-router)#neighbor 192.168.92.3

R3(config-router)#neighbor 192.168.92.4

 

 

 

步骤7:配置帧中继中路由器的ospf

R5和R6采用同样方法配置,以R5为例子

R5(config)#router ospf 1

R5(config-router)#router-id 3.3.3.3

R5(config-router)#ex

R5(config)#int loopback 0

R5(config-if)#ip add 3.3.3.3 255.255.255.255

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

R5(config-if)#int s 1/0

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

R5(config-if)# ip ospf priority 0

R5(config)#router ospf 1

R5(config-router)#network 3.3.3.3 0.0.0.0 area 2

R5(config-router)#network 192.168.92.0 0.0.0.255 area 2

 

R3#show ipv6 ospf neighbor

 

邻居关系如上图

 

 

 

 

 

 

 

在R3上ping其他区域

 

从内部到外部都ping通,实验成功。

 

Ipv6拓扑图如下:

 

 

Ipv6地址表

Device

Interface

IP Address

R1

F 0/0

2123:092::1/64

F 0/1

2019:092::1/64

Loopback 0

2011:092::1/128

Loopback 1

2111:092::1/128

R2

F 0/0

2123:092::2/64

S 1/0

2048:092::2/64

Loopback 0

2022:092::1/128

R3

F 0/0

2123:092::3/64

S 1/0

2356:092::3/64

Loopback 0

2033:092::1/128

R5

S 1/0

2356:092::5/64

Loopback 0

2055:092::1/128

R6

S 1/0

2356:092::6/64

Loopback 0

2066:092::1/128

R7

F 0/0

2027:092::7/64

F 0/1

2019:092::7/64

S 1/0

2048:092::7/64

Loopback 0

2077:092::1/128

R8

F 0/0

2027:092::8/64

Loopback 0

2088:092::1/128

 

开始配置帧中继交换机

R3(config)#ipv6 unicast-routing

R3(config)#interface loopback 0

R3(config-if)#ipv6 enable

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

R3(config-if)#int f 0/0

R3(config-if)#ipv6 enable

R3(config-if)# ipv6 address 2123:092::3/64

R3(config-if)#no shut

R3(config-if)#int s 1/0

R3(config-if)#ipv6 enable

R3(config-if)# encapsulation frame-relay

R3(config-if)#no shut

R3(config)#interface serial 1/0.1 multipoint

R3(config-subif)#ipv6 address 2356:092::3/64

R3(config-subif)#frame-relay map ipv6 2356::92:3 103 broadcast 

R3(config-subif)#frame-relay map ipv6 2356::92:4 104 broadcast

R3(config-subif)#frame-relay map ipv6 2356::92:1 104 broadcast

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

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

 

 

R5(config)#ipv6 unicast-routing

R5(config)#interface loopback 0

R5(config-if)#ipv6 address 2055:092::1/128

R5(config-if)#int s 1/0

R5(config-if)#ipv6 enable

R5(config-if)# encapsulation frame-relay

R5(config-if)#no shutdown

R5(config)#interface serial 1/0.1 multipoint

R5(config-subif)#ipv6 address 2356:092::5/64

R5(config-subif)#frame-relay map ipv6 2356::92:1 301 broadcast 

R5(config-subif)#frame-relay map ipv6 2356::92:4 301 broadcast

R5(config-subif)#frame-relay map ipv6 2356::92:3 301 broadcast

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

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

 

R6(config)#ipv6 unicast-routing

R6(config)#interface loopback 0

R6(config-if)#ipv6 address 2066:092::1/128

R6(config-if)#int s 1/0

R6(config-if)#ipv6 enable

R6(config-if)# encapsulation frame-relay

R6(config-if)#no shutdown

R6(config)#interface serial 1/0.1 multipoint

R6(config-subif)#ipv6 address 2356:092::6/64

R6(config-subif)#frame-relay map ipv6 2356::92:1 401 broadcast 

R6(config-subif)#frame-relay map ipv6 2356::92:4 401 broadcast

R6(config-subif)#frame-relay map ipv6 2356::92:3 401 broadcast

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

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

 

R3pingR5通

 

 

R3#Show frame-relay pvc

 

 配置ospfv3

R1,R2,R3,R5,R6,R7采用同样的方法配置ospf,以R1为例

R1(config)#ipv6 unicast-routing

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

R1(config-rtr)#router-id 6.6.6.6

R1(config-rtr)#area 1 nssa――配置区域 1 为 NSSA 区域

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:092::1/128

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

R1(config-if)#int f 0/1

R1(config-if)#ipv6 enable

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

R1(config-if)#no shutdown

 

3.检查 OSPFv3 的邻居关系

R3#show ipv6 ospf neighbor

 

 

用R3ping其他路由器

 

达到互通,实验成功

 

路由汇总

采用相同的方法配置R1,R2,R3,R5,R6,R7,以R1为例子

R1(config)#int f0/0

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

R1(config)#int f0/1

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

 

外部路由汇总

采用相同的方法配置R1,R2,R3,R5,R6,R7,以R1为例子

R1(config)#ipv6 router ospf 1

R1(config-rtr)#summary-prefix 2111:092::0/64

区域间路由汇总

采用相同的方法配置R1,R2,R3,R5,R6,R7,以R3为例子

R3(config)#ipv6 router ospf 1

R3(config-rtr)#area 0range 2011:092::0/64

 

RIP的配置

R8(config)#ipv6 router rip yeslab

R8(config)#int f0/0

R8(config-if)#ipv6 rip yeslab enable

R8(config)#int loopback 0

R8(config-if)#ipv6 rip yeslab enable

 

R7(config)#ipv6 router ospf 1

R7(config)#int f0/0

R7(config-if)#ipv6 rip yeslab enable

R7(config-rtr)#redistribute rip yeslab metric 1

R7(config)#ipv6 router rip yeslab

R7(config-rtr)#redistribute ospf 1 metric 8

R7(config-rtr)#redistribute connected

 

路由注入

R7(config-router)#area 1 nssa default-information-originate

 

总结

通过这次的作业,我学会了帧中继的配置,ospfv3与ospf 的配置,路由汇总和路由注入。在配置的过程中也遇到了问题,比如路由汇总和路由注入失败,还有rip配置的失败,没有很好地完成任务,以后仍要继续努力,刻苦学习知识,提高自己的实践水平,争取在下次的实验和作业中完成所有要求。

posted @ 2019-05-21 16:50  gaoqianhao  阅读(384)  评论(0编辑  收藏  举报