IPv6 OSPFv3的LSA示例

组网需求

  1. R1、R2、R3和R4运行OSPFv3路由协议,且均部署在骨干区域
  2. 网络稳定后,查看R2的LSDB,可以看到Router-LSA(Type 1)、Network-LSA(Type 2)、Link-LSA(Type 8)和Intra-Area-Prefix-LSA(Type 9)

组网拓扑

OSPFv3的LSA示例拓扑图

配置思路

  1. 配置路由器使能IPv6功能,各个接口使能IPv6功能并配置全局单播地址
  2. 配置OSPFv3路由协议,并指定Router-ID
  3. 接口使能OSPFv3路由协议并指定区域号
  4. 查看各种LSA

配置命令

  1. 配置路由器使能IPv6功能,各个接口使能IPv6功能并配置全局单播地址

    • R1 配置

      1
      2
      3
      4
      5
      6
      7
      8
      sys
      sys R1
      ipv6

      int g0/0/0
      ipv6 enable
      ipv6 address auto link-local
      ipv6 address 2001:db8:2345:12::1/64
  • R2 配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    sys
    sys R2
    ipv6

    int g0/0/0
    ipv6 enable
    ipv6 address auto link-local
    ipv6 address 2001:db8:2345:12::2/64

    int g0/0/1
    ipv6 enable
    ipv6 address auto link-local
    ipv6 address 2001:db8:2345:23::2/64
  • R3 配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys R3
    ipv6

    int g0/0/0
    ipv6 enable
    ipv6 address auto link-local
    ipv6 address 2001:db8:2345:23::3/64
  • R4 配置

    1
    2
    3
    4
    5
    6
    7
    8
    sys
    sys R4
    ipv6

    int g0/0/0
    ipv6 enable
    ipv6 address auto link-local
    ipv6 address 2001:db8:2345:23::4/64
  1. 配置OSPFv3路由协议,并指定Router-ID

    • R1 配置

      1
      2
      3
      sys
      ospfv3 1
      router-id 10.1.1.1
  • R2 配置

    1
    2
    3
    sys
    ospfv3 1
    router-id 10.1.2.2
  • R3 配置

    1
    2
    3
    sys
    ospfv3 1
    router-id 10.1.3.3
  • R4 配置

    1
    2
    3
    sys
    ospfv3 1
    router-id 10.1.4.4
  1. 接口使能OSPFv3路由协议并指定区域号

    • R1 配置

      1
      2
      3
      4
      sys

      int g0/0/0
      ospfv3 1 area 0
  • R2 配置

    1
    2
    3
    4
    5
    6
    sys

    int g0/0/0
    ospfv3 1 area 0
    int g0/0/1
    ospfv3 1 area 0
  • R3 配置

    1
    2
    3
    4
    sys

    int g0/0/0
    ospfv3 1 area 0
  • R4 配置

    1
    2
    3
    4
    sys

    int g0/0/0
    ospfv3 1 area 0

查看结果

  1. 查看R2 的LSDB

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    display ospfv3 lsdb

    <R2>dis ospfv3 lsdb

    * indicates STALE LSA

    OSPFv3 Router with ID (10.1.2.2) (Process 1)
    Link-LSA (Interface GigabitEthernet0/0/0)

    Link State ID Origin Router Age Seq# CkSum Prefix
    0.0.0.3 10.1.1.1 0080 0x80000003 0xbb9d 1
    0.0.0.3 10.1.2.2 0078 0x80000003 0x6d8a 1


    Link-LSA (Interface GigabitEthernet0/0/1)

    Link State ID Origin Router Age Seq# CkSum Prefix
    0.0.0.4 10.1.2.2 0078 0x80000003 0x02e2 1
    0.0.0.3 10.1.3.3 0071 0x80000003 0x9ab0 1
    0.0.0.3 10.1.4.4 0068 0x80000003 0x2449 1

    Router-LSA (Area 0.0.0.0)

    Link State ID Origin Router Age Seq# CkSum Link
    0.0.0.0 10.1.1.1 0031 0x80000006 0x7681 1
    0.0.0.0 10.1.2.2 0020 0x80000008 0x5d69 2
    0.0.0.0 10.1.3.3 0019 0x80000007 0xb03e 1
    0.0.0.0 10.1.4.4 0029 0x80000005 0xa747 1

    Network-LSA (Area 0.0.0.0)

    Link State ID Origin Router Age Seq# CkSum
    0.0.0.3 10.1.2.2 0040 0x80000002 0x9d5c
    0.0.0.3 10.1.4.4 0030 0x80000003 0xdafe

    Intra-Area-Prefix-LSA (Area 0.0.0.0)

    Link State ID Origin Router Age Seq# CkSum Prefix Reference
    0.0.0.2 10.1.2.2 0013 0x80000005 0x033a 1 Network-LSA
    0.0.0.1 10.1.4.4 0022 0x80000004 0xe63f 1 Network-LSA
  1. 查看指定Link State ID的LSA信息

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    display ospfv3 lsdb link 0.0.0.3

    <R2>display ospfv3 lsdb link 0.0.0.3


    OSPFv3 Router with ID (10.1.2.2) (Process 1)


    Link-LSA (Interface GigabitEthernet0/0/0)

    LS Age: 267 //LSA的老化时间
    LS Type: Link-LSA //LSA的类型(Router-LSA、Network-LSA等)
    Link State ID: 0.0.0.3 //LSA报头中的链路状态ID(用于确定唯一LSA的参数之一)
    Originating Router: 10.1.1.1 //产生该LSA的路由器
    LS Seq Number: 0x80000003 //LSA的序列号,序列号数值越大代表LSA越新
    Retransmit Count: 0 //。。。。。
    Checksum: 0xBB9D //LSA的校验和
    Length: 56 //LSA报文长度
    Priority: 1 //该Link-LSA对应接口的优先级
    Options: 0x000013 (-|R|-|-|E|V6) //Options的值
    Link-Local Address: FE80::2E0:FCFF:FE62:66F4 //本地链路地址
    Number of Prefixes: 1 //该LSA中包含的IPv6前缀的数量

    Prefix: 2001:DB8:2345:12::/64 //IPv6前缀
    Prefix Options: 0 (-|-|-|-|-) //IPv6前缀Options值



    LS Age: 265
    LS Type: Link-LSA
    Link State ID: 0.0.0.3
    Originating Router: 10.1.2.2
    LS Seq Number: 0x80000003
    Retransmit Count: 0
    Checksum: 0x6D8A
    Length: 56
    Priority: 1
    Options: 0x000013 (-|R|-|-|E|V6)
    Link-Local Address: FE80::2E0:FCFF:FE4A:AC8
    Number of Prefixes: 1

    Prefix: 2001:DB8:2345:12::/64
    Prefix Options: 0 (-|-|-|-|-)


    Link-LSA (Interface GigabitEthernet0/0/1)

    LS Age: 259
    LS Type: Link-LSA
    Link State ID: 0.0.0.3
    Originating Router: 10.1.3.3
    LS Seq Number: 0x80000003
    Retransmit Count: 0
    Checksum: 0x9AB0
    Length: 56
    Priority: 1
    Options: 0x000013 (-|R|-|-|E|V6)
    Link-Local Address: FE80::2E0:FCFF:FEF3:388A
    Number of Prefixes: 1

    Prefix: 2001:DB8:2345:23::/64
    Prefix Options: 0 (-|-|-|-|-)



    LS Age: 257
    LS Type: Link-LSA
    Link State ID: 0.0.0.3
    Originating Router: 10.1.4.4
    LS Seq Number: 0x80000003
    Retransmit Count: 0
    Checksum: 0x2449
    Length: 56
    Priority: 1
    Options: 0x000013 (-|R|-|-|E|V6)
    Link-Local Address: FE80::2E0:FCFF:FE91:4BB5
    Number of Prefixes: 1

    Prefix: 2001:DB8:2345:23::/64
    Prefix Options: 0 (-|-|-|-|-)
  1. 查看指定LSA的信息

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    display ospfv3 lsdb intra-prefix

    <R2>display ospfv3 lsdb intra-prefix


    OSPFv3 Router with ID (10.1.2.2) (Process 1)


    Intra-Area-Prefix-LSA (Area 0.0.0.0)

    LS Age: 644
    LS Type: Intra-Area-Prefix-LSA
    Link State ID: 0.0.0.2
    Originating Router: 10.1.2.2
    LS Seq Number: 0x80000005
    Retransmit Count: 0
    Checksum: 0x033A
    Length: 44
    Number of Prefixes: 1
    Referenced LS Type: 0x2002 //由DR产生的Network-LSA
    Referenced Link State ID: 0.0.0.3
    Referenced Originating Router: 10.1.2.2

    Prefix: 2001:DB8:2345:12::/64 //有DR产生的,路由器直连的传输网段的IPv6地址前缀
    Prefix Options: 0 (-|-|-|-|-)
    Metric: 0



    LS Age: 653
    LS Type: Intra-Area-Prefix-LSA
    Link State ID: 0.0.0.1
    Originating Router: 10.1.4.4
    LS Seq Number: 0x80000004
    Retransmit Count: 0
    Checksum: 0xE63F
    Length: 44
    Number of Prefixes: 1
    Referenced LS Type: 0x2002
    Referenced Link State ID: 0.0.0.3
    Referenced Originating Router: 10.1.4.4

    Prefix: 2001:DB8:2345:23::/64
    Prefix Options: 0 (-|-|-|-|-)
    Metric: 0
吴超 wechat
subscribe to my blog by scanning my public wechat account