要求:
首先进行IP规划192.168.1.0/24
根据区域的不同分为0区域与1区域:192.168.1.0/25 192.168.1.128/25
0区域根据网段的不同分成五个网段: R1的环回: 192.168.1.0/28
R2的环回: 192.168.1.16/28
R123的0/0/0接口:192.168.1.32/28
vlan2 :192.168.1.48/28
vlan3:192.168.1.64/28
1区域R3——R4:192.168.1.128 30
在R1上进行配置
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad
[R1-GigabitEthernet0/0/0]ip address 192.168.1.33 28[R1-GigabitEthernet0/0/0]q
[R1]int
[R1]interface l
[R1]interface LoopBack 0
[R1-LoopBack0]ip ad
[R1-LoopBack0]ip address 192.168.1.0 28
[R1]ospf 1 r
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.15
[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]
R2
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip ad
[R2-GigabitEthernet0/0/0]ip address 192.168.1.34 28
Jul 13 2023 14:11:23-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]ip address 192.168.1.34 28
Error: The address already exists.
[R2-GigabitEthernet0/0/0]q
[R2]int
[R2]interface lo
[R2]interface LoopBack 0
[R2-LoopBack0]ip ad
[R2-LoopBack0]ip address 192.168.1.17 28
[R2-LoopBack0]q
[R2]Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R2>
<R2>
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]o
[R2]oam-mgr
[R2]observe-port
[R2]observe-server
[R2]ospf 1 r
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net
[R2-ospf-1-area-0.0.0.0]network 192.168.1.16 0.0.0.15
[R2-ospf-1-area-0.0.0.0]network 192.168.1.34 0.0.0.0
[R2-ospf-1-area-0.0.0.0]
R3
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad
[R3-GigabitEthernet0/0/0]ip address 192.168.1.35 28
Jul 13 2023 14:13:27-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]q
[R3]int g0/0/2.1
[R3-GigabitEthernet0/0/2.1]ip ad
[R3-GigabitEthernet0/0/2.1]ip address 192.168.1.49 28
[R3-GigabitEthernet0/0/2.1]do
[R3-GigabitEthernet0/0/2.1]dot1q termination vi
[R3-GigabitEthernet0/0/2.1]dot1q termination vid 2
Jul 13 2023 14:17:30-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2.1 has entered the UP state.
[R3-GigabitEthernet0/0/2.1]arp broadcast enable
[R3-GigabitEthernet0/0/2.1]int g0/0/2.2
[R3-GigabitEthernet0/0/2.2]ip ad
[R3-GigabitEthernet0/0/2.2]ip address 192.168.1.65 28
[R3-GigabitEthernet0/0/2.2]dot1q termination vid 3
Jul 13 2023 14:18:42-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2.2 has entered the UP state.
[R3-GigabitEthernet0/0/2.2]arp broadcast enable
[R3-GigabitEthernet0/0/2.2]int g0/0/1
[R3-GigabitEthernet0/0/1]ip ad
[R3-GigabitEthernet0/0/1]ip address 192.168.1.129 30
[R3-GigabitEthernet0/0/1]
Jul 13 2023 14:19:27-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]q[R3]os
[R3]ospf 1 r
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]ne
[R3-ospf-1-area-0.0.0.0]network 192.168.1.35 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.49 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[R3-ospf-1-area-0.0.0.0]q[R3-ospf-1]a
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]net
[R3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
[R3-ospf-1-area-0.0.0.1]
R4
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad
[R4-GigabitEthernet0/0/0]ip address 192.168.1.130 30
Jul 13 2023 14:20:58-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]q
[R4]interface l
[R4]interface LoopBack 0
[R4-LoopBack0]ip ad
[R4-LoopBack0]ip address 4.4.4.1 24
[R4-LoopBack0]Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R4>
[R4]os
[R4]ospf 1 r
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]net
[R4-ospf-1]ar
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]ne
[R4-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0
[R4-ospf-1-area-0.0.0.1]
R1-R3 R3为DR设备,没有BDR
[R1-GigabitEthernet0/0/0]ospf dr-priority 0
Jul 13 2023 14:59:43-08:00 R1 %%01OSPF/3/NBR_CHG_DOWN(l)[0]:Neighbor event:neigh
bor state changed to Down. (ProcessId=256, NeighborAddress=2.2.2.2, NeighborEven
t=KillNbr, NeighborPreviousState=Full, NeighborCurrentState=Down)
[R1-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]ospf dr-priority 0
Jul 13 2023 15:00:32-08:00 R2 %%01OSPF/3/NBR_CHG_DOWN(l)[0]:Neighbor event:neigh
bor state changed to Down. (ProcessId=256, NeighborAddress=1.1.1.1, NeighborEven
t=KillNbr, NeighborPreviousState=Full, NeighborCurrentState=Down)
[R2-GigabitEthernet0/0/0]
R4环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目
[R4-ospf-1]default-route-advertise always
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]os
[R3-GigabitEthernet0/0/1]ospf au
[R3-GigabitEthernet0/0/1]ospf authentication-mode md
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 c
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
[R3-GigabitEthernet0/0/1]
[R4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456[R3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
[R3]ip route-static 192.168.1.0 25 NULL 0