問題描述:

一.分別配地址
具體請參考(網路基礎五,里面有詳細的IP地址劃分),劃分后的效果圖

第二.配置IP地址和環回介面
AR1
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.1 29
Sep 13 2021 23:17:35-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip add 192.168.1.33 28
AR2
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.2 29
Sep 13 2021 23:18:32-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip add 192.168.1.65 28
AR3
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.3 29
Sep 13 2021 23:19:35-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.10 29
Sep 13 2021 23:24:34-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[13]:The line protoco
l IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip add 192.168.1.97 28
AR4
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.9 29
[Huawei-GigabitEthernet0/0/0]
Sep 13 2021 23:20:30-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip add 4.4.4.1 24
第三步.配置OSPF
AR1
[Huawei]ospf 1 ro
[Huawei]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.1 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.33 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]
AR2
[Huawei]ospf 1 ro
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.2 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.65 0.0.0.0
AR3
[Huawei]ospf 1 ro
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]
[Huawei-ospf-1-area-0.0.0.1]net
[Huawei-ospf-1-area-0.0.0.1]network 192.168.1.97 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]
/下面是區域2
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]net
[Huawei-ospf-1-area-0.0.0.2]network 192.168.1.10 0.0.0.0
AR4
[Huawei]ospf 1 ro
[Huawei]ospf 1 router-id 4.4.4.4
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]net
[Huawei-ospf-1-area-0.0.0.2]network 192.168.1.9 0.0.0.0
配置完成幾臺路由器后都有OSPF的通信流程,效果如下
Sep 13 2021 23:22:35-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes
event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.168.192, Ne
ighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init
)
[Huawei-ospf-1-area-0.0.0.1]
Sep 13 2021 23:22:39-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes
event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.168.192, Ne
ighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExSta
rt)
[Huawei-ospf-1-area-0.0.0.1]
Sep 13 2021 23:22:39-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes
event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.168.192, Ne
ighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState
=Exchange)
[Huawei-ospf-1-area-0.0.0.1]
Sep 13 2021 23:22:39-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes
event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.168.192, Ne
ighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=L
oading)
因為讓AR3作為DR,而沒有DBR,所以將除AR3之外的路由器都修改優先級,加一行代碼如下:
[Huawei-GigabitEthernet0/0/0]ospf dr-priority 0
三.配置預設路由
因為AR4的環回沒有宣告,但要求實作全網可達,所以給邊界路由器AR4配置預設路由
[Huawei-ospf-1]default-route-advertise
四.手工認證(安全性)
手工認證是相對應的,缺一不可,若只在一個介面配置,則另一方接受不到資訊,出錯
AR1
[Huawei-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
AR3
[Huawei-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
上面配置的是與AR3的0/0/0介面對應的,AR3 0/0/1介面同樣方法配置即可
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/300177.html
標籤:其他
