OSPF区域划分规则:
1、必须为星型结构----区域0为骨干,中心站点
2、ABR–区域边界路由器
OSPF 配置
r1(config)#router ospf 1 启动时需要配置进程号,仅具有本地意义
r1(config-router)#router-id 1.1.1.1 配置RID,要求为全网唯一;
r1(config-router)#network 1.1.1.1 0.0.0.0 area 0
r1(config-router)#network 12.1.1.0 0.0.0.255 area 0 (反掩码)
配置完成后可以查看邻居表
r2#show ip ospf neighbor
OSPF扩展配置
认证 ——直接在连接邻居的接口上配置
先开启认证服务
r1(config)#interface s1/1
r1(config-if)#ip ospf authentication message-digest
再配置认证的秘钥和模式、编号
r1(config-if)#ip ospf message-digest-key 1 md5 cisco123 密文认证
r1 (config-if)#ip ospf authentication-key 1 cisco 明文认证
区域的认证
Router(config)#router ospf 100
Router(config-router)#area 0 authentication 明文认证
Router(config)#router ospf 100
Router(config-router)#area 0 authentication message-digest 密文认证
加快收敛 ——在直连邻居的接口上修改,且邻居间time 必须完全一致,否则无法保持邻居关系
r1(config)#interface s1/1
r1(config-if)#ip ospf hello-interval 5 修改本端的hello time,本端的dead time自动4倍关系匹配;
被动接口 ——仅接收不发送路由协议信息,用于连接用户的接口,不得用于连接邻居的接口
r2(config)#router ospf 1
r2(config-router)#passive-interface loopback 0
缺省路由 ——在边界路由器上配置缺省信息后,向内网发送缺省路由
r4(config)#router ospf 1
r4(config-router)#default-information originate always