HCIP-2

Broadcast 类型查看

R4display ospf interface g0/0/0

OSPF Process 100 with Router ID 4.4.4.4

Interfaces

Interface: 34.1.1.2 (GigabitEthernet0/0/0)

Cost: 1 State: DROther Type: Broadcast MTU: 1500

Priority: 0

Designated Router: 34.1.1.1

Backup Designated Router: 0.0.0.0

Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

华为设备环回网络类型默认p2p 32位主机路由发送无hello包

R4display ospf interface LoopBack 0

OSPF Process 100 with Router ID 4.4.4.4

Interfaces

Interface: 4.4.4.4 (LoopBack0)

Cost: 0 State: P-2-P Type: P2P MTU: 1500

Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

P2p类型

接口类型: OSPF的工作方式

Loopback LOOPBACK 无hello包,32位主机路由发送

点到点(HDLC/PPP) POINT_TO_POINT hello 10s、dead 40s;不选DR,自动建邻

BMA(以太网) BROADCAST hello 10s、dead 40s;选DR,自动建邻

NBMA(帧中继)

R2display ospf interface s4/0/0

OSPF Process 100 with Router ID 2.2.2.2

Interfaces

Interface: 12.1.1.2 (Serial4/0/0) --> 12.1.1.1

Cost: 48 State: P-2-P Type: P2P MTU: 1500

Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

修改网络类型

R2interface g0/0/0

R2-GigabitEthernet0/0/0ospf network-type nbma

一、真实物理接口: NON_BROADCAST

Hello 30, Dead 120;非自动建邻(不使用组播广播发送hello

包);只能使用单播建立邻居关系;

必须手工进行建邻

R2ospf 100

R2-ospf-100peer 12.1.1.1

point-to-multipoint 工作方式:hello 30s dead 120s;自动建邻,不选DR/BDR;计算路径时已传递过来LSA的邻居为下一跳,自动生成达到该网段所有直连子接口的32位主机路由;

解决ospf不规则区域

  1. 远离骨干的非骨干区域
  2. 不连续的骨干区域

解决方法

  1. Tunnel

在两台ABR上创建tunnel,然后将其宣告到OSPF协议中;

缺点:1、选路不佳 2、周期hello和更新均对中间区域进行影响

R3(config)#interface tunnel 0

R3(config-if)#tunnel source 23.1.1.2

R3(config-if)#tunnel destination 23.1.1.1

R3(config-if)#ip address 10.1.1.2 255.255.255.0

  1. 虚链路 ospf自带

在两台ABR上配置,使未连接骨干的ABR得知骨干的存在,之后将域间路由进行交互;

取消周期的更新和邻居保活;

R2ospf 100

R2-ospf-100area 1

R2-ospf-100-area-0.0.0.1vlink-peer 3.3.3.3

cisco

R3(config)#router ospf 1

R3(config-router)#area 1 virtual-link 2.2.2.2

优点:选路佳、占用中间区域资源少;

缺点:不可靠

  1. 多进程双向重发布技术

R3ospf 101

R3-ospf-101import-route ospf 100

cisco

R3(config)#router ospf 1

R3(config-router)#redistribute ospf 100 subnets

ospf的lsa

Ospf的lsdb

R4display ospf lsdb router 4.4.4.4

OSPF Process 100 with Router ID 4.4.4.4

Area: 0.0.0.2

Link State Database

Type : Router

Ls id : 4.4.4.4

Adv rtr : 4.4.4.4

Ls age : 59

Len : 48

Options : E

seq# : 80000004

chksum : 0xe2e0

Link count: 2

* Link ID: 4.4.4.4

Data : 255.255.255.255

Link Type: StubNet

类型 通告者 携带信息 传播范围 link-id

router 自己本身 链路状态 本区域 自己本身router-id

network dr 描述ma网络 本区域 dr的ip地址

summary abr 域外路由条目 整个ospf域 域外路由条目

asbr abr asbr的位置 整个ospf域 asbr的router-id

External asbr 重发布进入的路由条目 除重发布进入区域的所有区域 重发布进入的路由条目

ABR 区域边界路由器

ASBR 自治系统边界路由器,不同协议边界路由器

OSPF的优化:减少LSA的更新

1、特殊区域--优化非骨干区域

条件:不能为骨干区域,不能存在虚链路

【1】不能存在ASBR

{1}末梢区域---拒绝4、5类LSA;产生一条3类缺省

r3(config)#router ospf 1

r3(config-router)#area 1 stub 该区域内所有设备均需配置

华为设备

R2ospf 100

R2-ospf-100area 1

R2-ospf-100-area-0.0.0.1stub

{2}完全末梢区域---在末梢区域的基础上进一步拒绝3类的LSA,仅保留一条3类的缺省

先将该区域配置为末梢区域,然后仅需要在ABR上定义为完全末梢即可

r3(config)#router ospf 1

r3(config-router)#area 1 stub no-summary

华为

R2ospf 100

R2-ospf-100area 1

R2-ospf-100-area-0.0.0.1stub no-summary

【2】存在ASBR

{1}NSSA---拒绝4、5的LSA,不自动产生3类缺省;5类在NSSA区域内被转换为7类转发;离开该区域后还原为5类

r1(config)#router ospf 1

r1(config-router)#area 2 nssa

华为设备拒绝4类 产生7类缺省

华为

R4ospf 100

R4-ospf-100area 2

R4-ospf-100-area-0.0.0.2nssa

{2}完全的NSSA----在NSSA的基础上,进一步拒绝3/4/5类LSA,5类转7类;自动产生缺省指向ABR;

先将该区域配置为NSSA,然后仅需要在ABR上定义为完全即可

r1(config)#router ospf 1

r1(config-router)#area 2 nssa no-summary

华为 华为设备自动产生7类缺省 cisco不自动产生。

R4ospf 100

R4-ospf-100area 2

R4-ospf-100-area-0.0.0.2nssa no-summary

  1. 域间路由汇总--在ABR上操作

r3(config)#router ospf 1

r3(config-router)#area 1 range 4.4.4.0 255.255.254.0

通过该区域内的1/2类LSA计算所得路由才可以汇总

华为设备

R2ospf 100

R2-ospf-100area 1

R2-ospf-100-area-0.0.0.1abr-summary 192.168.0.0 255.255.252.0

  1. 域外路由汇总---在ASBR上操作

r5(config)#router ospf 1

r5(config-router)#summary-address 99.1.0.0 255.255.252.0 域外路由可以为5、7类

华为

R4ospf 100

R4-ospf-100asbr-summary 172.16.0.0 255.255.252.0

OSPF的扩展配置:

  1. 认证

【1】接口认证--在邻居间相连的接口上配置

  1. 接口明文

r1(config)#int s1/1

r1(config-if)#ip ospf authentication

先开启明文认证需求,开启后本地hello包中认证类型字段已经变化,邻居间必须一致

r1(config-if)#ip ospf authentication-key cisco 配置明文密码

华为

R1interface g0/0/0

R1-GigabitEthernet0/0/0ospf authentication-mode simple cipher 123

(2)接口密文

r2(config)#int s1/1

r2(config-if)#ip ospf authentication message-digest

r2(config-if)#ip ospf message-digest-key 1 md5 cisco

邻居间必须完全一致

华为

R3interface g0/0/1

R3-GigabitEthernet0/0/1ospf authentication-mode simple cipher 123

R3-GigabitEthernet0/0/1ospf authentication-mode md5

【2】区域认证

例:在R1上开启关于0区域的明文或密文认证;之后实际是将R1上工作于区域0的接口修改认证类型字段为明文或密文;之后的密码还需要到各个接口上逐一配置;

r3(config)#router ospf 1

r3(config-router)#area 0 authentication 区域明文认证

r3(config-router)#area 0 authentication message-digest 区域密文认证

华为

R1ospf 100

R1-ospf-100area 3

R1-ospf-100-area-0.0.0.3authentication-mode simple cipher 123

R4ospf 100

R4-ospf-100area 1

R4-ospf-100-area-0.0.0.1authentication-mode simple cipher 123

R4-ospf-100-area-0.0.0.1authentication-mode md5

【3】虚链路认证

r3(config)#router ospf 1

r3(config-router)#area 1 virtual-link 4.4.4.4 authentication 明文

r3(config-router)#area 1 virtual-link 4.4.4.4 authentication-key cisco

r3(config-router)#area 1 virtual-link 4.4.4.4 authentication message-digest 密文

r3(config-router)#area 1 virtual-link 4.4.4.4 message-digest-key 1 md5 cisco

华为

R4ospf 100

R4-ospf-100area 1

R4-ospf-100-area-0.0.0.1vlink-peer 3.3.3.3 simple cipher 123

密文

R4-ospf-100-area-0.0.0.1vlink-peer 3.3.3.3 simple cipher 123

R4-ospf-100-area-0.0.0.1vlink-peer 3.3.3.3 md5

特殊区域不能做虚链路

  1. 加快协议收敛速度 10s 40s 30s 120s 邻居间必须一致

r1(config)#int s1/1

r1(config-if)#ip ospf hello-interval 5

修改本端的hello time,本端dead time 自动4倍关系匹配

r1(config-if)#ip ospf dead-interval 20 修改本端的dead time,本端hello time不变化的;

华为

R2interface g0/0/0

R2-GigabitEthernet0/0/0ospf timer hello 5

R2-GigabitEthernet0/0/0ospf timer dead 20

  1. 被动接口---用于同用户相连的接口,只接收不发送路由协议信息

r2(config)#router ospf 1

r2(config-router)#passive-interface fastEthernet 0/0

静默接口

R2ospf 100

R2-ospf-100silent-interface g0/0/3

  1. 缺省路由

3类的缺省---由特殊区域自动产生 末梢、完全末梢、完全NSSA

5类的缺省----在一台路由器上,必须已经拥有缺省条目的前提下,进行重发布

r2(config)#router ospf 1

r2(config-router)#default-information originate

若一台设备上不存在缺省路由,那么也可以强制向网内重发布缺省

r2(config)#router ospf 1

r2(config-router)#default-information originate always

注:进入的条目为类型2;

类型1,在内网传递时携带内部的度量值

类型2,在内网传递时不携带内部的度量值

r2(config)#router ospf 1

r2(config-router)#default-information originate metric-type 1

r2(config-router)#default-information originate always metric-type 1

华为

R1ospf 100

R1-ospf-100default-route-advertise

R1-ospf-100default-route-advertise always

R1ospf 100

R1-ospf-100default-route-advertise always type 1

7类的缺省---边界路由器所在位置处于NSSA区域内,且该路由器上已经拥有缺省路由;

r5(config)#router ospf 1

r5(config-router)#area 2 nssa default-information-originate 默认进入为类型2;

r5(config-router)#area 2 nssa default-information-originate metric-type 1 修改为类型1

相关推荐
云栖梦泽在13 小时前
稳如狗网络工具箱:IP、DNS、WebRTC、测速、连通性和全球延迟检测工具简明介绍
网络·网络协议·tcp/ip·网络安全·性能优化·webrtc
倚栏听雨_ylty20 小时前
H3C交换机关闭Telnet和HTTP服务实例
运维·网络·tcp/ip·网络安全
白猫不黑20 小时前
SQL注入实战:手工注入全流程详解
网络·数据库·sql·web安全·网络安全·信息安全
是三一seven1 天前
Sql注入基础
数据库·安全·网络安全
学逆向的2 天前
汇编——JCC指令
开发语言·汇编·网络安全
腾霄星月2 天前
Cobalt Strike(CS)内网渗透工具核心重点知识总结
网络安全·cs·cobalt strike
网安老伯3 天前
网络安全基础要点知识介绍(非常详细),零基础入门到精通,看这一篇就够了
运维·前端·网络协议·web安全·网络安全·职场和发展
北龙云海3 天前
案例分享 | 面向公网业务系统境内访问白名单配置实操方案
运维·网络·安全·网络安全·告警·数据泄露·入侵攻击
Draina3 天前
CBC填充预言攻击-CBC Padding Oracle Crypto Attack
python·安全·web安全·网络安全·密码学·安全性测试
国际云,接待4 天前
Google Cloud Armor实战:给网站API加WAF、限速和日志验证
后端·网络安全·云计算·googlecloud