r1:
en
conf t
ho r1
no ip do lo
lin c 0
exec-t 0 0
logging syn
int s1/1
ip add 12.12.12.1 255.255.255.0
cl ra 64000
no shut
int lo1
ip add 1.1.1.1 255.255.255.0
exit
r2:
en
conf t
ho r2
no ip do lo
lin c 0
exec-t 0 0
logging syn
exit
int s1/0
ip add 12.12.12.2 255.255.255.0
no shut
cl ra 64000
int lo1
ip add 2.2.2.2 255.255.255.0
no shut
int s1/1
ip add 23.23.23.2 255.255.255.0
no shut
cl ra 64000
exit
 
r3:
en
conf t
ho r3
no ip do lo
lin c 0
exec-t 0 0
logging syn
exit
int s1/2
ip add 34.34.34.3 255.255.255.0
no shut
cl ra 64000
int lo1
ip add 3.3.3.3 255.255.255.0
no shut
int s1/0
ip add 23.23.23.3 255.255.255.0
no shut
cl ra 64000
exit
 
r4:
en
conf t
ho r4
no ip do lo
lin c 0
exec-t 0 0
logging syn
exit
int s1/2
ip add 34.34.34.4 255.255.255.0
no shut
cl ra 64000
int lo1
ip add 4.4.4.4 255.255.255.0
no shut
exit          // 通过sh ip int br   ping  两条命令检查直连网段的连通性

配置多区域ospf
r1--------r2---------r3---------r4
   area0    area0      aera1
r1:
conf t
router ospf 1
net 12.12.12.0 0.0.0.255 a 0
net 1.1.1.0 0.0.0.255 a 0
r2:
conf t
router ospf 2
net 12.12.12.0 0.0.0.255 a 0
net 2.2.2.0 0.0.0.255 a 0
net 23.23.23.0 0.0.0.255 a 0
r3
conf t
router ospf 3
net 23.23.23.0 0.0.0.255 a 0
net 3.3.3.0 0.0.0.255 a 1
net 34.34.34.0 0.0.0.255 a 1
r4
conf t
router ospf 4
net 34.34.34.0 0.0.0.255 a 1
net 4.4.4.0 0.0.0.255 a 1

做ospf 认证
1、明文认证
R1
int s1/1
ip ospf authentication-key zhao
exit
router ospf 1
area 0  authentication

R2
int s1/0
ip ospf authentication-key zhao
exit
router ospf 2
area 0  authentication         
注意做ospf认证分为两个步骤
1、在接口设置密码
2、在路由进程下 选择加密区域启用认证
这个时候要注意一点,一旦启用了认证,那么此区域内所有的路由器必须全部使用认证,但是在区域内密码可以不相同,但是两个相临接口之间的密码必须相同

2、密文认证
R3 
int s1/2
ip ospf
ip ospf message-digest-key 10 md5 yu
                            |      |
                            |       ——————————(密码)        
                            | ____________(密钥id)
router ospf 3
area 1 authentication message-digest 启用密文加密认证                  
 
R4 
int s1/2
ip ospf
ip ospf message-digest-key 10 md5 yu
exit
router ospf 4
area 1 authentication message-digest 启用密文加密认证 
 注意做ospf认证分为两个步骤
1、在接口设置密码
2、在路由进程下 选择加密区域启用认证
这个时候要注意一点,一旦启用了认证,那么此区域内所有的路由器必须全部使用认证,但是在区域内密码可以不相同,但是两个相临接口之间的密码必须相同
特别注意,做密文加密认证的时候 相临接口的密钥id和密码必须全部相同

可以一边做一边查看(debug ip ospf events)来查看效果
这样理解更深刻些 
好了就到这里,这就是我们ospf的两个拓展实验  ^_^