HCIA第十二天-OSPF实验

HCIA第十二天-OSPF实验

一、地址划分

骨干链路--3段+1段(需要4个地址)

环回地址需要5段

172.16.0.0/16

172.16.0.0/24

1段:172.16.0.0/25

3段:172.16.0.128/25

172.16.0.128/30 172.16.0.132/30 172.16.0.136/30

环回地址:172.16.1.0/24 172.16.2.0/24 172.16.3.0/24 172.16.5.0/24

R1地址

[R1]int [R1]interface loopback 0 [R1-LoopBack0]ip address 172.16.1.1 24 [R1-LoopBack0]q [R1]inter [R1]interface s4/0/0 [R1-Serial4/0/0]ip address 172.16.0.129 30 [R1-Serial4/0/0]

R2地址

[R2]int [R2]interface loopback 0 [R2-LoopBack0]ip address 172.16.2.1 24 [R2-LoopBack0]q [R2]int [R2]interface s4/0/0 [R2-Serial4/0/0]ip address 172.16.0.130 30 [R2-Serial4/0/0] Dec 8 2024 19:45:46-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP IPCP on the interface Serial4/0/0 has entered the UP state. [R2-Serial4/0/0]q [R2]int [R2]interface g0/0/0 [R2-GigabitEthernet0/0/0]ip address 172.16.0.1 25 Dec 8 2024 19:46:32-08:00 R2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R2-GigabitEthernet0/0/0]

R3地址

[R3]int [R3]interface loopback 0 [R3-LoopBack0]ip address 172.16.3.1 24 [R3-LoopBack0]q [R3]int [R3]interface g0/0/0 [R3-GigabitEthernet0/0/0]ip address 172.16.0.3 25 Dec 8 2024 19:50:14-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 [R3]interface s4/0/0 [R3-Serial4/0/0]ip address 172.16.0.133 30 [R3-Serial4/0/0]

R4地址

[R4]inter [R4]interface loop [R4]interface LoopBack 0 [R4-LoopBack0]ip address 172.16.4.1 24 [R4-LoopBack0]q [R4]int [R4]interface s4/0/0 [R4-Serial4/0/0]ip address 172.16.0.134 30 [R4-Serial4/0/0] Dec 8 2024 19:54:50-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial4/0/0 has entered the UP state. [R4-Serial4/0/0]q [R4]int [R4]interface s4/0/1 [R4-Serial4/0/1]ip address 172.16.0.137 30 [R4-Serial4/0/1]q [R4]inter [R4]interface g0/0/0 [R4-GigabitEthernet0/0/0]ip address 172.16.0.4 25 Dec 8 2024 19:56:23-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R4-GigabitEthernet0/0/0]

R5地址

[R5]int [R5]interface loopback 0 [R5-LoopBack0]ip address 172.16.5.1 24 [R5-LoopBack0]q [R5]interface s4/0/0 [R5-Serial4/0/0]ip address 172.16.0.138 30 [R5-Serial4/0/0] Dec 8 2024 20:01:20-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial4/0/0 has entered the UP state. [R5-Serial4/0/0]q [R5]int [R5]interface g0/0/0 [R5-GigabitEthernet0/0/0]ip address 172.16.0.5 25 [R5-GigabitEthernet0/0/0] Dec 8 2024 20:01:52-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R5-GigabitEthernet0/0/0]

测试连通性

[R2]ping 172.16.0.129 PING 172.16.0.129: 56 data bytes, press CTRL_C to break Reply from 172.16.0.129: bytes=56 Sequence=1 ttl=255 time=50 ms Reply from 172.16.0.129: bytes=56 Sequence=2 ttl=255 time=20 ms Reply from 172.16.0.129: bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 172.16.0.129: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 172.16.0.129: bytes=56 Sequence=5 ttl=255 time=20 ms ​ --- 172.16.0.129 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 20/30/50 ms ​ [R2]ping 172.16.0.3 PING 172.16.0.3: 56 data bytes, press CTRL_C to break Reply from 172.16.0.3: bytes=56 Sequence=1 ttl=255 time=80 ms Reply from 172.16.0.3: bytes=56 Sequence=2 ttl=255 time=40 ms Reply from 172.16.0.3: bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 172.16.0.3: bytes=56 Sequence=4 ttl=255 time=40 ms Reply from 172.16.0.3: bytes=56 Sequence=5 ttl=255 time=50 ms ​ --- 172.16.0.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/48/80 ms ​

证明可以直通

二、路由宣告

R1

[R1]ospf 1 router-id 1.1.1.1 [R1-ospf-1]area 1 [R1-ospf-1-area-0.0.0.1]net [R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255 [R1-ospf-1-area-0.0.0.1]

R2

[R2]os [R2]ospf 1rou [R2]ospf 1 [R2]ospf 1 rou [R2]ospf 1 router-id 2.2.2.2 [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]network 172.16.0.130 0.0.0.0 [R2-ospf-1-area-0.0.0.1] Dec 8 2024 20:27:34-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=129.0.16.172, Neigh borEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R2-ospf-1-area-0.0.0.1] Dec 8 2024 20:27:34-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=129.0.16.172, Neigh borEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) [R2-ospf-1-area-0.0.0.1] Dec 8 2024 20:27:34-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=129.0.16.172, Neigh borEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Ex change) [R2-ospf-1-area-0.0.0.1] Dec 8 2024 20:27:34-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=129.0.16.172, Neigh borEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Load ing) [R2-ospf-1-area-0.0.0.1] Dec 8 2024 20:27:34-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=129.0.16.172, Neigh borEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) ​ [R2-ospf-1-area-0.0.0.1]q [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]net [R2-ospf-1-area-0.0.0.1]network 172.16.2.1 0.0.0.0 [R2-ospf-1-area-0.0.0.1]q [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0 [R2-ospf-1-area-0.0.0.0]

R3

[R3]ospf 1rou [R3]ospf 1 rout [R3]ospf 1 router-id 3.3.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 172.16.0.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]q [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch ange) [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin g) [R3-ospf-1] Dec 8 2024 20:37:13-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R3-ospf-1]area 2 [R3-ospf-1-area-0.0.0.2]net [R3-ospf-1-area-0.0.0.2]network 172.16.3.1 0.0.0.0 [R3-ospf-1-area-0.0.0.2]net [R3-ospf-1-area-0.0.0.2]network 172.16.0.133 0.0.0.0 [R3-ospf-1-area-0.0.0.2]

R4

[R4]os [R4]ospf 1 rou [R4]ospf 1 router-id 4.4.4.4 [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]network 172.16.0.4 0.0.0.0 [R4-ospf-1-area-0.0.0.0]q [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch ange) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch ange) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin g) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighb orEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadi ng) [R4-ospf-1] Dec 8 2024 20:40:40-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[11]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighb orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R4-ospf-1]area 2 [R4-ospf-1-area-0.0.0.2]net [R4-ospf-1-area-0.0.0.2]network 172.16.2.1 0.0.0.0 [R4-ospf-1-area-0.0.0.2]net [R4-ospf-1-area-0.0.0.2]network 172.16.0.134 0.0.0.0 [R4-ospf-1-area-0.0.0.2] Dec 8 2024 20:41:44-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[12]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neig hborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) ​ [R4-ospf-1-area-0.0.0.2] Dec 8 2024 20:41:44-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[13]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neig hborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart ) [R4-ospf-1-area-0.0.0.2] Dec 8 2024 20:41:44-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[14]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neig hborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=E xchange) [R4-ospf-1-area-0.0.0.2] Dec 8 2024 20:41:44-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[15]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neig hborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loa ding) [R4-ospf-1-area-0.0.0.2] Dec 8 2024 20:41:44-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[16]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neig hborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R4-ospf-1-area-0.0.0.2]net [R4-ospf-1-area-0.0.0.2]network 172.16.0.137 0.0.0.0 [R4-ospf-1-area-0.0.0.2]

R5

[R5]os [R5]ospf 1 rou [R5]ospf 1 router-id 5.5.5.5 [R5-ospf-1]area 0 [R5-ospf-1-area-0.0.0.0]net [R5-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0 [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:25-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:25-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:26-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:26-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.16.172, Neighbo rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=2Way) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:29-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighbo rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch ange) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:30-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighb orEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exc hange) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:30-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[11]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighb orEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadi ng) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:30-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[12]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.16.172, Neighb orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:30-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[13]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighb orEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadi ng) [R5-ospf-1-area-0.0.0.0] Dec 8 2024 20:44:30-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[14]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.16.172, Neighb orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R5-ospf-1-area-0.0.0.0]q [R5-ospf-1]area 2 [R5-ospf-1-area-0.0.0.2]network 172.16.5.1 0.0.0.0 [R5-ospf-1-area-0.0.0.2]net [R5-ospf-1-area-0.0.0.2]network 172.16.0.138 0.0.0.0 [R5-ospf-1-area-0.0.0.2] Dec 8 2024 20:46:07-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[15]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neig hborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) ​ [R5-ospf-1-area-0.0.0.2] Dec 8 2024 20:46:07-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[16]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neig hborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart ) [R5-ospf-1-area-0.0.0.2] Dec 8 2024 20:46:07-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[17]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neig hborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=E xchange) [R5-ospf-1-area-0.0.0.2] Dec 8 2024 20:46:07-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[18]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neig hborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loa ding) [R5-ospf-1-area-0.0.0.2] Dec 8 2024 20:46:07-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[19]:Neighbor changes ev ent: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neig hborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) [R5-ospf-1-area-0.0.0.2]

查看路由

<R1>display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Public routing table : OSPF Destinations : 7 Routes : 7 ​ OSPF routing table status : <Active> Destinations : 7 Routes : 7 ​ Destination/Mask Proto Pre Cost Flags NextHop Interface ​ 172.16.0.0/25 OSPF 10 49 D 172.16.0.130 Serial4/0/0 172.16.0.132/30 OSPF 10 97 D 172.16.0.130 Serial4/0/0 172.16.0.136/30 OSPF 10 97 D 172.16.0.130 Serial4/0/0 172.16.2.1/32 OSPF 10 48 D 172.16.0.130 Serial4/0/0 172.16.3.1/32 OSPF 10 49 D 172.16.0.130 Serial4/0/0 172.16.4.1/32 OSPF 10 49 D 172.16.0.130 Serial4/0/0 172.16.5.1/32 OSPF 10 49 D 172.16.0.130 Serial4/0/0 ​ OSPF routing table status : <Inactive> Destinations : 0 Routes : 0 ​

测试连通性

<R1>ping 172.16.4.1 PING 172.16.4.1: 56 data bytes, press CTRL_C to break Reply from 172.16.4.1: bytes=56 Sequence=1 ttl=254 time=100 ms Reply from 172.16.4.1: bytes=56 Sequence=2 ttl=254 time=50 ms Reply from 172.16.4.1: bytes=56 Sequence=3 ttl=254 time=40 ms Reply from 172.16.4.1: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 172.16.4.1: bytes=56 Sequence=5 ttl=254 time=60 ms ​ --- 172.16.4.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/56/100 ms

三、查看MA网络

<R2>display ospf peer ​ OSPF Process 1 with Router ID 2.2.2.2 Neighbors ​ Area 0.0.0.0 interface 172.16.0.1(GigabitEthernet0/0/0)'s neighbors Router ID: 3.3.3.3 Address: 172.16.0.3 State: Full Mode:Nbr is Master Priority: 1 DR: 172.16.0.1 BDR: 172.16.0.3 MTU: 0 Dead timer due in 35 sec Retrans timer interval: 5 Neighbor is up for 00:22:30 Authentication Sequence: [ 0 ] ​ Router ID: 4.4.4.4 Address: 172.16.0.4 State: Full Mode:Nbr is Master Priority: 1 DR: 172.16.0.1 BDR: 172.16.0.3 MTU: 0 Dead timer due in 40 sec Retrans timer interval: 4 Neighbor is up for 00:19:03 Authentication Sequence: [ 0 ] ​ Router ID: 5.5.5.5 Address: 172.16.0.5 State: Full Mode:Nbr is Master Priority: 1 DR: 172.16.0.1 BDR: 172.16.0.3 MTU: 0 Dead timer due in 39 sec Retrans timer interval: 5 Neighbor is up for 00:15:14 Authentication Sequence: [ 0 ]

四、R3与R4明文,R4与R5密文

R3与R4

[R3]int [R3]interface s4/0/0 [R3-Serial4/0/0]ospf [R3-Serial4/0/0]ospf au [R3-Serial4/0/0]ospf authentication-mode si [R3-Serial4/0/0]ospf authentication-mode simple c [R3-Serial4/0/0]ospf authentication-mode simple cipher huawei [R3-Serial4/0/0] [R4-Serial4/0/0]os [R4-Serial4/0/0]ospf au [R4-Serial4/0/0]ospf authentication-mode si [R4-Serial4/0/0]ospf authentication-mode simple c [R4-Serial4/0/0]ospf authentication-mode simple cipher huawei [R4-Serial4/0/0] Dec 8 2024 21:09:36-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neigh borEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R4-Serial4/0/0] Dec 8 2024 21:09:36-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neigh borEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) [R4-Serial4/0/0] Dec 8 2024 21:09:36-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neigh borEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Ex change) [R4-Serial4/0/0] Dec 8 2024 21:09:36-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neigh borEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Load ing) [R4-Serial4/0/0] Dec 8 2024 21:09:36-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=133.0.16.172, Neigh borEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) ​ [R4-Serial4/0/0]

R4与R5

[R4]int [R4]interface s4/0/1 [R4-Serial4/0/1]os [R4-Serial4/0/1]ospf au [R4-Serial4/0/1]ospf authentication-mode m [R4-Serial4/0/1]ospf authentication-mode md5 1 huawei [R4-Serial4/0/1] [R5-Serial4/0/0]os [R5-Serial4/0/0]ospf au [R5-Serial4/0/0]ospf authentication-mode m [R5-Serial4/0/0]ospf authentication-mode md5 1 huawei [R5-Serial4/0/0] Dec 8 2024 21:17:11-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neigh borEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) [R5-Serial4/0/0] Dec 8 2024 21:17:16-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neigh borEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) [R5-Serial4/0/0] Dec 8 2024 21:17:16-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neigh borEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Ex change) [R5-Serial4/0/0] Dec 8 2024 21:17:16-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neigh borEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Load ing) [R5-Serial4/0/0] Dec 8 2024 21:17:16-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve nt: neighbor status changed. (ProcessId=256, NeighborAddress=137.0.16.172, Neigh borEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) ​ [R5-Serial4/0/0] 至此,试验结束

实验总结

熟练运用ospf相关知识