CCNP-5 OSPF试验1(BSCI)

简介:

CCNP-5 OSPF试验1

试验拓扑:

试验要求:模拟在广播环境下, OSPF 的配置与调试。
试验目的:掌握 OSPF 的基本配置,并且能够分析得到 OSPF 在广播环境下邻居发现过程, DR/BDR 选举过程,定时器的时间间隔。

实验配置:
R1
R1(config)#int f0/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int loop0
R1(config-if)#ip add  1.1.1 .1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#router-id  1.1.1 .1
R1(config-router)#network 199.99.1.0  0.0.0 .255 a 0
 
R2
R2(config)#int f0/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip add  2.2.2 .2 255.255.255.0
R2(config-if)#ip ospf network point-to-point
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id  2.2.2 .2 
R2(config-router)#network 199.99.1.0  0.0.0 .255 a 0
 
R3
R3(config)#int f0/0
R3(config-if)#ip add 199.99.1.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int loop0
R3(config-if)#ip add  3.3.3 .3 255.255.255.0
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#router-id  3.3.3 .3
R3(config-router)#network 199.99.1.0  0.0.0 .255 area 0
配置完成后,使用 show ip ospf interface 命令查看端口类型:
R1#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 199.99.1.1/24, Area 0
  Process ID 100, Router ID  1.1.1 .1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID)  3.3.3 .3, Interface address 199.99.1.3
  Backup Designated router (ID)  2.2.2 .2, Interface address 199.99.1.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:01
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor  2.2.2 .2  (Backup Designated Router)
    Adjacent with neighbor  3.3.3 .3  (Designated Router)
  Suppress hello for 0 neighbor(s)
 
R2#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 199.99.1.2/24, Area 0
  Process ID 100, Router ID  2.2.2 .2, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID)  3.3.3 .3, Interface address 199.99.1.3
  Backup Designated router (ID)  2.2.2 .2, Interface address 199.99.1.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:06
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor  1.1.1 .1
    Adjacent with neighbor  3.3.3 .3  (Designated Router)
  Suppress hello for 0 neighbor(s)
 
R3#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 199.99.1.3/24, Area 0
  Process ID 100, Router ID  3.3.3 .3, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec,  State DR , Priority 1
  Designated Router (ID)  3.3.3 .3, Interface address 199.99.1.3
  Backup Designated router (ID)  2.2.2 .2, Interface address 199.99.1.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:07
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor  1.1.1 .1
    Adjacent with neighbor  2.2.2 .2  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
不仅可以看到网络类型是 BROADCAST ,还可以知道端口属于哪个 AREA ROUTER ID 是多少,优先级都是默认值 1DR,BDR 是谁, HELLO/DEAD/WAIT 计时器为多少等等。
 
使用 show ip ospf neiighbore 命令查看 OSPF 邻居表:
R1#show ip ospf neighbor 
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2 .2             FULL/BDR        00:00:32    199.99.1.2      FastEthernet0/0
3.3.3 .3           1   FULL/DR         00:00:36    199.99.1.3      FastEthernet0/0
 
R2#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1 .1           1   FULL/DROTHER    00:00:32    199.99.1.1      FastEthernet0/0
3.3.3 .3           1   FULL/DR         00:00:35    199.99.1.3      FastEthernet0/0
 
R3#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1 .1           1   FULL/DROTHER    00:00:36    199.99.1.1      FastEthernet0/0
2.2.2 .2           1   FULL/BDR        00:00:35    199.99.1.2      FastEthernet0/0
 
通过上面的输出可以知道 R3 DR R2 BDR R1 DROther ,这是因为 R3 router-id 最大, R2 的次之, R1 最小。再使用 show ip ospf database 查看都有哪些 LSA 类型:
R1#show ip ospf database
 
            OSPF Router with ID ( 1.1.1 .1) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1 .1          1.1.1 .1         353         0x80000002 0x00AF1E 1
2.2.2 .2          2.2.2 .2         354         0x80000002 0x007153 1
3.3.3 .3          3.3.3 .3         354         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3       3.3.3 .3         354         0x80000001 0x 00736F
 
R2#show ip ospf database
 
            OSPF Router with ID ( 2.2.2 .2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1 .1          1.1.1 .1         371         0x80000002 0x00AF1E 1
2.2.2 .2          2.2.2 .2         370         0x80000002 0x007153 1
3.3.3 .3          3.3.3 .3         371         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3       3.3.3 .3         371         0x80000001 0x 00736F
 
R3#show ip ospf database
 
            OSPF Router with ID ( 3.3.3 .3) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1 .1          1.1.1 .1         379         0x80000002 0x00AF1E 1
2.2.2 .2          2.2.2 .2         379         0x80000002 0x007153 1
3.3.3 .3          3.3.3 .3         378         0x80000002 0x003388 1
 
                Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
199.99.1.3       3.3.3 .3         378         0x80000001 0x 00736F
可以看到只有 1 类和 2 LSA
然后我们抓取一下 R1 debug 信息看看:
R1#debug ip ospf adj
OSPF adjacency events debugging is on
R1#
R1#clear ip ospf p
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1#
*Mar  1 00:13:57.483: OSPF: Interface FastEthernet0/0 going Down
*Mar  1 00:13:57.483: OSPF:  1.1.1 .1 address 199.99.1.1 on FastEthernet0/0 is dead, state DOWN
*Mar  1 00:13:57.483: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:13:57.483: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:13:57.487: OSPF: Elect BDR  2.2.2 .2
*Mar  1 00:13:57.487: OSPF: Elect DR  3.3.3 .3
*Mar  1 00:13:57.487:        DR:  3.3.3 .3 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:13:57.487: OSPF:  2.2.2 .2 address 199.99.1.2 on FastEthernet0/0 is dead, state DOWN
*Mar  1 00:13:57.487: %OSPF-5-ADJCHG: Process 100, Nbr  2.2.2 .2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar  1 00:13:57.491: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:13:57.491: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:13:57.491: OSPF: Elect BDR  0.0.0 .0
*Mar  1 00:13:57.491: OSPF: Elect DR  3.3.3 .3
*Mar  1 00:13:57.495:        DR:  3.3.3 .3 (Id)   BDR: none
*Mar  1 00:13:57.495: OSPF:  3.3.3 .3 address 199.99.1.3 on FastEthernet0/0 is dead, state DOWN
*Mar  1 00:13:57.495: %OSPF-5-ADJCHG: Process 100, Nbr  3.3.3 .3 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar  1 00:13:57.499: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:13:57.499: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:13:57.499: OSPF: Elect BDR  0.0.0 .0
*Mar  1 00:13:57.499: OSPF: Elect DR  0.0.0 .0
*Mar  1 00:13:57.499:        DR: none    BDR: none
*Mar  1 00:13:57.503: OSPF: Remember old DR  3.3.3 .3 (id)
*Mar  1 00:13:57.587: OSPF: Interface FastEthernet0/0 going Up
*Mar  1 00:13:57.639: OSPF: 2 Way Communication to  2.2.2 .2 on FastEthernet0/0, state 2WAY  \\R2 建立邻居关系,形成 2 Way
*Mar  1 00:13:57.639: OSPF: Backup seen Event before WAIT timer on FastEthernet0/0
*Mar  1 00:13:57.639: OSPF: DR/BDR election on FastEthernet0/0  \\R2比较,选取DR/BDR
*Mar  1 00:13:57.643: OSPF: Elect BDR  2.2.2 .2
*Mar  1 00:13:57.643: OSPF: Elect DR  2.2.2 .2
*Mar  1 00:13:57.643:        DR:  2.2.2 .2 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:13:57.643: OSPF: Send DBD to  2.2.2 .2 on FastEthernet0/0 seq 0x1522 opt 0x52 flag 0x7 len 32  \\ 发送数据库描述报文
*Mar  1 00:13:57.663: OSPF: 2 Way Communication to  3.3.3 .3 on FastEthernet0/0, state 2WAY \\R3 建立邻居关系,形成 2 Way
*Mar  1 00:13:57.663: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:13:57.663: OSPF: DR/BDR election on FastEthernet0/0 \\R2R3比较,选取DR/BDR
*Mar  1 00:13:57.667: OSPF: Elect BDR  2.2.2 .2
*Mar  1 00:13:57.667: OSPF: Elect DR  3.3.3 .3
*Mar  1 00:13:57.667:        DR:  3.3.3 .3 (Id)   BDR: 2.2.2.2 (Id)  \\DR R3,BDR R2
*Mar  1 00:13:57.667: OSPF: Send DBD to  3.3.3 .3 on FastEthernet0/0 seq 0x18AD opt 0x52 flag 0x7 len 32  \\ 发送数据库描述报文给 DR
*Mar  1 00:13:57.671: OSPF: Remember old DR  2.2.2 .2 (id)
*Mar  1 00:13:57.671: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:13:57.671: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:13:57.671: OSPF: Elect BDR  2.2.2 .2
*Mar  1 00:13:57.671: OSPF: Elect DR  3.3.3 .3
*Mar  1 00:13:57.675:        DR:  3.3.3 .3 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:13:57.711: OSPF: Rcv DBD from  2.2.2 .2 on FastEthernet0/0 seq 0x11D0 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART  \\收到R2 的数据库描述报文,转到 EXSTART 状态
*Mar  1 00:13:57.711: OSPF: NBR Negotiation Done. We are the SLAVE  \\MASTER/SLAVE 的选取,在此为 R2 MASTER R1 SLAVE
*Mar  1 00:13:57.715: OSPF: Send DBD to  2.2.2 .2 on FastEthernet0/0 seq 0x11D0 opt 0x52 flag 0x0 len 32
*Mar  1 00:13:57.759: OSPF: Rcv DBD from  3.3.3 .3 on FastEthernet0/0 seq 0x 78A  opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART \\收到R3 的数据库描述报文,转到 EXSTART 状态
*Mar  1 00:13:57.763: OSPF: NBR Negotiation Done. We are the SLAVE  \\MASTER/SLAVE 的选取,在此为 R3 MASTER R1 SLAVE
*Mar  1 00:13:57.763: OSPF: Send DBD to  3.3.3 .3 on FastEthernet0/0 seq 0x 78A  opt 0x52 flag 0x0 len 32
*Mar  1 00:13:57.767: OSPF: Rcv DBD from  2.2.2 .2 on FastEthernet0/0 seq 0x11D1 opt 0x52 flag 0x3 len 92  mtu 1500 state EXCHANGE  \\ 交换 DBD 报文,状态转为 EXCHANGE
*Mar  1 00:13:57.771: OSPF: Send DBD to  2.2.2 .2 on FastEthernet0/0 seq 0x11D1 opt 0x52 flag 0x0 len 32
*Mar  1 00:13:57.879: OSPF: Rcv DBD from  2.2.2 .2 on FastEthernet0/0 seq 0x11D2 opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Mar  1 00:13:57.879: OSPF: Exchange Done with  2.2.2 .2 on FastEthernet0/0
*Mar  1 00:13:57.883: OSPF: Send LS REQ to  2.2.2 .2 length 36 LSA count 3  \\ 发送 LSR
*Mar  1 00:13:57.883: OSPF: Send DBD to  2.2.2 .2 on FastEthernet0/0 seq 0x11D2 opt 0x52 flag 0x0 len 32
*Mar  1 00:13:57.955: OSPF: Rcv DBD from  3.3.3 .3 on FastEthernet0/0 seq 0x78B opt 0x52 flag 0x3 len 92  mtu 1500 state EXCHANGE  \\ 交换 DBD 报文,状态转为 EXCHANGE
*Mar  1 00:13:57.955: OSPF: Send DBD to  3.3.3 .3 on FastEthernet0/0 seq 0x78B opt 0x52 flag 0x0 len 32
*Mar  1 00:13:57.987: OSPF: Reset old DR on FastEthernet0/0
*Mar  1 00:13:57.987: OSPF: Build router LSA for area 0, router ID  1.1.1 .1, seq 0x80000001
*Mar  1 00:13:57.995: OSPF: Rcv LS UPD from  2.2.2 .2 on FastEthernet0/0 length 136 LSA count 3  \\ 收到 LSU
*Mar  1 00:13:57.995: OSPF: Synchronized with  2.2.2 .2 on FastEthernet0/0, state FULL   *Mar  1 00:13:57.999: %OSPF-5-ADJCHG: Process 100, Nbr  2.2.2 .2 on FastEthernet0/0 from LOADING to FULL, Loading Done \\R2 成为 FULL 状态。
*Mar  1 00:13:57.999: OSPF: Rcv DBD from  3.3.3 .3 on FastEthernet0/0 seq 0x 78C  opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Mar  1 00:13:57.999: OSPF: Exchange Done with  3.3.3 .3 on FastEthernet0/0
*Mar  1 00:13:58.003: OSPF: Synchronized with  3.3.3 .3 on FastEthernet0/0, state FULL *Mar  1 00:13:58.003: %OSPF-5-ADJCHG: Process 100, Nbr  3.3.3 .3 on FastEthernet0/0 from LOADING to FULL, Loading Done \\R3 成为 FULL 状态。
*Mar  1 00:13:58.003: OSPF: Send DBD to  3.3.3 .3 on FastEthernet0/0 seq 0x 78C  opt 0x52 flag 0x0 len 32
*Mar  1 00:13:58.083: OSPF: Rcv LS UPD from  3.3.3 .3 on FastEthernet0/0 length 60 LSA count 1
*Mar  1 00:14:02.583: OSPF: Rcv LS UPD from  2.2.2 .2 on FastEthernet0/0 length 64 LSA count 1
*Mar  1 00:14:02.783: OSPF: Rcv LS UPD from  3.3.3 .3 on FastEthernet0/0 length 64 LSA count 1
*Mar  1 00:14:02.855: OSPF: Rcv LS UPD from  2.2.2 .2 on FastEthernet0/0 length 64 LSA count 1
*Mar  1 00:14:02.859: OSPF: Rcv LS UPD from  3.3.3 .3 on FastEthernet0/0 length 64 LSA count 1
*Mar  1 00:14:03.135: OSPF: Rcv LS UPD from  3.3.3 .3 on FastEthernet0/0 length 64 LSA count 1
*Mar  1 00:14:03.499: OSPF: Build router LSA for area 0, router ID  1.1.1 .1, seq 0x80000003
*Mar  1 00:14:03.671: OSPF: Rcv LS UPD from  3.3.3 .3 on FastEthernet0/0 length 64 LSA count 1
红色标记 / 蓝色注释的部分比较重要,通过红色标记 / 蓝色注释的部分可以看到整个 OSPF 邻居建立和选取 DR/BDR 和交换 DBD 报文和 LSU/LSR/LSAck 报文,最终形成 FULL 状态的全部过程。

实验总结:通过这个简单的实验我们可以知道在广播环境下, OSPF 的邻居关系是自动建立的,并且需要有 DR/BDR 地选取,还可以看到几个特别计时器的设置, hello 间隔为 10 秒,死亡,等待时间为 hello 时间间隔的 4 40 秒。


















本文转自loveme2351CTO博客,原文链接:http://blog.51cto.com/loveme23/45808  ,如需转载请自行联系原作者

相关文章
|
数据采集 SQL 数据可视化
大数据可视化技巧:借助PowerBI提升数据故事讲述力
【4月更文挑战第8天】Power BI助力大数据可视化,支持多种数据源连接,如SQL Server、Excel,提供数据清洗与转换功能。通过选择合适图表类型、运用颜色和大小强化表达,创建交互式仪表板。讲述数据故事时,注重故事主线设计,利用叙事技巧引导观众,并添加文本说明。分享已完成报告,提升数据驱动决策能力。动手实践,体验Power BI的强大与易用。
495 0
|
缓存 负载均衡 网络安全
什么是proxy?优点是什么?
什么是proxy?优点是什么?
548 0
|
10月前
|
存储 运维 Kubernetes
正式开源,Doris Operator 支持高效 Kubernetes 容器化部署方案
飞轮科技推出了 Doris 的 Kubernetes Operator 开源项目(简称:Doris Operator),并捐赠给 Apache 基金会。该工具集成了原生 Kubernetes 资源的复杂管理能力,并融合了 Doris 组件间的分布式协同、用户集群形态的按需定制等经验,为用户提供了一个更简洁、高效、易用的容器化部署方案。
454 16
正式开源,Doris Operator 支持高效 Kubernetes 容器化部署方案
|
9月前
|
机器学习/深度学习 TensorFlow 算法框架/工具
RT-DETR改进策略【注意力机制篇】| 引入MobileNetv4中的Mobile MQA,轻量化注意力模块 提高模型效率
RT-DETR改进策略【注意力机制篇】| 引入MobileNetv4中的Mobile MQA,轻量化注意力模块 提高模型效率
248 2
|
10月前
|
SQL 存储 监控
obdiag:一款OceanBase 数据库诊断的利器
本次分享的主题是obdiag:一款 OceanBase 数据库诊断的利器,由蚂蚁集团 OceanBase 技术专家汤庆分享。主要分为四个部分: 1. OceanBase 概述 2. Obdiag 项目价值 3. Obdiag 设计与实现 4. Obdiag 未来规划
298 14
|
存储 人工智能 自然语言处理
高级 RAG 技术:提升生成式 AI 系统输出质量与性能鲁棒性【预检索、检索、检索后、生成优化等】
高级 RAG 技术:提升生成式 AI 系统输出质量与性能鲁棒性【预检索、检索、检索后、生成优化等】
高级 RAG 技术:提升生成式 AI 系统输出质量与性能鲁棒性【预检索、检索、检索后、生成优化等】
|
12月前
|
人工智能 自然语言处理 安全
关于claude怎么下载?这篇文章告诉你答案!
Claude 是 Anthropic 公司开发的一款大型语言模型,被誉为下一代 AI 助手 🤖。它拥有强大的文本处理能力,能够进行对话、写作、翻译、总结等多种任务 📝。
|
12月前
|
网络协议
深入解析:TCP四次挥手断开连接的全过程及必要性
在网络通信中,TCP(传输控制协议)以其可靠性和顺序保证而闻名。然而,TCP连接的建立和终止同样重要,它们确保了网络资源的有效管理和数据传输的完整性。本文将详细描述TCP连接的四次挥手过程,并探讨为何需要四次挥手来正确终止一个TCP连接。
379 2
|
存储 监控 物联网
|
数据采集 安全 数据处理
制造业、工程设计行业、创投行业的数据治理痛点与解决方案
关注监管政策动态:密切关注数据治理相关法律法规的发布和更新,及时调整企业数据治理策略,确保合规经营。
制造业、工程设计行业、创投行业的数据治理痛点与解决方案