OSFP配置命令

 

R2(config)#router ospf 1   //1为进程号,本地有效
R2(config-router)#network 0.0.0.0 255.255.255.255 area 0   //使接口启动ospf
R2(config-router)#router-id 1.1.1.1 //修改 ospf 唯一标示
R2(config-router)#passive-interface default   // 关闭所有接口发送ospf包
R2(config-router)#passive-interface fastEthernet 0/0   //关闭具体接口发送ospf包
R2(config-router)#no passive-interface fastEthernet 0/0
R2(config-router)#auto-cost reference-bandwidth 100 //默认为100 100 == 10的八次方
R2(config-if)#ip ospf cost 123 // 修改接口下cost,改为多少就是多少
R2(config-if)#ip ospf 1 area 0 //接口直接开启osfp
R2(config-if)#ip ospf hello-interval 10 //hello-timer 改为10秒
R2(config-if)#ip ospf dead-interval 40 //dead-timer 改为40秒
R2(config-if)#ip ospf dead-interval minimal hello-multiplier 20 //dead-timer为1s ,1s内发送20个hello包
R2(config-if)#ip ospf priority 255   //修改优先级 用于DR的选举
 
区域类型:
R2(config-router)#area 1 stub
R2(config-router)#area 1 nssa
R2(config-router)#area 1 stub no-summary // no-summary只需要在ABR上配置
R2(config-router)#area 1 nssa default-information-originate // 在ABR上手动向NSSA区域产生默认路由
 
virtual-link:
R2(config-router)#area 1 virtual-link 1.1.1.1 // 1 使穿越的区域,1.1.1.1 是对方的router-id
 
汇总:
区域汇总:
R2(config-router)#area 1 range 123.123.3.0 255.255.255.0 //把区域1 的 明细条目 汇总为 123.123.3.0 255.255.255.0 在ABR上做
外部汇总:
R2(config-router)#summary-address 123.123.0.0 255.255.0.0 //把外部的明细条目 汇总为123.123.0.0 255.255.0.0 在ASBR上做
 
认证:
认证类型 3 个
      tpye 0 null 
      tpye 1 简单密码认证 
      tpye 2 MD5         
 开启认证:
R2(config-router)#area 1 authentication //开启简单密码认证
R2(config-router)#area 1 authentication message-digest //开启md5密码认证
 or
R2(config-if)#ip os authentication //开启简单密码认证
R2(config-if)#ip os authentication message-digest //开启md5密码认证
 
 设置密码:
R2(config-if)#ip ospf authentication-key cisco //设置简单密码为"cisco"
R2(config-if)#ip ospf message-digest-key 1 md5 cisco //设置md5密码为"cisco"
 
virtual-link 链路上开启认证:
       area 1 virtual-link 2.2.2.2 authentication //简单密码认证开启
       area 1 virtual-link 2.2.2.2 authentication message-digest//md5认证开启
           或
       area 0 authentication //因为virtual-link参与了area 0,那么virtual-link就开启了简单密码认证
       area 0 authentication message-digest //因为virtual-link参与了area 0,那么virtual-link就开启了md5认证
virtual-link 密码设置:
       area 1 virtual-link 2.2.2.2 authentication-key cisco //简单密码认证的密码“cisco”
       area 1 virtual-link 2.2.2.2 message-digest-key 1 md5 cisco //md5认证的密码 “3”“ccnp”双方必须要都匹配
 
网络类型:
R2(config-if)#ip ospf network ?
 broadcast            Specify OSPF broadcast multi-access network
 non-broadcast        Specify OSPF NBMA network
 point-to-multipoint Specify OSPF point-to-multipoint network
 point-to-point       Specify OSPF point-to-point network
 
 
校验:
R2#show ip protocols
R2#show ip ospf
R2#show ip ospf interfact brief
R2#show ip ospf interfact s1/0
R2#show ip ospf neighbor
R2#show ip ospf database
R2#show ip ospf database ?
 asbr-summary      ASBR summary link states    // 4类
 external          External link states        // 5类
 network           Network link states                // 2类
 nssa-external     NSSA External link states        // 7类
 router            Router link states                // 1类
 summary           Network summary link states // 3类
R2#show ip route ospf
 
R2#debug ip ospf events   
R2#debug ip ospf adj
R2#debug ip ospf packet
 
 
 
 
ospf 建立邻居必要条件:
1.network   show ip ospf interface brief / show run / show ip protocol
2.areaID    show ip ospf interface brief 
3.area-type    show ip ospf / show run
4.routerID   show ip protocol / show ip ospf / show run
5.network-type(NBMA/P-MPNB 需要使用neighbor命令)   sh ip ospf interface f0/0
6.authentication   (type / data)    show ip ospf interface f0/0   / show run interface f0/0
7.subnet (broadcast / NBMA)   show ip ospf interface brief
8.ip mtu   show ip interface f0/0
9 hello
利用debug ip ospf event
 
 
ospf 邻居建立成功,但是路由条目收不完整
1.Hub-Spoke 的物理连接,hub端不是DR
2.area 部署不合理,   virtual-link解决

你可能感兴趣的:(配置命令,OSFP)