1:基于192.168.1.0/24进行子网划分
192.168.1.16/28—R1环回
192.168.1.32/28—R2环回
192.168.1.48/28—R5环回
192.168.1.64/28
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26
以r1为例的基础配置
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.65 26
Apr 4 2024 22:07:57-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1]interface l0
[r1-LoopBack0]ip address 192.168.1.17 28
2.以r1为例创建OSPF区域Area 0 和 Area1 并将路由器的接口宣告在相对应的区域中
[r1]ospf 1 router-id 1.1.1.1
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.17 0.0.0.0
3.r1为dr,r2为bdr
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 2
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ospf dr-priority 0
4.r5不宣告ospf
[r5-ospf-1]silent-interface LoopBack 0