当前位置:网站首页>OSPF综合实验
OSPF综合实验
2022-07-17 00:16:00 【韵晟】
OSPF:
开放式最短路径优先协议
无类别链路状态igp协议;周期更新(30min)+触发更新;链路状态协议的更新量随着网络范围的扩展指数性的上升,因此ospf协议为了在中大型网络中工作,需要结构化的部署-区域划分、合理ip地址规划;组播更新--- 224.0.0.5 224.0.0.6
拓扑图:
1.实验要求:
(1).R1-3为区域0,R3到R4为区域1,其中R3的环回也在区域0
(2).R1-R3 R3为DR设备,没有BDR
(3).R4环回地址已固定,其他网段使用192.168.1.0/24进行合理分配
(4).环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目数量
2.实验思路:
(1).相对于区域 对ip 192.168.1.0/24进行子网划分()
0区域(area 0)
192.168.1.0/24
192.168.1.0/25
0000 0000
192.168.1.0/28
192.168.1.16/28
192.168.1.32/28
192.168.1.48/28
192.168.1.64/28
1区域(area 1)
192.168.1.128/25
(2)配置:先对路由器进行ip配置.;路由器进行SPF配置:由于R4环回不能通过OSPF宣告,所以利用缺省路由(实现全网可达);在0区域定义优先级,实现DR(邻接关系)配置;对OSPF进行认证(加密)实现传输的安全性,由于对子网进行划分的时候存在一些网段没有使用,容易出现路由黑洞,所以要对路由AR7定义空接口,防止路由黑洞。
3.配置命令
先对路由器各个接口配置ip:
以AR8为例:
OSPF配置命令:
定义进程号,路由ID,区域,宣告网段:
以R8为例:
定义优先级,让R7成为DR:
补充一下DR/BDR的知识,便于大家学习。
DR/BDR选举:
邻居成为邻接关系的条件;与网络类型有关;
网络类型:
点到点--在一个网段内只能存在两个节点 -- 串线链路
MA--多路访问-在一个网段内的节点数量不限制;不是当下连接了几个节点;而是该网络类型允许最终连接多个节点;--以太网
点到点网络邻居关系直接成为邻接关系;在MA网络中,将进行DR/BDR选举;在一个网段中仅DR/BDR与其他路由器为邻接关系;非DR/BDR之间为邻居关系;
选举规则:
先比较该网段所有参选设备接口的优先级,越大越优;
默认优先级为1;取值范围0-255,0标识不参选
2. 若所有参选者优先级相同,比较参选设备的RID,数值大优;
干涉选举:
3.DR优先级最大,BDR次大 -- 切记ospf的选举是非抢占性的;故在修改完优先级后,需要所有路由器重启OSPF进程;
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 3 //修改接口优先级
<r1>reset ospf process //重启ospf进程
以R6为例:
缺省路由的配置(即使不对R8的环回宣告也可以实现全网可达)
配置命令:[r8-ospf-1]default-route-advertise always
验证:
R5pingR8的环回:ping 4.4.4.4
原理:
通过缺省命令的配置,OSPF通过收集路由信息,使的其他路由器获得0.0.0.0 下一跳,192.168.1.51 的路由表,实现自动寻找目标IP的效果。
对路由的传输信息实现加密:
以R5为例:
配置命令:
注意:在同一个区域内,要同时进行认证(加密)配置。
以此次实验为例:
R5,R6,R7都在区域0 ,所以都要进行认证。
补充:
认证 -- 接口认证 在直连邻居或邻接的接口上配置,保障更新的安全
[r1-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
模式、编号、密码要求邻居间一致
定义空接口,处理路由黑洞(防止出现环路)
配置命令:
原理:
为什么要这样做?
定义空接口0:当访问该网段的IP时,假如此时目标IP断开,由于定义了缺省路由,源IP找不到目标IP利用缺省返回上一层路由,上一层路由又会把信息传送到丢失IP的路由器上,此时,形成环路(死循环)造成网络资源的浪费
减少路由条目数量:
为什么要这样做:
因为OSPF协议占用带宽比较大,由于自身的算法机制,导致资源占用大,减少路由条目数量可以减轻资源占用,后期属于网络优化。
操作命令:
结语:
创作不易,希望能帮到正在努力的大家,感谢大家支持!!
边栏推荐
- String Full Permutation Problem
- Detailed explanation of caduceus project of metauniverse public chain (I): project concept and technical framework of caduceus metaverse protocol
- squid代理服务部署
- InnoDB, MySQL structure, and the difference between the three kinds of deletion
- Project Performance Optimization Practice: solve the white screen problem of the home page, customize the loading animation to optimize the first screen effect
- Leetcode 70:Climbing Stairs
- 2022最新软件测试工具大全
- SSH远程控制与访问
- PXE automated installation
- Interface (collection/map) - implementation and comparison of interfaces
猜你喜欢
echo -e用法
PHP pseudo protocol for command execution
Shell programming specifications and variables
[solution] the local Group Policy Editor (gpedit.msc) in Win 11 cannot be opened
[unity Editor Extension] unity makes its own exclusive editor panel
Sword finger offer 48 The longest substring without repeated characters
Circular statements and functions of shell scripts
Inverse yuan (I'll add these words if there are too many people using the name)
Metersphere is based on JMeter distributed performance pressure testing platform
Swagger -- the most popular API framework in the world
随机推荐
Interpretation of concurrent virtual users, RPS and TPS
DNS域名解析
Static routing (detailed)
通过Xshell7使用rz,sz命令上传下载文件
[unity Editor Extension] displays the memory size of all files in the resource directory
Dynamic programming - 01 knapsack problem
Test points of login function
Chapter 1 - multi agent system
ctfhub--ssrf
HCIA_OSPF实验
RHCE-ansible第二次作业
DNS domain name resolution
expect免交互
Conditional statement of shell script
InnoDB, MySQL structure, and the difference between the three kinds of deletion
Subnet division (see details)
[unity Editor Extension] quickly locate the specified files and paths of resources and scripts
[solved] after referring to the local MySQL and forgetting the password, [server] --initialize specified but the data directory has files in it Aborti
性能之流量回放
Leetcode 198:House Robber