第四组-16通信2班-056 OSPF、OSPFv3协议

基于GNS3的OSPF、OSPFv3协议

一、OSPF的配置

1、拓扑图如下:

2地址规划(本人学号后三位056

路由器

接口地址

子网掩码

Loopback 0

R1

F0/0 10.56.20.1    F0/1 10.56.20.1

/24

1.1.1.1

R2

F0/0 10.56.20.2    S1/3 10.56.50.2

/24

2.2.2.2

R3

F0/0 10.56.20.3    S1/2 10.56.10.3

/24

3.3.3.3

R5

S1/1 10.56.10.5

/24

5.5.5.5

R6

S1/0 10.56.10.6

/24

6.6.6.6

R7

F0/1 10.56.30.17   F0/0 10.56.40.7

S1/3 10.56.50.7

/24

7.7.7.7

R8

F0/0 10.56.40.8

/24

8.8.8.8

3OSPF帧中继环境下的配置

FR 配置

FR(config)#frame-relay switching  //把该路由器当成帧中继交换机

FR接口封装

FR(config)#int s1/2

FR(config-if)#no shutdown       

FR(config-if)#clock rate 128000    //该接口为DCE,要配置时钟

 

FR(config-if)#encapsulation frame-relay  //配置接口封装成帧中继

FR(config)#int s1/1

FR(config-if)#no shutdown

FR(config-if)#clock rate 128000

FR(config-if)#encapsulation frame-relay

FR(config)#int s1/0

FR(config-if)#no shutdown

FR(config-if)#clock rate 128000

FR(config-if)#encapsulation frame-relay

配置LMI类型

FR(config)#int s1/2

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

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

FR(config)#int s1/1

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

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

FR(config)#int s1/0

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

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

配置帧中继交换表

FR(config)#int s1/2

FR(config-if)#frame-relay route 103 interface s1/1 301

FR(config-if)#frame-relay route 104 interface s1/0 401

FR(config)#int s1/1

FR(config-if)#frame-relay route 301 int s1/2 103

FR(config)#int s1/0

FR(config-if)#frame-relay route 401 int s1/2 104

FR(config-if)#frame-relay route 403 int s1/1 304

FR(config-if)#frame-relay route 304 int s1/0 403

 

 

配置动态映射

R3(config)#int s1/2

R3(config-if)#ip address 10.56.10.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#encapsulation frame-relay

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

 

R5(config)#int s1/1

R5(config-if)#ip address 10.56.10.5 255.255.255.0

R5(config-if)#no shutdown

R5(config-if)#encapsulation frame-relay

 

R6(config)#int s1/0

R6(config-if)#ip address 10.56.10.6 255.255.255.0

R6(config-if)#no shutdown

R6(config-if)#encapsulation frame-relay

4、检验帧中继表

FR#show frame-relay route

Input Intf      Input Dlci      Output Intf     Output Dlci     Status

Serial1/0       401             Serial1/2       104             inactive

Serial1/1       301             Serial1/2       103             inactive

Serial1/2       103             Serial1/1       301             inactive

Serial1/2       104             Serial1/0       401             inactive

5、检查帧中继是否完成

R3#ping 10.56.10.5

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.56.10.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/59/172 ms

 

R3#ping 10.56.10.6

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.56.10.6, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 12/23/44 ms

 

R6#ping 10.56.10.5

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.56.10.5, timeout is 2 seconds:

!!!!!

说明帧中继已互通

6、配置ospf

接口配置以R2为例

 

R2(config)#int f0/0

R2(config-if)#ip address 10.56.20.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#int s1/3

R2(config-if)#ip address 10.56.30.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#int loopback 0

R2(config-if)#ip address 2.2.2.2 255.255.255.0

R2(config-if)#exit

R2(config)#int loopback 0

R2(config-if)#ip address 2.2.2.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

 

R2(config)#router ospf 1

R2(config-router)#router-id 2.2.2.2

R2(config-router)#network 10.56.50.0 0.0.0.255 area 1

R2(config-router)#network 10.56.20.0 0.0.0.255 area 0

R2(config-router)#network 2.2.2.2 0.0.0.255 area 0

R2(config-router)# area 1 nssa (宣告区域1nssa区域)

7NSSA区域的配置

R7(config)#router ospf 1

R7(config-router)#router-id 7.7.7.7

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

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

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

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

R7(config-router)# area 1 nssa

 

8、路由注入

R8(config)#ip route 10.56.50.0 255.255.255.0 10.56.40.7

R8(config)#ip route 10.56.30.0 255.255.255.0 10.56.40.7

 

路由汇总(检查R2路由表以及邻居)

9、检查ospf是否做通

Ospf成功

 

一、OSPFV3的配置

 

1、拓扑图:

2、帧中继配置(以R3为例)

 

 

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

R3(config)#int loopback 0(设置环回接口)

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

配置接口ipv6地址

R3(config)#int fastEthernet 0/0

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

R3(config-if)#no shutdown

R3(config-if)#ipv6 enable

R3(config-if)#ipv6 address fe80::cbfe:3 link-local

R3(config-if)#no shutdown

R3(config-if)#ipv6 enable

R3(config)#int s1/2

R3(config-if)#encapsulation frame-relay

R3(config-if)#no shutdown

3、帧中继的接口配置

R3(config)#int s1/2.1 multipoint

R3(config-subif)#ipv6 address 2356::56:3/64   //配置FR的子接口

R3(config-subif)#ipv6 address fe80::cafe:3 link-local  //配置本地链路地址

R3(config-subif)#no shutdown

R3(config-subif)#ipv6 enable

4、配置ipv6的帧中继映射:

R3(config-subif)#frame-relay map ipv6 2356::56:5 305 broadcast

R3(config-subif)#frame-relay map ipv6 2356::56:6 306 broadcast

R3(config-subif)#frame-relay map ipv6 2356::56:3 306 broadcast

R3(config-subif)#frame-relay map ipv6 fe80::cafe:6 306 broadcast

R3(config-subif)#frame-relay map ipv6 fe80::cafe:5 305 broadcast

5R4(即FR)的帧中继配置,参考前面ospfv2的配置

R4(config)#frame-relay switching  

R4(config)#int s1/2

R4(config-if)#no shutdown

R4(config-if)#ipv6 enable

R4(config-if)#clock rate 128000

R4(config-if)#encapsulation frame-relay

R4(config)#int s1/1

R4(config-if)#no shutdown

R4(config-if)#ipv6 enable

R4(config-if)#clock rate 128000

R4(config-if)#encapsulation frame-relay

R4(config)#int s1/0

R4(config-if)#no shutdown

R4(config-if)#ipv6 enable

R4(config-if)#clock rate 128000

R4(config-if)#encapsulation frame-relay

R4(config)#int s1/2

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

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

R4(config)#int s1/0

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

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

R4(config-if)#exit

R4(config)#int s1/1

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

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

 

 

 

 

 

6、配置帧中继地址表

R4(config)#int s1/2

R4(config-if)#frame-relay route 305 int s1/0 503

R4(config-if)#frame-relay route 306 int s1/1 603

R4(config)#int s1/1

R4(config-if)#frame-relay route 503 rou

R4(config-if)#frame-relay route 503 int s1/2 305

R4(config-if)#frame-relay route 506 int s1/1 605

R4(config-if)#frame-relay route 603 int s1/2 306

R4(config-if)#frame-relay route 605 int s1/0 506

R4(config)#int s1/0

R4(config-if)#frame-relay route 503 int s1/2 305

R4(config-if)#frame-relay route 506 int s1/1 605

 

7OspfV3配置(以R2 R3 R7

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

R2(config-rtr)#router-id 2.2.2.2    // 在路由器没有 IPv4 地址情况下,要求手动配置 Router-ID,如果有 IPv4地址,将按照优选 loopback接口的 IP地址做为 router-ID,如果没有 loopback 接口,选择 IP地址大的接口的 IP 为 Router-ID

 

R2(config-rtr)#area 1 nssa    //配置区域 1 为 NSSA 区域

 

R2(config)#int f0/0

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

R2(config)#int loopback 0

R2(config-if)#ipv6 ospf 1 area 0     //把 F0/0 接口宣告到 OSPFv3 进程 1,区域 ID为 0

R2(config)#int s1/3

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

 

R7配置

R7(config)#ipv6 router ospf 1

R7(config-rtr)#router-id 7.7.7.7

R7(config-rtr)#area 1 nssa

R7(config)#int f0/0

R7(config-if)#ipv6 ospf 1

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

R7(config)#int s1/3

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

R7(config)#int loopback 0

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

 

 

 

 

R3配置:

R3(config)#ipv6 router ospf 1

R3(config-rtr)#router-id 3.3.3.3

R3(config)#int f0/0

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

R3(config)#int loopback 0

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

R3(config)#int s1/2.1    //缺省的帧中继多点子接口在 OSPFv3 网络类型为 NBMA

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

 

R3(config)#int s1/2.1

R3(config-subif)#ipv6 ospf neighbor fe80::cafe:6   //在接口下手动指邻居 R6,使用邻居 的 link-local 地址

R3(config-subif)#ipv6 ospf neighbor fe80::cafe:5

 

路由注入

R7(config)#ipv6  route  ::/0  serial1/3

 

路由汇总(检查地址表)

检查是否做通ospfv3

R3pingR7

说明ospf做通

 

一、总结

本次作业二对于ospfospfV3协议有了长足性的应用,使我对于ospf区域性的协议有了更加深刻的了解,也对与ipv6地址的ospf应用有了更好的了解。在配置ospfV3的过程中,有些指令相对于ipv4有很大不同,需要注意。

posted @ 2019-05-26 23:18  想吃饭想喝汤  阅读(270)  评论(4编辑  收藏  举报