OSPF实验

 实验思路:

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 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

.c...

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值