实验思路:
1.IP地址规划
172.16.0.0/16
172.16.0.0/24
172.16.0.0/25
172.16.0.128/25
172.16.0.0/30
172.16.0.4/30
172.16.0.8/30
环回:R1-R5
172.16.1.0/24
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
172.16.5.0/24
实验图:
实验步骤:
1.配置IP地址及环回
R1
[Huawei]sysname R1
[R1]inter
[R1]interface loo
[R1]interface LoopBack 0
[R1-LoopBack0]ip add
[R1-LoopBack0]ip address 172.16.1.1 24
[R1-LoopBack0]q
[R1]inter
[R1]interface s4/0/0
[R1-Serial4/0/0]ip ad
[R1-Serial4/0/0]ip address 172.16.0.1 30
R2
[Huawei]sysname R2
[R2]inter
[R2]interface loo
[R2]interface LoopBack 0
[R2-LoopBack0]ip add
[R2-LoopBack0]ip address 172.16.2.1 24
[R2-LoopBack0]q
[R2]inter
[R2]interface s4/0/0
[R2-Serial4/0/0]ip add
[R2-Serial4/0/0]ip address 172.16.0.2 30
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip add
[R2-GigabitEthernet0/0/0]ip address 172.16.0.129 25
R3
[R3]interface loo
[R3]interface LoopBack 0
[R3-LoopBack0]ip ad
[R3-LoopBack0]ip address 172.16.3.1 24
[R3-LoopBack0]q
[R3]inter
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip add
[R3-GigabitEthernet0/0/0]ip address 172.16.0.130 25
[R3]interface s4/0/0
[R3-Serial4/0/0]ip add
[R3-Serial4/0/0]ip address 172.16.0.5 30
R4
[R4]inter
[R4]interface s4/0/0
[R4-Serial4/0/0]ip add
[R4-Serial4/0/0]ip address 172.16.0.6 30
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]i padd
[R4-GigabitEthernet0/0/0]ip ad
[R4-GigabitEthernet0/0/0]ip address 172.16.0.131 25
[R4]interface s4/0/1
[R4-Serial4/0/1]ip add
[R4-Serial4/0/1]ip address 172.16.0.9 30
[R4]interface loo
[R4]interface LoopBack 0
[R4-LoopBack0]ip add
[R4-LoopBack0]ip address 172.16.4.1 24
R5
[R5]interface LoopBack 0
[R5-LoopBack0]ip ad
[R5-LoopBack0]ip address 172.16.5.1 24
[R5-LoopBack0]q
[R5]inter
[R5]interface s4/0/0
[R5-Serial4/0/0]ip ad
[R5-Serial4/0/0]ip address 172.16.0.10 30
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip add
[R5-GigabitEthernet0/0/0]ip address 172.16.0.132 25
2.测试连通性
[R2]ping 172.16.0.1
PING 172.16.0.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.1: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 172.16.0.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 172.16.0.1: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.16.0.1: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 172.16.0.1: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 172.16.0.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/34/80 ms
[R2]ping 172.16.0.130
PING 172.16.0.130: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.130: bytes=56 Sequence=1 ttl=255 time=130 ms
Reply from 172.16.0.130: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.16.0.130: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 172.16.0.130: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.16.0.130: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 172.16.0.130 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/62/130 ms
[R2]ping 172.16.0.131
PING 172.16.0.131: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.131: bytes=56 Sequence=1 ttl=255 time=100 ms
Reply from 172.16.0.131: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.16.0.131: bytes=56 Sequence=3 ttl=255 time=80 ms
Reply from 172.16.0.131: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 172.16.0.131: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 172.16.0.131 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/62/100 ms
[R2]ping
[R2]ping 172.16.0.132
PING 172.16.0.132: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.132: bytes=56 Sequence=1 ttl=255 time=120 ms
Reply from 172.16.0.132: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 172.16.0.132: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.16.0.132: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.16.0.132: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 172.16.0.132 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/60/120 ms
[R4]ping 172.16.0.5
PING 172.16.0.5: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.5: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 172.16.0.5: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 172.16.0.5: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 172.16.0.5: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 172.16.0.5: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 172.16.0.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/20/30 ms
[R4]ping 172.16.0.10
PING 172.16.0.10: 56 data bytes, press CTRL_C to break
Reply from 172.16.0.10: bytes=56 Sequence=1 ttl=255 time=30 ms
Reply from 172.16.0.10: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 172.16.0.10: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 172.16.0.10: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 172.16.0.10: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 172.16.0.10 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/26/40 ms
至此实验要求1、2、6、7达成
接下来完成其他要求
要求3:
R1
[R1]ospf 1 rou
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]ar
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
R2
[R2]ospf 1 rou
[R2]ospf 1 router-id 2.2.2.2
Info: The configuration succeeded. You need to restart the OSPF process to validate the new router ID.
[R2-ospf-1]are
[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.0.2 0.0.0.0
[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]are
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net
[R2-ospf-1-area-0.0.0.0]network 172.16.0.129 0.0.0.0
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]are
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 172.16.0.130 0.0.0.0
[R3-ospf-1-area-0.0.0.2]network 172.16.0.5 0.0.0.0
[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]interface g0/0/0
[R3-GigabitEthernet0/0/0]os
[R3-GigabitEthernet0/0/0]ospf dr
[R3-GigabitEthernet0/0/0]ospf dr-priority 0
R4
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]are
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net
[R4-ospf-1-area-0.0.0.0]network 172.16.0.131 0.0.0.0
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 172.16.0.6 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 172.16.0.9 0.0.0.0
[R4-ospf-1-area-0.0.0.2]net
[R4-ospf-1-area-0.0.0.2]network 172.16.4.1 0.0.0.0
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]os
[R4-GigabitEthernet0/0/0]ospf dr
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
R5
[R5]ospf 1 router-id 5.5.5.5
Info: The configuration succeeded. You need to restart the OSPF process to validate the new router ID.
[R5-ospf-1]are
[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.132 0.0.0.0
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]network 172.16.0.10 0.0.0.0
[R5-ospf-1-area-0.0.0.2]network 172.16.5.1 0.0.0.0
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]os
[R5-GigabitEthernet0/0/0]ospf dr
[R5-GigabitEthernet0/0/0]ospf dr-priority 0
要求4:
R3-R4之间明文
[R3]interface s4/0/0
[R3-Serial4/0/0]ospf authentication-mode si
[R3-Serial4/0/0]ospf authentication-mode simple ci
[R3-Serial4/0/0]ospf authentication-mode simple cipher huawei
[R4]interface s4/0/0
[R4-Serial4/0/0]ospf authentication-mode simple ci
[R4-Serial4/0/0]ospf authentication-mode simple cipher huawei
R4-R5之间密文
更改认证模式
[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 ?
INTEGER<1-255> Key ID
<cr> Please press ENTER to execute command
[R4-Serial4/0/1]ospf authentication-mode md5 1 ci
[R4-Serial4/0/1]ospf authentication-mode md5 1 cipher huawei
[R5]interface s4/0/0
[R5-Serial4/0/0]ospf authentication-mode md5 1 cipher huawei
要求5:
[R3]interface loo
[R3]interface LoopBack 100
[R3-LoopBack100]ip add
[R3-LoopBack100]ip address 100.1.1.1 24
[R3-LoopBack100]q
[R3]os
[R3]ospf 1 rou
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]de
[R3-ospf-1]def
[R3-ospf-1]default-route-advertise al
[R3-ospf-1]default-route-advertise always