本站已运行

攻城狮论坛

作者: 风流倜傥
查看: 230|回复: 0

more +今日重磅推荐Recommend No.1

所有IT类厂商认证考试题库下载所有IT类厂商认证考试题库下载

more +随机图赏Gallery

【新盟教育】2023最新华为HCIA全套视频合集【网工基础全覆盖】---国sir公开课合集【新盟教育】2023最新华为HCIA全套视频合集【网工基础全覆盖】---国sir公开课合集
【新盟教育】网工小白必看的!2023最新版华为认证HCIA Datacom零基础全套实战课【新盟教育】网工小白必看的!2023最新版华为认证HCIA Datacom零基础全套实战课
原创_超融合自动化运维工具cvTools原创_超融合自动化运维工具cvTools
重量级~~30多套JAVA就业班全套 视频教程(请尽快下载,链接失效后不补)重量级~~30多套JAVA就业班全套 视频教程(请尽快下载,链接失效后不补)
链接已失效【超过几百G】EVE 国内和国外镜像 全有了 百度群分享链接已失效【超过几百G】EVE 国内和国外镜像 全有了 百度群分享
某linux大佬,积累多年的电子书(约300本)某linux大佬,积累多年的电子书(约300本)
乾颐堂现任明教教主Python完整版乾颐堂现任明教教主Python完整版
乾颐堂 教主技术进化论 2018-2019年 最新31-50期合集视频(各种最新技术杂谈视频)乾颐堂 教主技术进化论 2018-2019年 最新31-50期合集视频(各种最新技术杂谈视频)
Python学习视频 0起点视频 入门到项目实战篇 Python3.5.2视频教程 共847集 能学102天Python学习视频 0起点视频 入门到项目实战篇 Python3.5.2视频教程 共847集 能学102天
约21套Python视频合集 核心基础视频教程(共310G,已压缩)约21套Python视频合集 核心基础视频教程(共310G,已压缩)
最新20180811录制 IT爱好者-清风羽毛 - 网络安全IPSec VPN实验指南视频教程最新20180811录制 IT爱好者-清风羽毛 - 网络安全IPSec VPN实验指南视频教程
最新20180807录制EVE开机自启动虚拟路由器并桥接物理网卡充当思科路由器最新20180807录制EVE开机自启动虚拟路由器并桥接物理网卡充当思科路由器

[路由交换] OSPF的NSSA详解

[复制链接]
查看: 230|回复: 0
开通VIP 免金币+免回帖+批量下载+无广告
HCIEv3.0 OSPF收尾
1.OSPF的STUB
[SW3]dis cu conf ospf
#
ospf 1 router-id 13.13.13.13
area 0.0.0.15
  stub
[SW3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 10       Routes : 14      

3 Y* k: V+ C2 c) ?  ?
OSPF routing table status : <Active>
         Destinations : 10       Routes : 14

; ~" j- ?& o8 |) d- [" C: f# m
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
8 p* B/ e; @; b1 z  q9 y
        0.0.0.0/0   OSPF    10   2           D   10.1.15.1       Vlanif30
                    OSPF    10   2           D   10.1.15.5       Vlanif30 //area 15因为存在2个ABR,每个ABR都会产生默认路由的3类LSA(开销值默认为1),总的开销值为2
[R1]dis ospf lsdb summary 0.0.0.0

  Y: m  U9 }& ^& H
         OSPF Process 1 with Router ID 0.0.0.1
                         Area: 0.0.0.0
                 Link State Database
0 i- D; M( [/ L4 z, v3 C, B7 R
                         Area: 0.0.0.15
                 Link State Database

: @) M% m  d( `  H! C9 }) }) ?& y: `8 Y) e2 s
  Type      : Sum-Net
  Ls id     : 0.0.0.0
  Adv rtr   : 0.0.0.1  
  Ls age    : 357
  Len       : 28
  Options   : None
  seq#      : 80000001
  chksum    : 0x8dcf
  Net mask  : 0.0.0.0
  Tos 0  metric: 1
  Priority  : Low

% W0 `/ Y  }+ \' e, F# Y) B
  Type      : Sum-Net
  Ls id     : 0.0.0.0
  Adv rtr   : 5.5.5.5  
  Ls age    : 351
  Len       : 28
  Options   : None
  seq#      : 80000001
  chksum    : 0xfc4d
  Net mask  : 0.0.0.0
  Tos 0  metric: 1
  Priority  : Low
完全的STUB区域:
进一步减少3类LSA,仅仅剩余1、2、ABR产生的默认路由的3类LSA
在ABR设备上实施no-summary
[R1]ospf
[R1-ospf-1]area 15
[R1-ospf-1-area-0.0.0.15]stub no-summary
[R5]ospf
[R5-ospf-1]area 15
[R5-ospf-1-area-0.0.0.15]stub no-summary
[SW3]dis ospf routing

1 s, w9 N2 N, P/ q! \5 h8 L
         OSPF Process 1 with Router ID 13.13.13.13
                  Routing Tables
' Z$ b# p+ l) J
Routing for Network
Destination        Cost  Type       NextHop         AdvRouter       Area
10.1.15.0/24       1     Transit    10.1.15.3       13.13.13.13     0.0.0.15
0.0.0.0/0          2     Inter-area 10.1.15.1       0.0.0.1         0.0.0.15
0.0.0.0/0          2     Inter-area 10.1.15.5       5.5.5.5         0.0.0.15
( B' r* G' I; a: Y3 p
[SW3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 1        Routes : 2        

( S' R5 P. F/ l  T  j+ E
OSPF routing table status : <Active>
         Destinations : 1        Routes : 2

2 T/ F7 q0 ?! g- M+ S
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

- w% |) H9 E/ z6 q, y7 ]2 D( D
        0.0.0.0/0   OSPF    10   2           D   10.1.15.1       Vlanif30
                    OSPF    10   2           D   10.1.15.5       Vlanif30
2.OSPF的NSSA(not so stub area)区域
不接收5类LSA,但是可以引入外部路由,引入一种新的7类的NSSA的LSA
一个分支现在不接收5类LSA,同时还要在本区域得到默认路由去指向运行商而不是总公司(area 0)
[SW3-ospf-1]ar
[SW3-ospf-1]area 15
[SW3-ospf-1-area-0.0.0.15]
[SW3-ospf-1-area-0.0.0.15]nssa
Error: The specified area has been configured as a STUB area. //需要先拿掉STUB的配置,然后再配置NSSA
[R5-ospf-1-area-0.0.0.15]dis th
[V200R003C00]
#
area 0.0.0.15
  nssa //该区域中所有设备都配置nssa,否则NP位不一致,导致无法建立邻居
[SW3-ospf-1-area-0.0.0.15]dis ospf peer brief

4 o6 ^. ~: ]# y$ z
         OSPF Process 1 with Router ID 13.13.13.13
                  Peer Statistic Information
----------------------------------------------------------------------------
Area Id          Interface                        Neighbor id      State   
0.0.0.15         Vlanif30                         0.0.0.1          Full        
0.0.0.15         Vlanif30                         5.5.5.5          Full        
----------------------------------------------------------------------------
[SW3]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 13       Routes : 14      
( ^/ F; \4 m# t8 `9 Q% p
OSPF routing table status : <Active>
         Destinations : 13       Routes : 14
& t  S! b1 q3 }- l- q1 i# l( D
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
# Y( |- W+ H- A: N0 B2 v. E, C  k2 Q$ l
        0.0.0.0/0   O_NSSA  150  1           D   10.1.15.1       Vlanif30
                    O_NSSA  150  1           D   10.1.15.5       Vlanif30 //华为设备上默认从ABR(s)处得到7类LSA产生的默认路由,这点在思科设备上不会自动产生
       10.1.1.1/32  OSPF    10   1           D   10.1.15.1       Vlanif30
       10.1.1.4/32  OSPF    10   49          D   10.1.15.1       Vlanif30
       10.1.1.5/32  OSPF    10   1           D   10.1.15.5       Vlanif30
      10.1.34.0/24  OSPF    10   97          D   10.1.15.1       Vlanif30
      10.1.35.0/24  OSPF    10   2           D   10.1.15.5       Vlanif30
      10.1.56.0/24  OSPF    10   49          D   10.1.15.5       Vlanif30
       11.1.1.1/32  OSPF    10   1           D   10.1.15.1       Vlanif30
       33.1.1.1/32  OSPF    10   2           D   10.1.15.5       Vlanif30
       44.1.1.1/32  OSPF    10   49          D   10.1.15.1       Vlanif30
       55.1.1.1/32  OSPF    10   1           D   10.1.15.5       Vlanif30
       66.1.1.1/32  OSPF    10   49          D   10.1.15.5       Vlanif30
      100.1.1.1/32  O_NSSA  150  1           D   10.1.15.1       Vlanif30 //不同于STUB区域,此时NSSA区域得到了本区域引入的7类LSA产生的外部路由(其他区域引入的外部路由通过默认路由去访问)
[R6-ospf-1]import-route direct
[SW3]dis ip routing-table protocol ospf //NSSA内部的设备看不到其他区域引入的外部路由,但是可以通过默认路由去访问
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 13       Routes : 14      

& {. H! H2 D1 }' N$ o5 p% j, ^
OSPF routing table status : <Active>
         Destinations : 13       Routes : 14

$ ~* v- g% q, {, Q
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
4 `7 a% [" n) k7 o  V: n
        0.0.0.0/0   O_NSSA  150  1           D   10.1.15.1       Vlanif30
                    O_NSSA  150  1           D   10.1.15.5       Vlanif30
       10.1.1.1/32  OSPF    10   1           D   10.1.15.1       Vlanif30
       10.1.1.4/32  OSPF    10   49          D   10.1.15.1       Vlanif30
       10.1.1.5/32  OSPF    10   1           D   10.1.15.5       Vlanif30
      10.1.34.0/24  OSPF    10   97          D   10.1.15.1       Vlanif30
      10.1.35.0/24  OSPF    10   2           D   10.1.15.5       Vlanif30
      10.1.56.0/24  OSPF    10   49          D   10.1.15.5       Vlanif30
       11.1.1.1/32  OSPF    10   1           D   10.1.15.1       Vlanif30
       33.1.1.1/32  OSPF    10   2           D   10.1.15.5       Vlanif30
       44.1.1.1/32  OSPF    10   49          D   10.1.15.1       Vlanif30
       55.1.1.1/32  OSPF    10   1           D   10.1.15.5       Vlanif30
       66.1.1.1/32  OSPF    10   49          D   10.1.15.5       Vlanif30
      100.1.1.1/32  O_NSSA  150  1           D   10.1.15.1       Vlanif30

6 G) R' E; {; @& C* G7 I
OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0
% N5 B8 G1 H. P+ y; s
[SW3]ping 6.6.6.6
  PING 6.6.6.6: 56  data bytes, press CTRL_C to break
    Reply from 6.6.6.6: bytes=56 Sequence=1 ttl=254 time=70 ms
    Reply from 6.6.6.6: bytes=56 Sequence=2 ttl=254 time=50 ms
    Reply from 6.6.6.6: bytes=56 Sequence=3 ttl=254 time=50 ms
    Reply from 6.6.6.6: bytes=56 Sequence=4 ttl=254 time=50 ms
    Reply from 6.6.6.6: bytes=56 Sequence=5 ttl=254 time=50 ms
( J5 S; Y" C. V5 w4 }( B8 O( X
  --- 6.6.6.6 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 50/54/70 ms
NSSA的特点:本区域可以为所欲为的引入外部路由,其他区域引入的外部路由不接受(只许州官放火不许百姓点灯)
=========================
7类LSA
通告者:NSSA区域的ASBR
通告范围:仅仅在NSSA区域(更新到NSSA区域外会变成5类LSA)
内容和功能:描述NSSA区域产生的外部路由(网络前缀、掩码、度量、类型、转发地址、tag)
[SW3]dis ospf lsdb nssa 100.1.1.1      

' b# a+ J' n! g  U. r( q. j
         OSPF Process 1 with Router ID 13.13.13.13
                         Area: 0.0.0.15
                 Link State Database

' U* c; k5 n3 y9 d1 ~
/ p5 t; G. g! v3 F% o
  Type      : NSSA
  Ls id     : 100.1.1.1
  Adv rtr   : 0.0.0.1  
  Ls age    : 1526
  Len       : 36
  Options   : None
  seq#      : 80000001
  chksum    : 0xd40
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.1 //NSSA LSA的转发地址一般都去非0
  Tag       : 1
  Priority  : Medium
------------------------
[SW3]ip route-static 133.1.1.1 32 NULL 0
[SW3]ospf
[SW3-ospf-1]import-route static
[SW3-ospf-1]dis ospf lsdb nssa self-originate
1 X& h" ?/ @8 R' l1 l) X9 e' P
         OSPF Process 1 with Router ID 13.13.13.13
                         Area: 0.0.0.15
                 Link State Database

: J- t' b. C2 ]0 c' h( P! Q2 Q
3 s# j4 g: S: a# H$ U0 [- n+ Z4 M: I
  Type      : NSSA
  Ls id     : 133.1.1.1
  Adv rtr   : 13.13.13.13  
  Ls age    : 37
  Len       : 36
  Options   :  NP //P代表可以转换
  seq#      : 80000001
  chksum    : 0x806e
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.3
  Tag       : 1
  Priority  : Low
默认情况下是NSSA区域的ABR(RID较大的ABR,防环的角度)进行的7-->5
<R3>dis ip routing-table 133.1.1.1   
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
# b5 s. ]" @% s' r* Y2 e: v- o# Y2 O
      133.1.1.1/32  O_ASE   150  1           D   10.1.35.5       GigabitEthernet0/0/0
<R3>dis ospf lsdb ase 133.1.1.1

9 k- R- I$ v' ~
         OSPF Process 1 with Router ID 33.1.1.1
                 Link State Database
) S* e6 ~+ W+ C% S

5 I7 C- a1 c; D0 W6 F
  Type      : External
  Ls id     : 133.1.1.1
  Adv rtr   : 5.5.5.5 //是NSSA区域的ABR设备做了7转5,
  Ls age    : 318
  Len       : 36
  Options   :  E  
  seq#      : 80000001
  chksum    : 0xe72f
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.3
  Tag       : 1
  Priority  : Medium
<R3>dis ospf abr-asbr
7 H$ z! U% m! v& @
         OSPF Process 1 with Router ID 33.1.1.1
                 Routing Table to ABR and ASBR

5 _3 K  r. z9 F
RtType      Destination       Area       Cost  Nexthop         Type
Intra-area  0.0.4.4           0.0.0.34   48    10.1.34.4       ABR
Intra-area  5.5.5.5           0.0.0.35   1     10.1.35.5       ABR/ASBR //对ASBR的进一步理解:只要产生了5类LSA就是ASBR
Inter-area  0.0.0.1           0.0.0.35   49    10.1.35.5       ASBR
Inter-area  0.0.0.6           0.0.0.35   49    10.1.35.5       ASBR
=======================
NSSA的细节:
no-summary之后,ABR产生几类的默认路由?3类。OSPF形式的默认路由只能以3、5、7类存在
. a2 l4 c4 X; I( J7 Z
<SW3>dis ospf routing

( G' b+ W! k' O7 h& p3 f# }( \
         OSPF Process 1 with Router ID 13.13.13.13
                  Routing Tables
. S1 `# B( T# m; @/ Q
Routing for Network
Destination        Cost  Type       NextHop         AdvRouter       Area
10.1.15.0/24       1     Transit    10.1.15.3       13.13.13.13     0.0.0.15
0.0.0.0/0          2     Inter-area 10.1.15.1       0.0.0.1         0.0.0.15
0.0.0.0/0          2     Inter-area 10.1.15.5       5.5.5.5         0.0.0.15
2 g, Q! ~" O4 O0 j. y: V0 i, a" J/ Y0 t
Total Nets: 3  
Intra Area: 1  Inter Area: 2  ASE: 0  NSSA: 0
, [- [4 y3 w' Q  k& B9 }% D( F
<SW3>dis ip rou pro ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 1        Routes : 2        
3 n8 A$ O+ `8 x% C' d  [
OSPF routing table status : <Active>
         Destinations : 1        Routes : 2

9 [5 H% D+ s( B7 N
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

9 e# d; g/ f3 e6 t  y( C" Z3 K5 M
        0.0.0.0/0   OSPF    10   2           D   10.1.15.5       Vlanif30
                    OSPF    10   2           D   10.1.15.1       Vlanif30
# u. }4 L4 u" s! _+ k0 x0 j6 a  G
OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0
---------------------------
ABR同时也是ASBR的设备引入外部路由,NP不置位,因为这不需要把7类再转成5类,因为ASBR本身就产生了5类LSA。
[R1-ospf-1]import-route static
[R1-ospf-1]dis ospf lsdb nssa self-originate

: {- \+ R  r& f% W5 g7 q! s
         OSPF Process 1 with Router ID 0.0.0.1
                         Area: 0.0.0.0
                 Link State Database

9 Q/ `- ], M! h
                         Area: 0.0.0.15
                 Link State Database
, w' e& h' K' [; L9 z; O$ Q+ K& G
  Type      : NSSA
  Ls id     : 100.1.1.1
  Adv rtr   : 0.0.0.1  
  Ls age    : 16
  Len       : 36
  Options   : None
  seq#      : 80000001
  chksum    : 0xd40
  Net mask  : 255.255.255.255            
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.1
  Tag       : 1
  Priority  : Low

! O% S0 n, r4 m4 L" J! ~0 z% q
[R1-ospf-1]dis ospf lsdb ase self-originate

4 l1 z. X, v) ]9 t' J4 t) e( a" L% d
         OSPF Process 1 with Router ID 0.0.0.1
                 Link State Database

" p4 b& {3 ]3 R5 L! H" F7 F' R+ e* c7 _" @2 n6 u+ L, j
  Type      : External
  Ls id     : 100.1.1.1
  Adv rtr   : 0.0.0.1  
  Ls age    : 46
  Len       : 36
  Options   :  E  
  seq#      : 80000001
  chksum    : 0xbea9
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 0.0.0.0
  Tag       : 1
  Priority  : Low
====================
translator-always            Set NSSA translator role always //总是进行7转5的操作
R1上配置该命令,结果
<R4>dis ospf lsdb ase 133.1.1.1 //开始看到的情况R1和R5都做了转换
: t! b3 G; M* D# ]: x' K
         OSPF Process 1 with Router ID 0.0.4.4
                 Link State Database

; d* \6 r! E: X( {2 ~9 A' I( Q! {0 V- @0 M; w& u0 {
  Type      : External
  Ls id     : 133.1.1.1
  Adv rtr   : 5.5.5.5  
  Ls age    : 825
  Len       : 36
  Options   :  E  
  seq#      : 80000001
  chksum    : 0xe72f
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.3
  Tag       : 1
  Priority  : Medium
& h% M$ G5 f. k5 c
  Type      : External
  Ls id     : 133.1.1.1
  Adv rtr   : 0.0.0.1  
  Ls age    : 36
  Len       : 36
  Options   :  E  
  seq#      : 80000001
  chksum    : 0x78b1
  Net mask  : 255.255.255.255            
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.3
  Tag       : 1
  Priority  : Medium
<R4>dis ospf lsdb ase 133.1.1.1
2 x, D: I# c3 \: w1 o0 w. i
         OSPF Process 1 with Router ID 0.0.4.4
                 Link State Database

% p/ b; e' P" e' K4 N
, Z  I8 ?6 C( k: y2 X/ ?2 g
  Type      : External
  Ls id     : 133.1.1.1
  Adv rtr   : 0.0.0.1  
  Ls age    : 175
  Len       : 36
  Options   :  E  
  seq#      : 80000001
  chksum    : 0x78b1
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.15.3
  Tag       : 1
  Priority  : Medium
<R5>dis ospf lsdb ase 133.1.1.1 self-originate //R5不在做7转5的转换
$ N. B1 o7 b6 S% `
         OSPF Process 1 with Router ID 5.5.5.5
                 Link State Database
-----------------------
no-import-route //ABR如果做了引入外部路由,由于NSSA内部设备可以通过默认路由访问外部,我们可以不需要改路由
<SW3>dis ip rou pro ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 2        Routes : 3        

1 b$ h* u1 V$ ?. ^: r6 b3 _" u
OSPF routing table status : <Active>
         Destinations : 2        Routes : 3

# N, k$ ?8 M" D; ^
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
# `- ]8 ^: e4 Q: {3 B
        0.0.0.0/0   OSPF    10   2           D   10.1.15.5       Vlanif30
                    OSPF    10   2           D   10.1.15.1       Vlanif30
      100.1.1.1/32  O_NSSA  150  1           D   10.1.15.1       Vlanif30 //默认进入NSSA
[R1-ospf-1-area-0.0.0.15]nssa translator-always no-summary no-import-route
<SW3>dis ip rou pro ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 1        Routes : 2        
' V. Q. W/ V6 Z  A1 V0 }
OSPF routing table status : <Active>
         Destinations : 1        Routes : 2
  m6 X* L: f, Q/ d5 x
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
) O/ `$ D6 h) v* H
        0.0.0.0/0   OSPF    10   2           D   10.1.15.5       Vlanif30
                    OSPF    10   2           D   10.1.15.1       Vlanif30
-----------------------------
ABR转换为5类LSA后转发地址为全0
[R1-ospf-1-area-0.0.0.15]nssa translator-always no-summary no-import-route suppress-forwarding-address
<R4>dis ospf lsdb ase 133.1.1.1
5 i+ B9 B: N& l/ Q! h
         OSPF Process 1 with Router ID 0.0.4.4
                 Link State Database
添加客服微信了解更多!

4 ~+ G6 }5 N" x1 L% Y
CCNA考试 官方正规报名 仅需1500元
回复 论坛版权

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|无图浏览|手机版|网站地图|攻城狮论坛

GMT+8, 2026-5-20 11:16 , Processed in 0.137906 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4 © 2001-2013 Comsenz Inc.

Designed by ARTERY.cn