OSPFv3

1.实验目的

1)通过本实验可以掌握

2)启用IPv6流量转发

3)向OSPF网络注入默认路由

4OSPF多区域配置和调试

 

2 拓扑结构

 

实验拓扑如图21-3所示。

 

21-3 OSPFv3 配置

3.实验步骤

步骤1

配置路由器R1 

R1(config)#ipv6 unicast-routing

R1(config)#ipv6 router ospf 1  //启动OSPFv3路由进程

R1(config-rtr)#router-id 1.1.1.1 //定义路由器ID

R1(config-rtr)#default-information originate metric 30 metric-type 2 //OSPFv3网络注入一条默认路由

 

R1(config)#interface Serial0/0

R1(config-if)#ipv6 address 2007:16::1/64

R1(config-if)#ipv6 ospf 1 area 1   //在接口上启用OSPFv3,并声明接口所在区域

R1(config-if)#no shutdown

 

R1(config)#ipv6 route ::/0 s0/1    //配置默认路由

步骤2:配置路由器R6

R6(config)#ipv6 unicast-routing

R6(config)#ipv6 router ospf 1

R6(config-rtr)#router-id 6.6.6.6

 

R6(config)#interface Serial0/0

R6(config-if)#ipv6 address 2007:16::6/64

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

R6(config-if)#clock rate 64000

R6(config-if)#no shutdown

 

R6(config)#interface Serial0/1

R6(config-if)#ipv6 address 2007:26::6/64

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

R6(config-if)#clock rate 64000

R6(config-if)#no shutdown

步骤3:配置路由器R2

R2(config)#ipv6 unicast-routing

R2(config)#ipv6 router ospf 1

R2(config-rtr)#router-id 2.2.2.2

 

R2(config)#interface Serial0/0

R2(config-if)#ipv6 address 2007:23::2/64

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

R2(config-if)#clockrate 64000

R2(config-if)#no shutdown

 

R2(config)#interface Serial0/1

R2(config-if)#ipv6 address 2007:26::2/64

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

R2(config-if)#no shutdown

 

步骤4:配置路由器R3

R3(config)#ipv6 unicast-routing

 

R3(config)#ipv6 router ospf 1

R3(config-rtr)#router-id 3.3.3.3

 

R3(config)#interface loopback 0

R3(config-if)#ipv6 address 2008:3333::3/64

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

R3(config-if)#no shutdown

 

R3(config)#interface Serial0/0

R3(config-if)#ipv6 address 2007:23::3/64

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

R3(config-if)#no shutdown

 

4.实验调试

1show ipv6 route

 R3#show ipv6 route

IPv6 Routing Table - 11 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

U - Per-user Static route, M - MIPv6        I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary        O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external

 OE2  ::/0 [110/30], tag 1

     via FE80::C802:AFF:FE90:0, Serial0/0

OI  2007:16::/64 [110/192]

     via FE80::C802:AFF:FE90:0, Serial0/0

OI  2007:26::/64 [110/128]

     via FE80::C802:AFF:FE90:0, Serial0/0

C   2007:23::/64 [0/0]

     via ::, Serial0/0/0

L   2007:23::3/128 [0/0]

     via ::, Serial0/0/0

C   2008:3333::/64 [0/0]

     via ::, loopback 0

L   2008:3333::3/128 [0/0]

     via ::,loopback 0

L   FE80::/10 [0/0]

     via ::, Null0

L   FF00::/8 [0/0]

via ::, Null0

以上输出表明 OSPFv3 的外部路由代码为OE2OE1区域间路由代码为OI

区域内路由代码为O

2show ip protocols

R6#show ipv6 protocols 

IPv6 Routing Protocol is "connected"

IPv6 Routing Protocol is "static"

IPv6 Routing Protocol is "ospf 1"

  Interfaces (Area 0):

    Serial0/1

  Interfaces (Area 1):

    Serial0/0

  Redistribution:

    None

以上输出表明启动的 OSPFv3 进程 ID 1 Serial0/1 Serial0/0 接口上启用

OSPFv3Serial0/1 属于区域 0Serial0/0 属于区域 1

3show ipv6 ospf database

该命令用来查看 OSPFv3拓扑结构数据库。

R3#show ipv6 ospf database 

 

            OSPFv3 Router with ID (3.3.3.3) (Process ID 1)

 

                Router Link States (Area 2)

 

ADV Router      Age         Seq#        Fragment ID  Link count  Bits

2.2.2.2         418         0x80000002  0            1           B

3.3.3.3         375         0x80000004  0            1           None

 

                Inter Area Prefix Link States (Area 2)

 

ADV Router      Age         Seq#        Prefix

2.2.2.2         450         0x80000001  2007:26::/64

2.2.2.2         440         0x80000001  2007:16::/64

 

                Inter Area Router Link States (Area 2)

 

ADV Router      Age         Seq#        Link ID    Dest RtrID

2.2.2.2         440         0x80000001  16843009   1.1.1.1

 

                Link (Type-8) Link States (Area 2)

 

ADV Router      Age         Seq#        Link ID    Interface

3.3.3.3         415         0x80000001  3          Fa0/0

2.2.2.2         463         0x80000001  4          Se1/0

3.3.3.3         437         0x80000001  4          Se1/0

 

                Intra Area Prefix Link States (Area 2)

 

ADV Router      Age         Seq#        Link ID    Ref-lstype  Ref-LSID

2.2.2.2         463         0x80000001  0          0x2001      0

3.3.3.3         430         0x80000002  0          0x2001      0

 

                Type-5 AS External Link States

 

ADV Router      Age         Seq#        Prefix

1.1.1.1         6           0x80000013  ::/0

以上输出显示了路由器 R3 OSPFv3的拓扑结构数据库。

4show ipv6 ospf neighbor

R6#show ipv6 ospf neighbor 

 

Neighbor ID    Pri   State          Dead Time   Interface ID   Interface

2.2.2.2          1   FULL/  -       00:00:30    5              Serial0/1

1.1.1.1          1   FULL/  -       00:00:37    4              Serial0/0

以上输出表明路由器 R6有两个 OSPFv3 的邻居。

5show ipv6 ospf interface

R6#show ipv6 ospf interface s0/0

Serial0/0 is up, line protocol is up 

  Link Local Address FE80::C801:AFF:FE90:0, Interface ID 4

  Area 1, Process ID 1, Instance ID 0, Router ID 6.6.6.6

  Network Type POINT_TO_POINT, Cost: 64

  Transmit Delay is 1 sec, State POINT_TO_POINT,

  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

    Hello due in 00:00:04

  Index 1/1/1, flood queue length 0

  Next 0x0(0)/0x0(0)/0x0(0)

  Last flood scan length is 1, maximum is 1

  Last flood scan time is 0 msec, maximum is 0 msec

  Neighbor Count is 1, Adjacent neighbor count is 1 

    Adjacent with neighbor 1.1.1.1

  Suppress hello for 0 neighbor(s)

以上输出是 OSPFv3 路由器接口的基本信息,和 OSPFv2 非常的相似,包括路由器 ID

网络类型、计时器的值以及邻居的数量等信息。