OSPF协议

 三、OSPF协议

 

OSPF(Open Shortest Path First)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)内决策路由。与RIP相对,OSPF是链路状态路有协议,而RIP是距离向量路由协议。

链路是路由器接口的另一种说法,因此OSPF也称为接口状态路由协议。OSPF通过路由器之间通告网络接口的状态来建立链路状态数据库,生成最短路径树,每个OSPF路由器使用这些最短路径构造路由表。 

1.有关命令 

全局设置

任务

命令

指定使用OSPF协议

router ospf process-id

指定与该路由器相连的网络

network address wildcard-mask area area-id

指定与该路由器相邻的节点地址

neighbor ip-address

  注:1、OSPF路由进程process-id必须指定范围在1-65535,多个OSPF进程可以在同一个路由器上配置,但最好不这样做。多个OSPF进程需要多个OSPF数据库的副本,必须运行多个最短路径算法的副本。process-id只在路由器内部起作用,不同路由器的process-id可以不同

         2、wildcard-mask 是子网掩码的反码, 网络区域IDarea-id在0-4294967295内的十进制数,也可以是带有IP地址格式的x.x.x.x。当网络区域ID为0或0.0.0.0时为主干域。不同网络区域的路由器通过主干域学习路由信息。

2.基本配置举例:


  Router1:

interface ethernet 0

 ip address 192.1.0.129 255.255.255.192

!

interface serial 0

 ip address 192.200.10.5 255.255.255.252

!

router ospf 100

 network 192.200.10.4 0.0.0.3 area 0

 network 192.1.0.128 0.0.0.63 area 1

!

Router2:

interface ethernet 0

 ip address 192.1.0.65 255.255.255.192

!

interface serial 0

 ip address 192.200.10.6 255.255.255.252

!

router ospf 200

 network 192.200.10.4 0.0.0.3 area 0

 network 192.1.0.64 0.0.0.63 area 2

!

Router3:

interface ethernet 0

 ip address 192.1.0.130 255.255.255.192

!

router ospf 300

 network 192.1.0.128 0.0.0.63 area 1

!

Router4:

interface ethernet 0

 ip address 192.1.0.66 255.255.255.192

!

router ospf 400

 network 192.1.0.64 0.0.0.63 area 1

!

相关调试命令

debug ip ospf events

debug ip ospf packet

show ip ospf

show ip ospf database

show ip ospf interface

show ip ospf neighbor

show ip route  

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值