OSPF其它特性

root
233
文章
0
评论
2021年1月20日16:46:07 评论 3904字阅读13分0秒

OSPF其它特性

只要有5类 LSA或7类 LSA产生就会产生LSA

静默接口/被动接口

启用找接口,PC机不会收到hello包了,不收到LSA报文了

[R2]ospf 
[R2-ospf-1]silent-interface g0/0/1

 

引入默认路由

一般都是在和运营商连接的路由器上配置

这条命令,会产生一个5类 LSA,他的角色就会变成ASBR

//总是下发默认路由
[R1-ospf-1]default-route-advertise always

配置不加always,要想下发默认路由的前提是本身自己要有一条默认路由

[R1]ip route-static 0.0.0.0 0.0.0.0 xx外部ip地址

//下发默认路由 
[R1-ospf-1]default-route-advertise

 

路由汇总

作用:通过汇总LSA,达到减少路由表的条目,减轻路由器负担

区域内的路由由ABR做汇总

区域外的路由由ASBR做汇总

汇总遵循的原则:

  • 谁产生的LSA 由谁汇总

 

练习把R7设备上的3跳路由进行汇总

 

做好模拟 

[R7]dis ip int bri
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              22.1.1.2/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         7.7.7.7/32           up         up(s)     
LoopBack1                         7.7.7.8/32           up         up(s)     
LoopBack2                         7.7.7.9/32           up         up(s)     
NULL0                             unassigned           up         up(s)
[R7-ospf-1-area-0.0.0.2]dis this
[V200R003C00]
#
 area 0.0.0.2 
  network 7.7.7.0 0.0.0.255 
  network 22.1.1.0 0.0.0.255 
#

查看LSB的LSA路由表,发现每条3类 LSA都会占用area 0区域的数据库

现在汇总起来,ABR上操作

[R2]ospf 
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]abr-summary 7.7.7.0 255.255.255.0

ABE再次查看一下

如果是ASBR汇总,汇总命令

[R7]ospf 
[R7-ospf-1]asbr-summary 7.7.7.0 255.255.255.0

注意事项:

  • 路由汇总的时候如果存在默认路由就会产生环路,所以要加一条null0路由
//在R7上配置,不在ABR上
[R7]ip route-static 7.7.7.0 24 NULL 0

 

OSPF认证

认证方式

  • 区域认证:就是批量的接口认证
  • 接口认证:在接口视图下配置,对本接口所有报文进行认证

 

认证类型

  • 空认证:不进行认证
  • 简单认证:这是一种简单的加密方式,将配置的密码直接加入报文中,这种加密方式安全性不高
  • 密文认证:通过将配置的密码进行MD5等加密算法之后再加入报文中,这样提高了密码的安全性

启用认证,只有通过OSPF认证的路由器才可以正常建立邻居关系

 

接口认证练习

 

明文认证

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode ?
  hmac-md5  Use HMAC-MD5 algorithm
  keychain  Keychain authentication mode //秘钥串
  md5       Use MD5 algorithm  //密文认证
  null      Use null authentication  //不认证
  simple    Simple authentication mode //明文认证

配置明文认证,这里的加密不加密指的是dis this看到的密码是否加密了,不是封包的时候加密

[R1-GigabitEthernet0/0/0]ospf authentication-mode simple ?
  STRING<1-8>/<32>  The password (key)
  cipher            Encryption type (Cryptogram)   //加密
  plain             Encryption type (Plain text)   //不加密
  <cr>              Please press ENTER to execute command

密文认证

两端设备的 Key ID要一样,密码的ID号码

[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 ?
  INTEGER<1-255>  Key ID
  <cr>            Please press ENTER to execute command
//密码想不想被 dis this命令看到,默认是看不到
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 ?
  STRING<1-255>/<20-392>  The password (key)
  cipher                  Encryption type (Cryptogram)
  plain                   Encryption type (Plain text)
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher xx 
[R1-GigabitEthernet0/0/0]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0 
 ospf authentication-mode md5 1 cipher %$%$/48^&M-ty~[$^\."TdL@U[YB%$%$
#
return

 

区域认证练习

认证指定区域里设备的所有接口,区域里的所有设备都要做认证

[R1]ospf 
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher xx

//R2 area 0区域
[R2]ospf
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher xx 

//R3 area 0区域
[R3]ospf      
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher xx

查看邻居状态

[R3-ospf-1-area-0.0.0.0]dis ospf peer bri

         OSPF Process 1 with Router ID 12.1.1.3
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             12.1.1.1         Full        
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.1          GigabitEthernet0/0/1             24.1.1.2         Full        
 ----------------------------------------------------------------------------

 

 

OSPF路由表为空的第二种原因

等两边OSPF认证类型不一致的时候会导致路由表为空

先查看邻居状态

[R1]dis ospf peer bri

         OSPF Process 1 with Router ID 12.1.1.1
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.0          GigabitEthernet0/0/0             12.1.1.3         Full        
 ----------------------------------------------------------------------------

只在一边的接口做了OSPF认证,查看邻居状态

[R1-GigabitEthernet0/0/0]dis ospf peer bri

         OSPF Process 1 with Router ID 12.1.1.1
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 ----------------------------------------------------------------------------

 

 

 

 

 

 

 

 

继续阅读
weinxin
我的微信
这是我的微信扫一扫
  • 文本由 发表于 2021年1月20日16:46:07
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
OSPF综合练习 Route

OSPF综合练习

OSPF综合练习   IP地址规划 R5/R6/R7之间的网段为:172.16.146.X R5/R6/R2之间的网段为:172.16.100.X 所有路由器都有一个Loopbacck 0接...
IS-IS链路状态路由协议 Route

IS-IS链路状态路由协议

IS-IS链路状态路由协议   IS-IS的由来 IS-IS是国际标准组织ISO为OSI中的无连接网络协议CLNP设计的一种动态路由协议。 现网使用TCP/IP协议,为了提供对IP路由的支持...
路由引入 Route

路由引入

路由引入 什么情况下需要路由引入 不同的路由协议需要互相学习到对方的路由信息 外部路由协议的优先级全都按照OSPF外部路由优先级150计算   情况有很多种 单点单向重分发 单点双向重分发 ...
OSPF特殊区域 Route

OSPF特殊区域

OSPF特殊区域 为什么需要特殊区域? 减少LSA泛洪,减少路由表 OSPF的特殊区域一定是配置在OSPF区域中的非骨干区域里的末梢区域   有哪些特殊区域? Stub末梢区域 【除了区域-...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: