OSPF LSA的详解

LSA类型的配置与查看

1基本配置
R1(config)#NO IP DO LO
R1(config)#NO ENAble PAssword
R1(config)#LINe COnsole 0
R1(config-line)#LOGGing SYnchronous
R1(config-line)#EXEC-Timeout 0 0
R1(config-line)#LOGIn

R2(config)#NO IP DO LO
R2(config)#NO ENAble PAssword
R2(config)#LINe COnsole 0
R2(config-line)#LOGGing syn
R2(config-line)#exec-timeout 0 0
R2(config-line)#login

R3(config)#NO IP DO LO
R3(config)#line con 0
R3(config-line)#logging syn
R3(config-line)#exec-time 0 0
R3(config-line)#login

SW(config)#no ip do lo

R1#wr //保存
R2#wr
R3#wr

一、——类型1
配置连线
R1(config)#inter s1/0
R1(config-if)#ip address 192.1.12.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter lo 1
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)#inter s1/1
R1(config-if)#ip add 192.1.13.1 255.255.255.0
R1(config-if)#n shu

R2(config)#inter s1/0
R2(config-if)#ip add 192.1.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter lo 1
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf network point-to-point

R3(config)#inter s1/1
R3(config-if)#ip add 192.1.13.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter lo 1
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-point

3、可以查看下接口
R1#show ip inter brief
R2#show run inter s1/0(排错使用)

4、启用OSPF协议
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.1.12.0 0.0.0.255 a 0
R1(config-router)#network 192.1.13.0 0.0.0.255 a 0
R1(config-router)#network 1.1.1.0 0.0.0.255 a 0

R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.1.12.0 0.0.0.255 a 0
R2(config-router)#network 2.2.2.0 0.0.0.255 a 0

R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.1.13.0 0.0.0.255 a 0
R3(config-router)#network 3.3.3.0 0.0.0.255 a 0

5、查看邻居
R3#show ip ospf neighbor  (会显示1.1.1.1的邻居)

6、测试连通
R1#ping 2.2.2.2
R1#ping 3.3.3.3

7查看路由连接类型
R1#show ip ospf database ?
  adv-router        Advertising Router link states
  asbr-summary      ASBR summary link states
  database-summary  Summary of database
  external          External link states
  network           Network link states
  nssa-external     NSSA External link states
  opaque-area       Opaque Area link states
  opaque-as         Opaque AS link states
  opaque-link       Opaque Link-Local link states
  router            Router link states
  self-originate    Self-originated link states
  summary           Network summary link states
  |                 Output modifiers

R1#show ip ospf database router

查看路由
R1#SHOW IP ROUte

R2#show ip ospf database(他们之间的数据是一样的)

二、——查看NETWORKLSA

配置交换机连线
R1(config)#INTER FA0/0
R1(config-if)#IP ADD 192.168.1.1 255.255.255.0
R1(config-if)#NO SHUT

R2(config)#inter fa0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#no shut

R3(config)#inter fa0/0
R3(config-if)#ip add 192.168.1.3 255.255.255.0
R3(config-if)#no shut

其中会提示不匹配,这时可以配置为100兆
R3(config-if)#speed 100
R3(config-if)#duplex full (改为全双工)

R1(config-if)#speed 100
R1(config-if)#duplex full

R2(config-if)#speed 100
R2(config-if)#duplex full

查看广播地址
R1#show ip inter brief
测试连通
R1#ping 192.168.1.2
R1#ping 192.168.1.3

宣告在一个网络中(宣告的同时会进行BDR选择)
R3(config-if)#router ospf 100
R3(config-router)#network 192.168.1.0 0.0.0.255 a 0

R1(config)#router ospf 100
R1(config-router)#network 192.168.1.0 0.0.0.255 a 0

R2(config-if)#router ospf 100
R2(config-router)#network 192.168.1.0 0.0.0.255 a 0

查看他们之间的状态
R1#   show ip ospf neighbor

R1#show ip ospf interface fa0/0

查看类型
R1#show ip ospf database network


三、——查看类型三

配置
R2(config)#inter lo 1
R2(config-if)#inter lo 11
R2(config-if)#ip add 20.20.20.1 255.255.255.0
R2(config-if)#ip ospf network point-to-p(类型为点到点)
宣告到区域1中
R2(config-router)#network 20.20.20.0 0.0.0.255 a 1

R3(config-router)#inter lo 11
R3(config-if)#ip add 30.30.30.1 255.255.255.0
R3(config-if)#ip ospf network point-to-p
R3(config-if)#router ospf 100
R3(config-router)#network 30.30.30.0 0.0.0.255 a 2

配置好后就形成了多区域
查看数据库
R1#show ip ospf database(此时有三个类型)
单独查看——比如查看类型三
R1#show ip ospf database summary
此时路由表中就有OIA(区域1和2的)
R1#show ip route

测试PING一下
R1#ping 20.20.20.1
R1#ping 30.30.30.1

四、——查看类型4(要产生类型4首先需要其他的类型协议涉及进来)
R1(config)#inter lo 2
R1(config-if)#ip add 10.10.10.1 255.255.255.0
R1(config-if)#ip ospf network point-to-p

使用一条重分发命令,重分发直连的路由
R1(config-router)#redistribute connected subnets

查看数据库(此时已经存在类型5)
R1#show ip ospf database
R1#show ip ospf database external(查看类型5详细信息)

查看ASBR及类型4
只有在区域1或2中查看
R2#show ip ospf database
R2#show ip ospf database asbr-summary(查看详细)

查看路由表
R2#show ip route(此时可以看到会有OE2这条外部陆游)

R2#ping 10.10.10.1

查看R3的路由表(同样存在OE2)
R3#show ip rou
R3#ping 10.10.10.1

转载于:https://www.cnblogs.com/ywj2013/p/3299317.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OSPF(Open Shortest Path First)协议使用LSA(Link State Advertisement)来传递路由信息和拓扑信息。了解LSA的内容和功能对于理解OSPF协议的路由形成非常重要。一条LSA包含三个要素:ADV Router(产生者路由器)、link-ID(链路标识符)和LSA类型。\[1\] 在OSPF中,每个路由器接口被宣告进入OSPF进程时,都会产生一条一类LSA。除了ABR(Area Border Router)连接多个区域,它会向多个区域传递一类LSA。\[2\] LSA的更新顺序是根据以下几个因素来确定的: 1. Seq(序列号)越大表示越新。 2. 如果Seq相同,则比较Checksum(校验和),Checksum越大表示越新。 3. 如果Checksum相同,则判断LSA age(年龄),age为3600秒表示最新(用于删除此LSA)。 4. 如果LSA age都不为3600秒,则判断LSA age的差值。差值大于900秒,较小的LSA为最新。差值小于等于900秒,LSA的新旧相同,不需要交换。\[3\] 综上所述,LSAOSPF协议中扮演着重要的角色,通过LSA的传递,路由器可以了解到网络的拓扑信息,并根据这些信息进行路由计算和路径选择。 #### 引用[.reference_title] - *1* [OSPF中常见的六种LSA详解](https://blog.csdn.net/qq_50929489/article/details/126121937)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [OSPF LSA详解](https://blog.csdn.net/weixin_56601690/article/details/117084378)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [OSPF-LSA详解](https://blog.csdn.net/weixin_52644459/article/details/127102791)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值