实验名称:华为OSPF配置演示(1)
实验拓扑:

实验设置:路由器R1 与R2之间配置192.168.12.0/24网段,R2与R3之间配置192.168.23.0/24网段,R3与R4之间配置192.168.34.0/24网段,R4与R5之间配置192.168.45.0/24网段,R1设置loopback10.10.1.1 /24,R2设置loopback10.10.2.2 /24,R3设置loopback10.10.3.3 /24,R4设置loopback10.10.4.4 /24,R5设置loopback10.10.5.5 /24
实验需求:R1,R2,R3,R4,R5之间可以相互ping通,ospf可以同步路由。
实验命令:
[R1]int gi0/0/0
[R1-GigabitEthernet0/0/0]undo shu
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]ip add 192.168.12.1 24
[R1-GigabitEthernet0/0/0]q
[R1]int l 0
[R1-LoopBack0]ip add 10.10.1.1 24
[R1-LoopBack0]q
[R1]ospf 10 router-id 1.1.1.1
[R1-ospf-10]area 12
[R1-ospf-10-area-0.0.0.12]network 192.168.12.0 0.0.0.255
[R1-ospf-10-area-0.0.0.12]network 10.10.1.0 0.0.0.255

[R1]display ospf 10 brief

 OSPF Process 10 with Router ID 1.1.1.1
     OSPF Protocol Information

RouterID: 1.1.1.1 Border Router:
Multi-×××-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: 8
RFC 1583 Compatible
Retransmission limitation is disabled
Area Count: 1 Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Process total up interface count: 2
Process valid up interface count: 1

Area: 0.0.0.12 (MPLS TE not enabled)
Authtype: None Area flag: Normal
SPF scheduled Count: 8
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 2

Interface: 192.168.12.1 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 192.168.12.1
Backup Designated Router: 192.168.12.2
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

Interface: 10.10.1.1 (LoopBack0)
Cost: 0 State: P-2-P Type: P2P MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
[R1]dis
[R1]display ospf 10 peer

 OSPF Process 10 with Router ID 1.1.1.1
     Neighbors 

Area 0.0.0.12 interface 192.168.12.1(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.12.2
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.12.1 BDR: 192.168.12.2 MTU: 0
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 00:06:34
Authentication Sequence: [ 0 ]

[R1]dis
[R1]display ospf 10 lsdb

 OSPF Process 10 with Router ID 1.1.1.1
     Link State Database 

             Area: 0.0.0.12

Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 361 48 80000005 1
Router 1.1.1.1 1.1.1.1 402 48 80000006 1
Network 192.168.12.1 1.1.1.1 402 32 80000002 0
Sum-Net 192.168.45.0 2.2.2.2 168 28 80000001 3
Sum-Net 192.168.23.0 2.2.2.2 347 28 80000001 1
Sum-Net 10.10.3.3 2.2.2.2 271 28 80000001 1
Sum-Net 192.168.34.0 2.2.2.2 286 28 80000001 2
Sum-Net 10.10.5.5 2.2.2.2 81 28 80000001 3
Sum-Net 10.10.4.4 2.2.2.2 153 28 80000001 2

[R1]ping 10.10.2.2
PING 10.10.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.2.2: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.10.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.10.2.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.10.2.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.10.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

--- 10.10.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/70 ms

[R1]ping 10.10.3.3
PING 10.10.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.10.3.3: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 10.10.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 10.10.3.3: bytes=56 Sequence=3 ttl=254 time=10 ms
Reply from 10.10.3.3: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.10.3.3: bytes=56 Sequence=5 ttl=254 time=20 ms

--- 10.10.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/22/30 ms

[R1]ping 10.10.4.4
PING 10.10.4.4: 56 data bytes, press CTRL_C to break
Reply from 10.10.4.4: bytes=56 Sequence=1 ttl=253 time=60 ms
Reply from 10.10.4.4: bytes=56 Sequence=2 ttl=253 time=40 ms
Reply from 10.10.4.4: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 10.10.4.4: bytes=56 Sequence=4 ttl=253 time=10 ms
Reply from 10.10.4.4: bytes=56 Sequence=5 ttl=253 time=30 ms

--- 10.10.4.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/36/60 ms

[R1]ping 10.10.5.5
PING 10.10.5.5: 56 data bytes, press CTRL_C to break
Reply from 10.10.5.5: bytes=56 Sequence=1 ttl=252 time=70 ms
Reply from 10.10.5.5: bytes=56 Sequence=2 ttl=252 time=30 ms
Reply from 10.10.5.5: bytes=56 Sequence=3 ttl=252 time=30 ms
Reply from 10.10.5.5: bytes=56 Sequence=4 ttl=252 time=40 ms
Reply from 10.10.5.5: bytes=56 Sequence=5 ttl=252 time=30 ms

--- 10.10.5.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/40/70 ms

[R1]ping 10.10.5.5
PING 10.10.5.5: 56 data bytes, press CTRL_C to break
Reply from 10.10.5.5: bytes=56 Sequence=1 ttl=252 time=60 ms
Reply from 10.10.5.5: bytes=56 Sequence=2 ttl=252 time=50 ms
Reply from 10.10.5.5: bytes=56 Sequence=3 ttl=252 time=30 ms
Reply from 10.10.5.5: bytes=56 Sequence=4 ttl=252 time=30 ms
Reply from 10.10.5.5: bytes=56 Sequence=5 ttl=252 time=40 ms

--- 10.10.5.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/60 ms

[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]undo shu
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]ip add 192.168.12.2 24
[R2-GigabitEthernet0/0/1]q
[R2]int l 0
[R2-LoopBack0]ip add 10.10.2.2 24
[R2-LoopBack0]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]undo shu
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]ip add 192.168.23.2 24
[R2-GigabitEthernet0/0/0]q
[R2]ospf 10 router-id 2.2.2.2
[R2-ospf-10]area 12
[R2-ospf-10-area-0.0.0.12]network 192.168.12.0 0.0.0.255
[R2-ospf-10-area-0.0.0.12]network 192.168.12.0 0.0.0.25
[R2-ospf-10-area-0.0.0.12]network 10.10.2.0 0.0.0.255
[R2-ospf-10-area-0.0.0.12]q
[R2-ospf-10]ospf 10 router-id 2.2.2.2
[R2-ospf-10]area 0
[R2-ospf-10-area-0.0.0.0]network 192.168.23.0 0.0.0.255

[R3]int gi0/0/1
[R3-GigabitEthernet0/0/1]undo shu
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R3-GigabitEthernet0/0/1]ip add 192.168.23.3 24
[R3-GigabitEthernet0/0/1]q
[R3]int l 0
[R3-LoopBack0]ip add 10.10.3.3 24
[R3-LoopBack0]q
[R3]int gi 0/0/0
[R3-GigabitEthernet0/0/0]undo shu
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]ip add 192.168.34.3 24
[R3-GigabitEthernet0/0/0]q
[R3]ospf 10 router-id 3.3.3.3
[R3-ospf-10]area 0
[R3-ospf-10-area-0.0.0.0]net
[R3-ospf-10-area-0.0.0.0]network 192.168.23.0 0.0.0.255
[R3-ospf-10-area-0.0.0.0]network 192.168.34.0 0.0.0.255
[R3-ospf-10-area-0.0.0.0]network 10.10.3.0 0.0.0.255
[R3-ospf-10-area-0.0.0.0]

[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]undo shu
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R4-GigabitEthernet0/0/1]ip add 192.168.34.4 24
[R4-GigabitEthernet0/0/1]q
[R4]int l 0
[R4-LoopBack0]ip add 10.10.4.4 24
[R4-LoopBack0]q
[R4]int gi0/0/0
[R4-GigabitEthernet0/0/0]undo shu
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R4-GigabitEthernet0/0/0]ip add 192.168.45.4 24
[R4-GigabitEthernet0/0/0]q
[R4]ospf 10 router-id 4.4.4.4
[R4-ospf-10]area 0
[R4-ospf-10-area-0.0.0.0]netw
[R4-ospf-10-area-0.0.0.0]network 192.168.34.0 0.0.0.255
[R4-ospf-10-area-0.0.0.0]q
[R4-ospf-10]q
[R4-ospf-10]ospf 10 router-id 4.4.4.4
[R4-ospf-10]area 45
[R4-ospf-10-area-0.0.0.45]netw
[R4-ospf-10-area-0.0.0.45]network 192.168.45.0 0.0.0.255
[R4-ospf-10-area-0.0.0.45]network 10.10.4.0 0.0.0.255
[R4-ospf-10-area-0.0.0.45]

[R5]int gi0/0/1
[R5-GigabitEthernet0/0/1]undo shu
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R5-GigabitEthernet0/0/1]ip add 192.168.45.5 24
[R5-GigabitEthernet0/0/1]q
[R5]int l 0
[R5-LoopBack0]ip add 10.10.5.5 24
[R5-LoopBack0]q
[R5]ospf 10
[R5-ospf-10]ospf 10 router-id 5.5.5.5
[R5-ospf-10]area 45
[R5-ospf-10-area-0.0.0.45]network 192.168.45.0 0.0.0.255
[R5-ospf-10-area-0.0.0.45]network 10.10.5.0 0.0.0.255
[R5-ospf-10-area-0.0.0.45]q
[R5-ospf-10]q
[R5]q