要求:
1.整个网络IP地址为192.168.1.0/24
2.area0区域手工设置R1为DR,R2为BDR
3.R1,R2,R5上配置环回接口,但是R5环回接口不能宣告进OSPF
4.全网可达
(1)IP划分
主干网络:192.168.1.0/29
192.168.1.8/30
192.168.1.12/30
环回网络:
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26
(2)配置密文
(3)配置环回
(4)R5配置缺省使全网可达
R1配置
[Huawei]interface l 0
[Huawei-LoopBack0]ip ad 192.168.1.65 26
[Huawei-LoopBack0]in g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip ad 192.168.1.1 29
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
R2配置
[Huawei]interface l 0
[Huawei-LoopBack0]ip ad 192.168.1.129 26
[Huawei-LoopBack0]in g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip ad 192.168.1.2 29
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.129 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0
R3配置
[Huawei-GigabitEthernet0/0/0]ip ad 192.168.1.3 29
[Huawei-GigabitEthernet0/0/1]ip ad 192.168.1.9 30
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.9 0.0.0.0
[Huawei-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
R4配置
[Huawei-GigabitEthernet0/0/0]ip ad 192.168.1.10 30
[Huawei-GigabitEthernet0/0/1]ip ad 192.168.1.13 30
[Huawei]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.13 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.10 0.0.0.0
[Huawei-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[Huawei-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
[Huawei-ospf-1]default-route-advertise
R5配置
[Huawei]interface l 0
[Huawei-LoopBack0]ip ad 192.168.1.193 26
[Huawei-LoopBack0]in g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip ad 192.168.1.14 30
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.14 0.0.0.0
[Huawei]ip route-static 0.0.0.0 0.0.0.0 NULL0
结果