一、首先按照如图所示搭建拓扑图,并合理规划IP地址,并将IP地址配给每个接口
[R1]ospf 1 router-id 1.1.1.1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R2]ospf 1 router-id 2.2.2.2 [R1-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 2.2.2.1 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0
[R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]network 192.168.2.1 0.0.0.0
[Huawei]ospf 1 router-id 4.4.4.4 [Huawei-ospf-1]area 1 [Huawei-ospf-1-area-0.0.0.1]network 4.4.4.1 0.0.0.0 [Huawei-ospf-1-area-0.0.0.1]network 192.168.2.2 0.0.0.0
依次进行ospf协议便可以达成全网可达
二、R1-R3之间R1为DR 所以只要修改R1接口的优先级 [R1]int g 0/0/0 [R1-GigabitEthernet0/0/0]ospf dr-p [R1-GigabitEthernet0/0/0]ospf dr-priority 3
R3与R4之间R3为DR [R3]int g 0/0/1 [R3-GigabitEthernet0/0/1]ospf dr-p [R3-GigabitEthernet0/0/1]ospf dr-priority 3
|