认证
1.链路认证 //防止链路接入非法路由器(无授权),链路所有设备
1)明文认证 //不安全
邻居间直接进行认证,hello包中的认证参数在开启认证后为1 ,不开启则为0
r1(config)#int s1/1
r1(config-if)#ip ospf authentication
r1(config-if)# ip ospf authentication-key cisco
开启明文认证
2)md5认证 //安全
通过数据(data)+随机值构成MD5值,再加上数据、认证值以及随机数传递给对方,对方通过随机猜测得出密码
r2(config)#int s1/1
r2(config-if)#ip ospf authentication message-digest 接口下开启密文认证
r2(config-if)#ip ospf authentication-key 1 md5 cisco 密文密钥
2.区域认证 //防止区域内接入非法路由器(无授权),区域所有设备都开启
在路由器所有属于该区域接口发出的hello包中开启认证参数
1)明文认证
r11(config)#router ospf 1
r11(config-router)#area 1 authentication 开启区域明文个人\\\
r11(config)# int e0/0
r11(config-if)# ip ospf authentication-key