一、实验拓扑图
二、实验要求
1.IP地址自行规划-172.16.0/16
2.每个路由器有自己的环回
3.R2-R5所在MA网络中,只有R2是DR,其他都是DROTHER
4、R3-R4之间明文认证,R4-R5之间密文认证
5、R3存在环回100,IP为100.1.1.1/24,不能宣告进OSPF
6、区域划分如图,区域编号使用0、1、2
7、全网可达
三、子网划分
172.16.0.0/16
172.16.0.0/24
172.16.0.0/25 -/30
172.16.0.0/30
172.16.0.4/30
172.16.0.8/30
172.16.0.128/25
环回
172.16.1.0/24
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
172.16.5.0/24
四、配置路由
R1的配置
1.IP地址的配置
[Huawei]sysname R1
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 172.16.1.1 24
[R1-LoopBack0]q
[R1]interface s3/0/0
[R1-Serial3/0/0]ip address 172.16.0.1 302.启用OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
R2的配置
1.IP地址的配置
[Huawei]sys
[Huawei]sysname R2
[R2]interface s4/0/0
[R2-Serial4/0/0]ip address 172.16.0.2 30
[R2-Serial4/0/0]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 172.16.2.1 24[R2-LoopBack0]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 172.16.0.129 252.启用OSPF
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 172.16.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]network 172.16.2.1 0.0.0.0[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.129 0.0.0.0
R3的配置
1.IP地址的配置
<Huawei>sys
[Huawei]sysname R3
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.16.3.1 24
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.0.130 25
[R3-GigabitEthernet0/0/0]interface s4/0/0
[R3-Serial4/0/0]ip address 172.16.0.5 302.启用OSPF
[R3-ospf-1]area 0
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1-area-0.0.0.0]network 172.16.0.130 0.0.0.0[R3-ospf-1]area 2
[R3-ospf-1-area-0.0.0.2]network 172.16.0.5 0.0.0.0[R3-ospf-1-area-0.0.0.2]network 172.16.3.1 0.0.0.0
3.R3中存在环回100,不能宣告进OSPF
[R3]interface LoopBack 100
[R3-LoopBack100]ip address 100.1.1.1 24
[R3-LoopBack100]ospf 1 router
[R3-LoopBack100]q
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]default-route-advertise always4.改变接口的优先级
[R3-GigabitEthernet0/0/0]ospf dr-priority 0
5.R3与R4进行明文认证
[R3]interfac s4/0/0
[R3-Serial4/0/0]ospf authentication-mode simple cipher huawei
R4的配置
1.IP地址的配置
<Huawei>sys
[Huawei]sysname R4
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 172.16.4.1 24
[R4-LoopBack0]interface s4/0/0
[R4-Serial4/0/0]ip address 172.16.0.6 30
[R4-Serial4/0/0]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.0.131 25
[R4-GigabitEthernet0/0/0]interface s4/0/1
[R4-Serial4/0/1]ip address 172.16.0.9 302.启用OSPF
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 172.16.0.131 0.0.0.0
[R4-ospf-1-area-0.0.0.0]q
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 172.16.0.6 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 172.16.0.9 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 172.16.4.1 0.0.0.04.改变接口的优先级
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
5.进行认证
[R4]interface s4/0/0
[R4-Serial4/0/0]ospf authentication-mode simple cipher huawei[R4]interface s4/0/1
[R4-Serial4/0/1]ospf authentication-mode md5 1 cipher huawei
R5的配置
1.IP地址的配置
[Huawei]sys
[Huawei]sysname R5
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip address 172.16.0.132 25
[R5-GigabitEthernet0/0/0]interface s4/0/0
[R5-Serial4/0/0]ip address 172.16.0.10 30
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 172.16.5.1 242.启用OSPF
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.132 0.0.0.0
[R5-ospf-1-area-0.0.0.0]q
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]network 172.16.0.10 0.0.0.0
[R5-ospf-1-area-0.0.0.2]network 172.16.5.1 0.0.0.04.改变接口的优先级
[R5-GigabitEthernet0/0/0]ospf dr-priority 0
5.进行密文认证
[R5]interface s4/0/0
[R5-Serial4/0/0]ospf authentication-mode md5 1 cipher huawei
2.地址配置完成测试连通性
3.查看R1否学完整
注意:ospf中默认学习环回中的掩码都是32位的
第五要求
第三项要求
通过修改接口的优先级
通过:[Rx-GigabitEthernet0/0/0]ospf dr-priority 0
1.未改前
2. 改完后
R3与R4,R5为邻居关系
与R2为邻接关系
测试全网连通性