CCNP之OSPF实验报告
OSPF实验报告
一、实验要求
1、R4为ISP,其上只能配置IP地址;R4与其它所有直连设备间使用公有IP
2、R3——R5/6/7为MGRE环境,R3为中心站点
3、整个OSPF环境IP地址为172.16.0.0/16
4、所有设备均可访问R4的环回
5、减少LSA的更新量,加快收敛,保证更新安全
6、全网可达
二、实验拓扑图

三、OSPF知识点介绍
- Open Shortest Path First,最短路径优先
(1)基本概念
- 标准的LS型协议---->共享拓扑
- 组播更新----->224.0.0.5/6
- 触发更新,存在周期更新---->30min
- 是跨层封装协议,协议号--->89
- 需要结构化部署----->1.区域划分 2.IP地址规划
- 链路状态型路由协议的距离矢量特征:在OSPF中,区域内传拓扑,区域间传路由
- 管理距离----->110
- 度量值------->使用cost值作为度量值,有计算公式
(2)OSPF的数据包
- hello---->用于发现、建立和保活(10s)邻居关系。存在全网唯一的Router-ID,表示路由器建立邻居关系所用的身份标识,使用IP地址的方式表示
- DbD---->Database Description,携带着链路状态的目录
- LSR---->链路状态请求
- LSU---->链路状态更新--携带了真正的LSA
- LSAck---->确认
LSA:链路状态通告,就是OSPF中不同拓扑或路由信息
LSDB:链路状态数据库,是所有LSA的集合
(3)OSPF状态机:
- down----->未开启OSPF协议。一旦启动协议并宣告之后,接口发出hello包,立即切换到下一状态
- Init----->初始化状态,若接收到的hello包中存在自己的router-id,则和对方一起进入下一状态
- 2-way----->此状态表明邻居关系建立完成
- 条件匹配----->关注网络类型,点到点网络类型直接将进入邻接关系的建立,MA网络类型需要DR/BDR的选举,选举时间40s
- Exstart----->预启动,双方使用类hello的DBD包,进行主从关系选举-比较RID,大者优先进入下一状态
- Exchange----->准交换,交互真正的DBD报文,需要使用ACK确认
- Loading----->加载,使用LSR/LSU/LSAck获取未知的LSA信息
- Full----->邻接关系建立完成
- 启动配置完成后,本地基于224.0.0.5组播收发hello包,建立邻居关系,生成邻居
- 再进行条件的匹配,匹配失败将停留于邻居关系,仅hello包周期保活即可
- 匹配成功者间可以建立邻接(毗邻)关系,需要DBD共享数据库目录,LSR/LSU/LSack来获取未知的LSA信息,当收集完网络中所有的LSA后,生成数据表--LSDB
- LSDB建立完成后,本地基于SPF选路规则,计算本地到达所有未知网段的最短路径,然后将其加载到路由表中;完成收敛
- 收敛完成后--hello包周期保活 -- 30min周期的DBD比对,若不一致将使用LSR/LSU/LSack重新获取
四、划分IP地址

五、配置
1.配置IP地址和环回
R1配置:
R1(config)#int lo 1
R1(config-if)#ip add 172.16.32.1 255.255.248.0
R1(config-if)#int f0/0
R1(config-if)#ip add 172.16.40.0 255.255.248.0
R1(config-if)#no shu
R2配置:
R2(config)#int lo 1
R2(config-if)#ip add 172.16.48.1 255.255.248.0
R2(config-if)#int f0/0
R2(config-if)#ip add 172.16.40.2 255.255.248.0
R2(config-if)#no shut
R3的配置:
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int s2/0
R3(config-if)#ip add 34.1.1.1 255.255.255.0
R3(config-if)#no shut
R4的配置:
R4(config)#int lo 1
R4(config-if)#ip add 4.4.4.4 255.255.255.0
R5的配置:
R5(config)#int s2/0
R5(config-if)#ip add 45.1.1.1 255.255.255.0
R5(config-if)#no shu
R5(config-if)#int lo 1
R5(config-if)#ip add 172.16.72.1
R6的配置:
R6(config)#int s2/0
R6(config-if)#ip add 46.1.1.1 255.255.255.0
R6(config-if)#int lo 1
R6(config-if)#ip add 172.16.80.1 255.255.248.0
R6(config-if)#no shu
R6(config-if)#int s2/2
R6(config-if)#ip add 172.16.96.1 255.255.248.0
R6(config-if)#no
R7的配置:
R7(config)#int s2/0
R7(config-if)#ip add 47.1.1.1 255.255.255.0
R7(config-if)#no shu
R7(config-if)#int lo 1
R7(config-if)#ip add 172.16.88.1 255.255.248.0
R7(config-if)#int s2/1
R7(config-if)#ip address 172.16.128.1 255.255.248.0
R7(config-if)#no shu
R8的配置:
R8(config)#int s2/0
R8(config-if)#ip add 172.16.136.1 255.255.248.0
R8(config-if)#no shut
R8(config-if)#int s2/1
R8(config-if)#ip add 172.16.144.1 255.255.248.0
R8(config-if)#no shut
R9的配置:
R9(config)#int s2/0
R9(config-if)#ip add 172.16.144.2 255.255.248.0
R9(config-if)#no shut
R9(config-if)#int s2/1
R9(config-if)#ip add 172.16.168.1 255.255.248.0
R9(config-if)#no shut
R9(config-if)#int lo 1
R9(config-if)#ip address 172.16.160.1 255.255.248.0
R10的配置:
R10(config)#int s2/0
R10(config-if)#ip add 172.16.168.2 255.255.248.0
R10(config-if)#no shu
R10(config-if)#int lo 1
R10(config-if)#ip add 172.16.176.1 255.255.248.0
R10(config-if)#end
R11的配置:
R11(config)#int s2/0
R11(config-if)#ip address 172.16.96.2 255.255.248.0
R11(config-if)#no shut
R11(config-if)#int lo 1
R11(config-if)#ip add 172.16.104.1 255.255.248.0
R11(config-if)#int s2/2
R11(config-if)#ip add 172.16.112.1 255.255.248.0
R11(config-if)#no shu
R12的配置:
R12(config)#int s2/0
R12(config-if)#ip add 172.16.112.2 255.255.248.0
R12(config-if)#no shut
R12(config-if)#int lo 1
R12(config-if)#ip add 172.16.192.1 255.255.240.0
R12(config-if)#int lo 2
R12(config-if)#ip address 172.16.208.1 255.255.240.0
2.中心站点设置
将R3设为中心站点
R3(config)#int tunnel 1
R3(config-if)#ip add 172.16.64.1 255.255.248.0
R3(config-if)#tunnel source 34.1.1.1
R3(config-if)#tunnel mode gre multipoint
R3(config-if)#ip nhrp map multicast dy
R3(config-if)#ip nhrp network-id 100
3.隧道技术
- 一种简单的VPN技术,普通的tunnel为点到点网络类型
- 原理:生成隧道接口,流量通过路由查询后,若通过隧道接口转发时,需要在原有的三层报头前,再添加一个共有地址间的报头
- 将两个仅可以通过WAN通讯的LAN,合成一个
- 注意:建立tunnel,还需要编辑路由表,来将流量引向隧道接口
配置
R5配置:
R5(config)#ip rou 0.0.0.0 0.0.0.0 45.1.1.2
R5(config)#int tunnel 1
R5(config-if)#ip add 172.16.64.2 255.255.248.0
R5(config-if)#tunnel source s2/0
R5(config-if)#tunnel mode gre multipoint
R5(config-if)#ip nhrp nhs 172.16.64.1
R5(config-if)#ip nhrp map 172.16.64.1 34.1.1.1
R5(config-if)#ip nhrp network-id 100
R6配置:
R6(config)#ip route 0.0.0.0 0.0.0.0 46.1.1.2
R6(config)#int tunnel 1
R6(config-if)#ip address 172.16.64.3 255.255.248.0
R6(config-if)#tunnel source s2/0
R6(config-if)#tunnel mode gre multipoint
R6(config-if)#ip nh nhs 172.16.64.1
R6(config-if)#ip nhrp map 172.16.64.1 34.1.1.1
R6(config-if)#ip nhrp network-id 100
R7配置:
R7(config)#ip route 0.0.0.0 0.0.0.0 47.1.1.2
R7(config)#int tunnel 1
R7(config-if)#ip add 172.16.64.4 255.255.248.0
R7(config-if)#tunnel source s2/0
R7(config-if)#tunnel mode gre multipoint
R7(config-if)#ip nhrp nhs 172.16.64.1
R7(config-if)#ip nh map 172.16.64.1 34.1.1.1
R7(config-if)#ip nhrp network-id 100
4.开启OSPF配置:
R1配置:
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 172.16.0.0 0.0.255.255 a 1
R2配置:
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net172.16.0.0 0.0.255.255 a 1
R3配置:
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 172.16.40.3 0.0.0.0 a 1
R3(config-router)#net 172.16.64.1 0.0.0.0 a 0
R3(config-router)#net 172.16.56.1 0.0.0.0 a 1
R5配置:
R5(config)#router ospf 1
R5(config-router)#router-id 5.5.5.5
R5(config-router)#net 172.16.0.0 0.0.255.255 a 0
R6配置:
R6(config)#router ospf 1
R6(config-router)#router-id 6.6.6.6
R6(config-router)#net 172.16.64.3 0.0.0.0 a 0
R6(config-router)#net 172.16.80.1 0.0.0.0 a 0
R6(config-router)#network 172.16.96.1 0.0.0.0 a 2
R7配置:
R7(config)#router ospf 1
R7(config-router)#router-id 7.7.7.7
R7(config-router)#net172.16.64.4 0.0.0.0 a 0
R7(config-router)#net 172.16.88.1 0.0.0.0 a 0
R7(config-router)#net 172.16.128.1 0.0.0.0 a 3
R8配置:
R8(config)#router ospf 1
R8(config-router)#router-id 8.8.8.8
R8(config-router)#network 172.16.0.0 0.0.255.255 a 3
R11配置:
R11(config)#router ospf 1
R11(config-router)#router-id 11.11.11.11
R11(config-router)#network 172.16.0.0 0.0.255.255 a 2
R12配置:
R12(config)#router ospf 1
R12(config-router)#router-id 12.12.12.12
R12(config-router)#network 172.16.112.2 0.0.0.0 a 2
R12(config-router)#exit
R12(config)#router eigrp 90
R12(config-router)#network 172.16.192.1 0.0.0.0
R12(config-router)#network 172.16.208.1 0.0.0.0
R12(config-router)#no auto-summary
5.开启伪广播
R5(config)#int tunnel 1
R5(config-if)#ip nhrp map multicast 34.1.1.1
R6(config)#int tunnel 1
R6(config-if)#ip nhrp map multicast 34.1.1.1
R7(config)#int tunnel 1
R7(config-if)#ip nhrp map multicast 34.1.1.1
6.点到点配置
- 点到点:仅适用于一个网段两个节点的网;
- 在MGRE环境下若适用tunnel口默认的工作方式,那么一个网段内若存在两个以上节点将出现邻居关系翻滚
配置:
R5配置:
R5(config)#int tunnel 1
R5(config-if)#ip ospf net point-to-multipoint
R6配置:
R6(config)#int tunnel 1
R6(config-if)#ip ospf net point-to-multipoint
R7配置:
R7(config)#int tunnel 1
R7(config-if)#ip ospf network point-to-multipoint
R3配置:
R3(config)#int tunnel 1
R3(config-if)#ip ospf network point-to-multipoint
7.宣告和重发布:
- 一台设备同时运行于两个协议或两个进程,默认从两端学习到的路由条目不共享;重发布技术就是人为的进行共享
- 规则:
将A协议发布到B协议时,在ASBR上的B协议中配置
将A协议发布到B协议时,将ASBR上所有通过A协议学习,及ASBR直连到A协议中的所有路由全部共享到B协议中
- 名词:
单点单向重发布
单点双向重发布
多点单向(双向)重发布
R9配置:
R9(config)#router ospf 1
R9(config-router)#router-id 9.9.9.9
R9(config-router)#network 172.16.144.2 0.0.0.0 a 3
R9(config)#router ospf 2
R9(config-router)#router-id 99.9.9.9
R9(config-router)#network 172.16.160.1 0.0.0.0 a 4
R9(config-router)#network 172.16.168.1 0.0.0.0 a 4
R9(config-router)#exit
R9(config)#router ospf 1
R9(config-router)#redistribute ospf 2 subnets
R9(config-router)#exit
R9(config)#router ospf 2
R9(config-router)#redistribute ospf 1 subnets
R12的配置:
R12(config)#router ospf 1
R12(config-router)#router-id 12.12.12.12
R12(config-router)#network 172.16.112.2 0.0.0.0 a 2
R12(config-router)#exit
R12(config)#router eigrp 90
R12(config-router)#network 172.16.192.1 0.0.0.0
R12(config-router)#network 172.16.208.1 0.0.0.0
R12(config-router)#no auto-summary
R12(config-router)#exit
R12(config)#router ospf 1
R12(config-router)#redistribute eigrp 90 subnets
R10的配置:
R10(config)#router ospf 1
R10(config-router)#router-id 10.10.10.10
R10(config-router)#network 172.16.0.0 0.0.255.255 a 4
8.NAT配置
R3配置:
R3(config)#int serial 2/0
R3(config-if)#ip nat outside
R3(config-if)#int f0/0
R3(config-if)#ip nat inside
R3(config)#access-list 1 permit 172.16.0.0 0.0.255.255
R3(config)#ip nat inside source list 1 interface serial 2/0
R5的配置:
R5(config)#access-list 1 permit 172.16.0.0 0.0.255.255
R5(config)#int s2/0
R5(config-if)#ip nat outside
R5(config-if)#exit
R5(config)#ip nat inside source list 1 interface s2/0
R6的配置:
R6(config)#int s2/0
R6(config-if)#ip nat outside
R6(config-if)#int s2/2
R6(config-if)#ip nat inside
R6(config-if)#exit
R6(config)#access-list 1 permit 172.16.0.0 0.0.255.255
R6(config)#ip nat inside source list 1 int s2/0
R7的配置:
R7(config)#access-list 1 permit 172.16.0.0 0.0.255.255
R7(config)#int s2/0
R7(config-if)#ip nat outside
R7(config-if)#int s2/1
R7(config-if)#ip nat inside
R7(config-if)#exit
R7(config)#ip nat inside source list 1 int s2/0
9.缺省路由:(专用命令)
R3的配置:
R3(config)#router ospf 1
R3(config-router)#default-information originate
R6(config)#router ospf 1
R6(config-router)#default-information originate
R7的配置:
R7(config)#router ospf 1
R7(config-router)#default-information originate
R9的配置:
R9(config)#router ospf 2
R9(config-router)#default-information originate
R9(config-router)#end
10.手工汇总
- 减少骨干区域LSA量
area 0上的汇总:
R3(config)#router ospf 1
R3(config-router)#area 1 range 172.16.32.0 255.255.224.0
area 2上的汇总:
R6(config)#router ospf 1
R6(config-router)#area 2 range 172.16.96.0 255.255.224.0
area 3上的汇总:
R7(config)#router ospf 1
R7(config-router)#area 3 range 172.16.128.0 255.255.224.0
域外汇总:
eigrp上的汇总
R12(config)#router ospf 1
R12(config-router)#summary-address 172.16.192.0 255.255.224.0
area 4上的汇总:
R9(config)#router ospf 1
R9(config-router)#summary-address 172.16.160.0 255.255.224.0
11.完全末梢
特殊区域:
该类在area 1 上:
R1(config)#router ospf 1
R1(config-router)#area 1 stub
- stub,末梢区域—拒绝4/5类的LSA,ABR自动产生3类缺省发向该区域
R2(config)#router ospf 1
R2(config-router)#area 1 stub
R3(config)#router ospf 1
R3(config-router)#area 1 stub
仅在ABR
完全末梢:
R3(config-router)#area 1 stub
R3(config-router)#area 1 stub no-summary
area2上:
R6(config-router)#area 2 nssa (该区域所有设备配置)
R6(config-router)#area 2 nssa no-summary
R11(config-router)#area 2 nssa
R12(config-router)#area 2 nssa
R3上:
R7(config-router)#area 3 nssa
R7(config-router)#area 3 nssa no-summary
R8(config-router)#area 3 nssa
R9(config-router)#area 3 nssa
*完全NSSA–在NSSA的基础上进一步拒绝3的LSA,自动产生3类缺省
先将该区域配置为NSSA,然后仅在ABR上定义完全即可
OSPF实验完成
CCNP之OSPF实验报告的更多相关文章
- CCNP之MERG实验报告
MGRE实验报告 一.实验要求: 1.R5为ISP,只能配置IP地址 2.R1--R3间建立MGRE环境,且使用EIGRP来学习各自环回 3.R4可以正常访问R5的环回 4.R1与R5进行chap认证 ...
- 第五次实验报告:使用Packet Tracer理解OSPF路由协议
目录 1 实验目的 2 实验内容 3. 实验报告 3.1 建立网络拓扑结构 4. 配置 4.1 配置并激活串行地址和以太网地址 4.1.1 R1 4.1.2 R2 4.1.3 R3 4.1.4 PC ...
- CCNP之静态路由实验报告
静态路由实验报告 一.实验要求: 1.内网IP基于172.16.0.0/16自行子网划分 2.除了R2--R4路由器各有两个环回接口 3.R1下的PC自动获取IP地址 4 ...
- 北京电子科技学院(BESTI)实验报告5
北京电子科技学院(BESTI)实验报告5 课程: 信息安全系统设计基础 班级:1452.1453 姓名:(按贡献大小排名) 郑凯杰.周恩德 学号:(按贡献大小排名) 20145314.20145217 ...
- 北京电子科技学院(BESTI)实验报告4
北京电子科技学院(BESTI)实验报告4 课程: 信息安全系统设计基础 班级:1452.1453 姓名:(按贡献大小排名)周恩德 .郑凯杰 学号:(按贡献大小排名)20145217 .201453 指 ...
- 20145215&20145307信息安全系统设计基础实验报告
20145215&20145307信息安全系统设计基础实验报告 PART1 一.实验原理 交叉编译,简单地说,就是在一个平台上生成另一个平台上的可执行代码.同一个体系结构可以运行不同的操作系统 ...
- 北京电子科技学院(BESTI)实验报告1
北京电子科技学院(BESTI)实验报告1 课程: 信息安全系统设计基础 班级:1452.1453 姓名:(按贡献大小排名)郑凯杰 .周恩德 学号:(按贡献大小排名)20145314 .20145217 ...
- 北京电子科技学院(BESTI)实验报告3
北京电子科技学院(BESTI)实验报告3 课程: 信息安全系统设计基础 班级:1452.1453 姓名:(按贡献大小排名)周恩德 .郑凯杰 学号:(按贡献大小排名)20145217 .201453 指 ...
- 20145205 《Java程序设计》实验报告五:Java网络编程及安全
20145205 <Java程序设计>实验报告五:Java网络编程及安全 实验要求 1.掌握Socket程序的编写: 2.掌握密码技术的使用: 3.客户端中输入明文,利用DES算法加密,D ...
随机推荐
- Vue—新版本router-view 与 keep-alive 的互动
1. <keep-alive> 直接嵌套到 <router-view> 上会失效,正确写法: <router-view #="{ Component }&quo ...
- 配置Nginx 扩展实现图片剪裁
在此之前需要安装ngx_http_image_filter_module,如果是采用的Docker的话可以看看我历史文章. 然后修改配置文件,增加几个location模块,配置如下,仅供参考 serv ...
- Java数组作业
1 //输入一组数(10个),找出最大值,并给出最大值的位置 2 package test; 3 4 public class test1_1 { 5 public static double max ...
- mq checkpoint文件
记录comitlog,consumeQueue,Index文件的刷盘时间点,文件固定长度4k,其中只用该文件的24个字节,其存储格式: 8字节physicMsgtimestamp+8字节logicsM ...
- od中低位地址和高位的顺序,以及数据的存放读写
在观察内存的时候应当注意"内存数据"与"数值数据"的区别. 在我们的调试环境中,内存由低到高分布,你可以简单地把这种情形理解成Win32系统在内存中由地位向高位 ...
- 对象不支持“assign”属性或方法
1. 报错信息 vue项目打包部署后,ie11报错内容如下: 看到报错信息肯定是语法兼容问题了,经测试 Edge 无此情况,部分ie9也有此类问题. 2. 尝试方法 安装 create-react-a ...
- PyQt+moviepy音视频剪辑实战1:多个音视频合成顺序播放或同屏播放的视频文件实现详解
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt+moviepy音视频剪辑实战 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 一. ...
- PyQt(Python+Qt)学习随笔:自定义信号在emit发射信号时报错:AttributeError: object has no attribute
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 如果使用自定义信号,一定要记得信号是类变量,必须在类中定义,不能在实例 ...
- [ACTF2020 新生赛]BackupFile && [ACTF2020 新生赛]Upload &&[GYCTF2020]Blacklist
[ACTF2020 新生赛]BackupFile 尝试找到源代码,加上题目是备份文件,猜测备份文件里面有网站的源代码,御剑扫描一下,就扫到index.php 访问index.php.bak 下载源代码 ...
- 函数与函数式编程(生成器 && 列表解析 && map函数 && filter函数)-(四)
在学习python的过程中,无意中看到了函数式编程.在了解的过程中,明白了函数与函数式的区别,函数式编程的几种方式. 函数定义:函数是逻辑结构化和过程化的一种编程方法. 过程定义:过程就是简单特殊没有 ...