1、拓扑图
方法:
1.配置接口IP
2.配置OSPF协议:
[R2]ospf 100
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.0]quit
2、R1配置
1 The device is running! 2 #################### 3 <Huawei> 4 Dec 11 2017 12:23:50-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt 5 hernet0/0/0 has turned into UP state. 6 <Huawei>sys 7 Enter system view, return user view with Ctrl+Z. 8 [Huawei]sysn R1 9 [R1]int 10 [R1]interface g0/0/0 11 [R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24 12 Dec 11 2017 12:26:33-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 13 on the interface GigabitEthernet0/0/0 has entered the UP state. 14 [R1-GigabitEthernet0/0/0]q 15 [R1] 16 [R1] 17 [R1] 18 [R1]osfp 100 19 ^ 20 Error: Unrecognized command found at '^' position. 21 [R1]os 22 [R1]ospf 100 23 [R1-ospf-100]are 24 [R1-ospf-100]area 0 25 [R1-ospf-100-area-0.0.0.0]net 26 [R1-ospf-100-area-0.0.0.0]network 12.1.1.0 0.0.0.255 27 [R1-ospf-100-area-0.0.0.0]q 28 [R1-ospf-100]q 29 [R1] 30 Dec 11 2017 12:31:20-08:00 R1 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve 31 nt: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.12, Neighbo 32 rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 33 [R1] 34 Dec 11 2017 12:31:24-08:00 R1 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve 35 nt: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.12, Neighbo 36 rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) 37 [R1] 38 Dec 11 2017 12:31:24-08:00 R1 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve 39 nt: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.12, Neighbo 40 rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch 41 ange) 42 [R1] 43 Dec 11 2017 12:31:24-08:00 R1 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve 44 nt: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.12, Neighbo 45 rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin 46 g) 47 [R1] 48 Dec 11 2017 12:31:24-08:00 R1 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes eve 49 nt: neighbor status changed. (ProcessId=25600, NeighborAddress=2.1.1.12, Neighbo 50 rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 51 [R1] 52 53 Please check whether system data has been changed, and save data in time 54 55 Configuration console time out, please press any key to log on