OSPF命令_学习笔记

OSPF命令笔记

  1. 基本配置:
// 区域认证
R1(config-if)#ip ospf message-digest-key Key-ID md5 {password}
或启动接口认证 {
	R1(config-if)#ip ospf authentication message-digest
	R1(config-if)#ip ospf message-digest-key Key-ID md5 {password}
}
R1(config)#router ospf process-ID
R1(config-router)#network IP地址 0.0.0.0 area Area-ID
// 区域认证
R1(config-router)#area Area-ID authentication message-digest

// 虚电路配置
ABR1(config-router)#area Area-ID virtual-link ABR2-RID
ABR2(config-router)#area Area-ID virtual-link ABR1-RID

// 末节区域配置:末节区域的每个路由都要配置,若定义Totally类型只需在ABR上添加no-summary
Rx(config-router)#area Area-ID stub {no-summary}
// NSSAs区域配置:与末节区域同理
Rx(config-router)#area Area-ID NSSA default-information-originate

// ABR上的手动汇总
ABR(config-router)#are Area-ID range IP 地址 掩码
// ASBR上的手动汇总
ASBR(config-router)#summary-address {IP 地址 掩码|网段 mask}
  1. 其他类型
// 清除OSPF进程:只有清除OSPF进程后,自定义的RID才会生效
R1#clear ip ospf x process
Reset OSPF process x? [no]: yes

// 定义OSPF的优先级:之后清除OSPF进程,用于重新选举DR/BDR
R1(config-if)#ip ospf priority x

// 修改发送Hello包时间和失效时间间隔
R1(config-if)#ip ospf hello-interval {time}
R1(config-if)#ip ospf dead-interval {time}
  1. 读懂show命令
1.show ip protocols:

Routing Protocol is "ospf 2"    	//主要看到这里的OSPF进程号
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 12.12.12.2			//这里查看RID
  It is an area border router
  Number of areas in this router is 2. 2 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:			//这里看到发hello包的接口,以及区域
    12.12.12.2 0.0.0.0 area 0
    23.23.23.2 0.0.0.0 area 1
  Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    34.34.34.3           110      00:01:00
    46.46.46.6           110      00:01:00
    46.46.46.4           110      00:01:00
  Distance: (default is 110)

2.show ip ospf neighbor:

Neighbor ID Pri   State   Dead Time    Address       Interface
46.46.46.4   0     FULL/        -       46.46.46.4      OSPF_VL1
12.12.12.1   1    FULL/DR  00:00:32   12.12.12.1   FastEthernet0/0
46.46.46.6   1   FULL/BDR  00:00:36   26.26.26.6   FastEthernet2/0
34.34.34.3   1   FULL/BDR  00:00:36   23.23.23.3   FastEthernet1/0
34.34.34.3   1   FULL/BDR  00:00:36   23.23.23.3   FastEthernet1/0
// State 可以看到建立邻居的状态Full和角色DR/BDR

3.show ip ospf database router:

OSPF Router with ID (12.12.12.2) (Process ID 2)		//这里可以看到RID和进程ID
Router Link States (Area 0)	//这里看到区域
LS age: 368
Options: (No TOS-capability, DC)
LS Type: Router Links					//这里看到LSA的类型
Link State ID: 12.12.12.1
Advertising Router: 12.12.12.1
LS Seq Number: 80000004
Checksum: 0xEDAD
Length: 36
Number of Links: 1
  Link connected to: a Transit Network
    (Link ID) Designated Router address: 12.12.12.1
    (Link Data) Router Interface address: 12.12.12.1
     Number of TOS metrics: 0
      TOS 0 Metrics: 1			//这里可以看到Metric值
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值