华为OSPF 实验

 

华为OSPF 实验_第1张图片

 

 

-------配置AR1

system-view

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]

[Huawei]sysname r1

sysname r1

[r1]

[r1]int s2/0/0

int s2/0/0

[r1-Serial2/0/0]

[r1-Serial2/0/0]ip add 12.1.1.1 24     --设置端口IP12.1.1.1

ip add 12.1.1.1 24

[r1-Serial2/0/0]

[r1-Serial2/0/0]undo shutdown

undo shutdown

Info: Interface Serial2/0/0 is not shutdown.

[r1-Serial2/0/0]

[r1-Serial2/0/0]int loopback1      --设置环回口11.1.1.1.1

int loopback1

[r1-LoopBack1]

[r1-LoopBack1]ip add 11.1.1.1 24

ip add 11.1.1.1 24

[r1-LoopBack1]

[r1-LoopBack1]

[r1-LoopBack1]quit

quit

[r1]

[r1]ospf 1 router-id 11.1.1.1       --配置ospf 的进程号

ospf 1 router-id 11.1.1.1

[r1-ospf-1]

[r1-ospf-1]area 0         --进入区域0

area 0

[r1-ospf-1-area-0.0.0.0]

[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0     --宣告IP 12.1.1.1

network 12.1.1.1 0.0.0.0

[r1-ospf-1-area-0.0.0.0]

[r1-ospf-1-area-0.0.0.0]network 11.1.1.1 0.0.0.0    --宣告IP  11.1.1.1.1

network 11.1.1.1 0.0.0.0

[r1-ospf-1-area-0.0.0.0]

[r1-ospf-1-area-0.0.0.0]

[r1-ospf-1-area-0.0.0.0]quit

quit

[r1-ospf-1]

[r1-ospf-1]area 0

quit

[r1-ospf-1]

[r1-ospf-1]quit

Quit

 

-----------------------------配置 AR2------------------------------

system-view

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]

[Huawei]sysname r2

sysname r2

[r2]

[r2]int s2/0/0                          --设置端口IP 12.1.1.1

int s2/0/0

[r2-Serial2/0/0]

[r2-Serial2/0/0]ip add 12.1.1.2 24

ip add 12.1.1.2 24

[r2-Serial2/0/0]

Dec 16 2019 19:03:51-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial2/0/0 has entered the UP state.

[r2-Serial2/0/0]

[r2-Serial2/0/0]undo shutdown

undo shutdown

Info: Interface Serial2/0/0 is not shutdown.

[r2-Serial2/0/0]

[r2-Serial2/0/0]quit

quit

[r2]

[r2]int s2/0/1                           --定义另一个端口IP地址23.1.1.1

int s2/0/1

[r2-Serial2/0/1]

[r2-Serial2/0/1]ip add 23.1.1.2 24

ip add 23.1.1.2 24

[r2-Serial2/0/1]

[r2-Serial2/0/1]undo shutdown

undo shutdown

Info: Interface Serial2/0/1 is not shutdown.

[r2-Serial2/0/1]

[r2-Serial2/0/1]quit

quit

[r2]

[r2]int loopback1

int loopback1

[r2-LoopBack1]

[r2-LoopBack1]ip add 22.1.1.1 24      ---设置环回口22.1.1.1  

ip add 22.1.1.1 24

[r2-LoopBack1]

[r2-LoopBack1]quit

quit

[r2]

[r2]ospf 1 router-id 22.1.1.1         --设置ospf 进程ID 22.1.1.1

ospf 1 router-id 22.1.1.1

[r2-ospf-1]

[r2-ospf-1]area 0

area 0

[r2-ospf-1-area-0.0.0.0]

[r2-ospf-1-area-0.0.0.0]network 22.1.1.1 0.0.0.0    --宣告精准IP 22.1.1.1

network 22.1.1.1 0.0.0.0

[r2-ospf-1-area-0.0.0.0]

[r2-ospf-1-area-0.0.0.0]network 12.1.1.2 0.0.0.0  --宣告IP 12.1.1.2

network  12.1.1.2 0.0.0.0

[r2-ospf-1-area-0.0.0.0]

[r2-ospf-1-area-0.0.0.0]

Dec 16 2019 19:49:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.1.12, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)

[r2-ospf-1-area-0.0.0.0]

Dec 16 2019 19:49:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.1.12, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)

[r2-ospf-1-area-0.0.0.0]

Dec 16 2019 19:49:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.1.12, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange)

[r2-ospf-1-area-0.0.0.0]

Dec 16 2019 19:49:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.1.12, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)

[r2-ospf-1-area-0.0.0.0]

Dec 16 2019 19:49:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.1.12, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)

[r2-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0     --宣告 23.1.1.2

network 23.1.1.2 0.0.0.0

[r2-ospf-1-area-0.0.0.0]

[r2-ospf-1-area-0.0.0.0]quit  

quit

[r2-ospf-1]

[r2-ospf-1]quit

quit

[r2]

[r2]

Dec 16 2019 19:51:19-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.1.1.23, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)

[r2]

Dec 16 2019 19:51:23-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.1.1.23, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)

[r2]

Dec 16 2019 19:51:23-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.1.1.23, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange)

[r2]

Dec 16 2019 19:51:23-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.1.1.23, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)

[r2]

Dec 16 2019 19:51:23-08:00 r2 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.1.1.23, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)

[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

 

 

---------------------------------------------配置AR3-------------------------------

system-view

system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]

[Huawei]sysname r3

sysname r3

[r3]int s2/0/0            --定义s2/0/0  端口为23.1.1.3

int s2/0/0

[r3-Serial2/0/0]

[r3-Serial2/0/0]ip add 23.1.1.3 24

ip add 23.1.1.3 24

[r3-Serial2/0/0]

[r3-Serial2/0/0]int

Dec 16 2019 19:30:23-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP IPCP on the interface Serial2/0/0 has entered the UP state.

[r3-Serial2/0/0]

Dec 16 2019 19:30:25-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP IPCP on the interface Serial2/0/0 has entered the DOWN state.

[r3-Serial2/0/0]

Dec 16 2019 19:30:26-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP IPCP on the interface Serial2/0/0 has entered the UP state.

[r3-Serial2/0/0]

[r3-Serial2/0/0]

[r3-Serial2/0/0]

[r3-Serial2/0/0]

 

[r3-Serial2/0/0]

[r3-Serial2/0/0]undo shutdown

undo shutdown

Info: Interface Serial2/0/0 is not shutdown.

[r3]

[r3]int loopback1                      --定义环回口IP 33.1.1.1

int loopback1

[r3-LoopBack1]

[r3-LoopBack1]ip add 33.1.1.1 24

ip add 33.1.1.1 24

[r3-LoopBack1]

[r3-LoopBack1]quit

quit

[r3]

[r3]ospf 1  router-id 33.1.1.1        --设置ospf进程ID 33.1.1.1

ospf 1  router-id 33.1.1.1

[r3-ospf-1]

[r3-ospf-1]area 0

area 0

[r3-ospf-1-area-0.0.0.0]

[r3-ospf-1-area-0.0.0.0]network 33.1.1.1 0.0.0.0     --宣告IP 33.1.1.1

network 33.1.1.1 0.0.0.0

[r3-ospf-1-area-0.0.0.0]

[r3-ospf-1-area-0.0.0.0]network 23.1.1.3 0.0.0.0    --宣告IP 23.1.1.3

network 23.1.1.3 0.0.0.0

[r3-ospf-1-area-0.0.0.0]

[r3-ospf-1-area-0.0.0.0]

Dec 16 2019 19:51:25-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.1.23, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)

[r3-ospf-1-area-0.0.0.0]

Dec 16 2019 19:51:25-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.1.23, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)

[r3-ospf-1-area-0.0.0.0]

Dec 16 2019 19:51:25-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.1.23, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange)

[r3-ospf-1-area-0.0.0.0]

Dec 16 2019 19:51:25-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.1.23, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)

[r3-ospf-1-area-0.0.0.0]

Dec 16 2019 19:51:25-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.1.1.23, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)

[r3-ospf-1-area-0.0.0.0]quit

quit

[r3-ospf-1]

[r3-ospf-1]quit

quit

[r3]

[r3]display ip routing         --显示路由信息

display ip routing

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

         Destinations : 14       Routes : 14       

 

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

 

       11.1.1.1/32  OSPF    10   96          D   23.1.1.2        Serial2/0/0

       12.1.1.0/24  OSPF    10   96          D   23.1.1.2        Serial2/0/0

       22.1.1.1/32  OSPF    10   48          D   23.1.1.2        Serial2/0/0

       23.1.1.0/24  Direct  0    0           D   23.1.1.3        Serial2/0/0

       23.1.1.2/32  Direct  0    0           D   23.1.1.2        Serial2/0/0

       23.1.1.3/32  Direct  0    0           D   127.0.0.1       Serial2/0/0

     23.1.1.255/32  Direct  0    0           D   127.0.0.1       Serial2/0/0

       33.1.1.0/24  Direct  0    0           D   33.1.1.1        LoopBack1

       33.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack1

     33.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack1

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

 

[r3]

[r3]display ip routing protocol ospf          --显示ospf 拓扑

display ip routing protocol ospf

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Public routing table : OSPF

         Destinations : 3        Routes : 3        

 

OSPF routing table status :

         Destinations : 3        Routes : 3

 

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

 

       11.1.1.1/32  OSPF    10   96          D   23.1.1.2        Serial2/0/0

       12.1.1.0/24  OSPF    10   96          D   23.1.1.2        Serial2/0/0

       22.1.1.1/32  OSPF    10   48          D   23.1.1.2        Serial2/0/0

 

OSPF routing table status :

         Destinations : 0        Routes : 0

 

 

display ospf lsdb router 33.1.1.1       --查看ospf  lsdb表

display ospf lsdb router 33.1.1.1

 

         OSPF Process 1 with Router ID 33.1.1.1

                         Area: 0.0.0.0

                 Link State Database

 

 

  Type      : Router

  Ls id     : 33.1.1.1

  Adv rtr   : 33.1.1.1  

  Ls age    : 761

  Len       : 60

  Options   :  E  

  seq#      : 80000003

  chksum    : 0xe235

  Link count: 3          ---显示总共3条连接,ID号22.1.1.1,ID号23.1.1.0,ID号33.1.1.1.

   * Link ID: 22.1.1.1     --2个环回,1条连接

     Data   : 23.1.1.3     

     Link Type: P-2-P        

     Metric : 48

   * Link ID: 23.1.1.0     

     Data   : 255.255.255.0

     Link Type: StubNet      

     Metric : 48

     Priority : Low

   * Link ID: 33.1.1.1     

     Data   : 255.255.255.255

     Link Type: StubNet      

     Metric : 0

     Priority : Medium

 

ping -a 33.1.1.1  11.1.1.1    从r3的环回口ping r1的环回口能ping 通

ping -a 33.1.1.1  11.1.1.1

  PING 11.1.1.1: 56  data bytes, press CTRL_C to break

    Reply from 11.1.1.1: bytes=56 Sequence=1 ttl=254 time=80 ms

    Reply from 11.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms

    Reply from 11.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms

    Reply from 11.1.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms

    Reply from 11.1.1.1: bytes=56 Sequence=5 ttl=254 time=20 ms

 

  --- 11.1.1.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 20/34/80 ms

 

 

  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的ospf 路由拓扑

display ip routing protocol ospf

display ip routing protocol ospf

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Public routing table : OSPF

         Destinations : 2        Routes : 2        

 

OSPF routing table status :

         Destinations : 2        Routes : 2

 

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

 

       11.1.1.1/32  OSPF    10   48          D   12.1.1.1        Serial2/0/0

       33.1.1.1/32  OSPF    10   48          D   23.1.1.3        Serial2/0/1

 

OSPF routing table status :

         Destinations : 0        Routes : 0

 

display ospf brief      --查看r2  ospf 设备

display ospf brief

 

         OSPF Process 1 with Router ID 22.1.1.1

                 OSPF Protocol Information

 

 RouterID: 22.1.1.1         Border Router:

 Multi-VPN-Instance is not enabled

 Global DS-TE Mode: Non-Standard IETF Mode

 Graceful-restart capability: disabled

 Helper support capability  : not configured

 Applications Supported: MPLS Traffic-Engineering

 Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms

 Default ASE parameters: Metric: 1 Tag: 1 Type: 2

 Route Preference: 10

 ASE Route Preference: 150

 SPF Computation Count: 7     

 RFC 1583 Compatible

 Retransmission limitation is disabled

 Area Count: 1   Nssa Area Count: 0

 ExChange/Loading Neighbors: 0

 Process total up interface count: 3

 Process valid up interface count: 2

 

 Area: 0.0.0.0          (MPLS TE not enabled)

 Authtype: None   Area flag: Normal

 SPF scheduled Count: 7     

 ExChange/Loading Neighbors: 0

 Router ID conflict state: Normal

 Area interface up count: 3

 

 Interface: 12.1.1.2 (Serial2/0/0) --> 12.1.1.1

 Cost: 48      State: P-2-P     Type: P2P       MTU: 1500  

 Timers: Hello 10 , Dead 40 , Poll  120 , Retransmit 5 , Transmit Delay 1

 

 Interface: 23.1.1.2 (Serial2/0/1) --> 23.1.1.3

 Cost: 48      State: P-2-P     Type: P2P       MTU: 1500  

  ---- More ----

 Timers: Hello 10 , Dead 40 , Poll  120 , Retransmit 5 , Transmit Delay 1

 

 Interface: 22.1.1.1 (LoopBack1)

 Cost: 0       State: P-2-P     Type: P2P       MTU: 1500  

  ---- More ----

 Timers: Hello 10 , Dead 40 , Poll  120 , Retransmit 5 , Transmit Delay 1

display ospf peer brief     --查看ospf邻居设备

display ospf peer brief

 

         OSPF Process 1 with Router ID 22.1.1.1

                  Peer Statistic Information

 ----------------------------------------------------------------------------

 Area Id          Interface                        Neighbor id      State    

 0.0.0.0          Serial2/0/0                      11.1.1.1         Full        

 0.0.0.0          Serial2/0/1                      33.1.1.1         Full        

 ----------------------------------------------------------------------------

display ospf lsdb router 22.1.1.1     --查看r2 ospf lsdb表的信息

display ospf lsdb router 22.1.1.1

 

         OSPF Process 1 with Router ID 22.1.1.1

                         Area: 0.0.0.0

                 Link State Database

 

 

  Type      : Router

  Ls id     : 22.1.1.1

  Adv rtr   : 22.1.1.1  

  Ls age    : 617

  Len       : 84

  Options   :  E  

  seq#      : 80000005

  chksum    : 0xe49d

  Link count: 5              --显示5条连接,3个环回口,2条连接

   * Link ID: 11.1.1.1     

     Data   : 12.1.1.2     

     Link Type: P-2-P        

     Metric : 48

   * Link ID: 12.1.1.0     

     Data   : 255.255.255.0

     Link Type: StubNet      

     Metric : 48

     Priority : Low

   * Link ID: 33.1.1.1     

     Data   : 23.1.1.2     

     Link Type: P-2-P        

     Metric : 48

   * Link ID: 23.1.1.0     

     Data   : 255.255.255.0               

  ---- More ----

     Link Type: StubNet                   

     Metric : 48                          

  ---- More ----

     Priority : Low                       

   * Link ID: 22.1.1.1                    

  ---- More ----

     Data   : 255.255.255.255             

     Link Type: StubNet                   

  ---- More ----

     Metric : 0                           

     Priority : Medium                    

 

 

 

你可能感兴趣的:(路由器,华为,交换机)