目录
题目
分析
R3为DR设备,没有BDR,代表R3的优先级最高,没有次大的设备,就需要R1、R2的优先级为0
R4不能直接宣告环回,要使用缺省路由
创建拓扑以及IP网段划分
配置IP地址
R1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 27
[r1-GigabitEthernet0/0/0]
Jul 13 2022 15:22:00-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 27
Jul 13 2022 15:23:29-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.3 27
Jul 13 2022 15:24:42-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.129 27
Jul 13 2022 15:25:46-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.130 27
Jul 13 2022 15:26:31-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
配置环回接口
R1
[r1-GigabitEthernet0/0/0]int lo0
[r1-LoopBack0]ip add 192.168.1.33
R2
[r2-GigabitEthernet0/0/0]int lo0
[r2-LoopBack0]ip add 192.168.1.65 27
R3
[r3-GigabitEthernet0/0/1]int lo0
[r3-LoopBack0]ip add 192.168.1.97 27
R4
[r4-GigabitEthernet0/0/0]int lo0
[r4-LoopBack0]ip add 4.4.4.1 24
OSPF宣告
R1
[r1]ospf 1 router-id 192.168.1.33
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
R2
[r2]ospf 1 router-id 192.168.1.65
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0
R3
在R3里,接口0/0/0和环回属于区域0,接口0/0/1属于区域1
[r3]ospf 1 router-id 192.168.1.97
[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-0.0.0.0]network 192.168.1.97 0.0.0.0
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
R4
[r4]ospf 1 router-id 4.4.4.1
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0
对R4做缺省路由
R4
[r4]ospf 1
[r4-ospf-1]default-route-advertise always
干涉选举
因为R3为DR设备,所以优先级最高,用display ospf peer查看后发现优先级如下
修改R1 R2的优先级为0
R1
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
R2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
查看优先级
此时R3的优先级最高为DR,没有BDR
验证是否全网可达
经过验证全网可达