OSPF综合实验

首先对a0区域进行ip配置

[r3]int s4/0/0
[r3-Serial4/0/0]ip add 34.0.0.1 24
[r3-Serial4/0/0]q
[r3]ip route-static 0.0.0.0 0 34.0.0.2
[r3]

[ISP]int s4/0/0
[ISP-Serial4/0/0]ip add    
[ISP-Serial4/0/0]ip address  34.0.0.2 24
[ISP-Serial4/0/0]
[ISP-Serial4/0/0]int s3/0/0
[ISP-Serial3/0/0]ip add 46.0.0.2 24
[ISP-Serial3/0/0]int s4/0/1
[ISP-Serial4/0/1]ip add 45.0.0.2 24
[ISP-Serial4/0/1]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 47.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 4.4.4.4 24
[ISP-LoopBack0]

其他同上,注意指向ISP的缺省。

对R3 R5 R6 R7进行MRGRE配置,R3为中站点

[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 172.16.1.1 29 
[r3-Tunnel0/0/0]tunnel-protocol gre p    
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.1
[r3-Tunnel0/0/0]
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 172.16.1.2 29
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source Serial 4/0/0. 
[r5-Tunnel0/0/0]
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register 
[r5-Tunnel0/0/0]

R6,R7 同R5配置。

配置a1,a2,a3,a4的接口IP及环回IP

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.33.1 29
Apr 14 2023 22:38:54-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip add 172.16.34.1 24
[r1-LoopBack0]

                                                 :

                                                 :

                                                 :

[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip add 172.16.65.10 29
Apr 14 2023 22:43:46-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r12-GigabitEthernet0/0/0]int l0
[r12-LoopBack0]ip add 172.16.160.1 20
[r12-LoopBack0]int l1
[r12-LoopBack1]ip add 172.16.176.1 20
[r12-LoopBack1]

 启动各区域的OSPF

[r1]ospf 1 rou	
[r1]ospf 1 router-id 1.1.1.1 
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]n	
[r1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r1-ospf-1-area-0.0.0.1]
[r3]ospf 1 rou	
[r3]ospf 1 router-id 3.3.3.3 
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]ne	
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.255.255
[r3-ospf-1-area-0.0.0.1]
[r3-ospf-1-area-0.0.0.1]q
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]ne	
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]
[r7]ospf 1 rou	
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]a 0
[r7-ospf-1-area-0.0.0.0]ne	
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[r7-ospf-1-area-0.0.0.0]a 3
[r7-ospf-1-area-0.0.0.3]ne	
[r7-ospf-1-area-0.0.0.3]network 172.16.9
Apr 14 2023 22:51:31-08:00 r7 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.16.172, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
[r7-ospf-1-area-0.0.0.3]
[r6]ospf 1	
[r6]ospf 1 rou	
[r6]ospf 1 router-id 6.6.6.6 
[r6-ospf-1]a 0
[r6-ospf-1-area-0.0.0.0]ne	
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6-ospf-1-area-0.0.0.0]a 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
[r6-ospf-1-area-0.0.0.2]
[r12]ospf 1 rou	
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]ne	
[r12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
[r12-ospf-1-area-0.0.0.2]

[r12]rip 1
[r12-rip-1]v 2
[r12-rip-1]ne	
[r12-rip-1]network 172.16.0.0
[r12-rip-1]

更改Tunnel接口的类型

R3

[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp

AR5

[r5]int t0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp

AR6

[r6]int t0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp

AR7

[r7]int t0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
在R12上进行重发布

[r12]ospf 1
[r12-ospf-1]imp    
[r12-ospf-1]import-route rip 1
[r12-ospf-1]q

pingR1的环回,可以做到全网通

[r12]ping 172.16.34.1
  PING 172.16.34.1: 56  data bytes, press CTRL_C to break
    Reply from 172.16.34.1: bytes=56 Sequence=1 ttl=252 time=60 ms
    Reply from 172.16.34.1: bytes=56 Sequence=2 ttl=252 time=70 ms
    Reply from 172.16.34.1: bytes=56 Sequence=3 ttl=252 time=80 ms
    Reply from 172.16.34.1: bytes=56 Sequence=4 ttl=252 time=60 ms
    Reply from 172.16.34.1: bytes=56 Sequence=5 ttl=252 time=60 ms

  --- 172.16.34.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 60/66/80 ms

下面进行优化

·对ABR和ASBR做空接口来防止环路

[r3]ip rou	
[r3]ip route
[r3]ip route-static 172.16.32.0 19 n	
[r3]ip route-static 172.16.32.0 19 NULL  0
[r3]

 

[r6]ip rou	
[r6]ip route
[r6]ip route-static 172.16.64.0 19 n	
[r6]ip route-static 172.16.64.0 19 NULL 0
[r6]
[r7]ip rou	
[r7]ip route
[r7]ip route-static 172.16.96.0 19 n	
[r7]ip route-static 172.16.96.0 19 NULL 0
[r7]
[r9]ip rou	
[r9]ip route
[r9]ip route-static 172.16.128.0 19 n	
[r9]ip route-static 172.16.128.0 19 NULL 0
[r9]
[r12]ip rou	
[r12]ip route
[r12]ip route-static 172.16.160 19 n	
[r12]ip route-static 172.16.160 19 n
[r12]ip route-static 172.16.160.0 19 n	
[r12]ip route-static 172.16.160.0 19 NULL  0
[r12]

·对a1区域进行区域认证配置,保障更新安全

[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]auth	
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 ci	
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r1-ospf-1-area-0.0.0.1]

 

[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]au	
[r2-ospf-1-area-0.0.0.1]authentication-mode m	
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 c	
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r2-ospf-1-area-0.0.0.1]
[r3]ospf 1
[r3-ospf-1] a 1
[r3-ospf-1-area-0.0.0.1]au	
[r3-ospf-1-area-0.0.0.1]authentication-mode m	
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 

 

 OSPF实验主要是配置太多,要保持头脑清晰,先规划再分步配置。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

电力小子sp

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

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

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

打赏作者

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

抵扣说明:

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

余额充值