OSPF综合实验

1.拓扑图

c202a9073bc244e9a1b9cbb15439149e.png二.实验步骤

1.合理配置IP地址,基于172.16.0.0/16 划分

  从图中可看出,图中有RIP 以及OSPF,因此在划分网段时,需将两者均考虑进去

  共有五个区域以及RIP网段,因此需要划分6个网段以供使用

  因此在基于172.16.00000000.00000000网段在主机位借3位进行划分,注意借三位,因此网络掩码变为19

(1)

172.16.000  00000.00000000   172.16.0.0  19 ---area0

因为环回宣告也需要继续进行划分,例如area0中,R1 R2 R3的环回宣告在此区域,因此需要继续借位划分,环回模拟用户网段,用户网段一般不会超过200-300限制,用户网段一般给与24位网络掩码,所以,可以借5位,最终可以有2^5=32个网段。

a.172.16.000   00000.   00000000    172.16.0.0 24  ----P2P(一般借位到30)

172.16.00000000.000000 00  172.16.0.0 30

172.16.00000000.000001 00  172.16.0.4 30

172.16.00000000.000010 00   172.16.0.8 30

b.172.16.000   00001.   00000000    172.16.1.0 24-------MA   区域中通过交换机连接,相当于构建MA网络,由于掩码借位30不够用,一般情况借位到29

172.16.00000001.00000   000  172.16.1.0  29

172.16.00000001.00001   000   172.16.1.8 29    172.16.1.16  29

172.16.2.0  24

172.16.3.0 24

172.16.4.0 24 ......172.16.31.0  24

(2)172.16.001  00000.00000000   172.16.32.0 19---area1

(3)172.16.010  00000.00000000    172.16.64.0 19---area2

(4)172.16.011  00000.00000000  172.16.96.0 19---area3

(5)172.16.100  00000.00000000  172.16.128.0 19---area4

(6)172.16.101  00000.00000000  172.16.160.0 19---rip

(7)  图中仅需六个网段,因此剩余两个网段将用来后续的拓展

     172.16.110  00000.00000000   172.16.192.0 19

     172.16.111   00000.00000000   172.16.224.0 19

补充:网络类型:P2P MA 

补充:网络类型:P2P MA

配置:

[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.33.1 29
Oct 15 2022 20:13:19-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]q
[r1]int l0
[r1-LoopBack0]ip address 172.16.34.1 24
[r1-LoopBack0]
ospf激活
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]net	
[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]
配置STUB
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub
[r1]dis	
[r1]display ospf lsdb

	 OSPF Process 1 with Router ID 1.1.1.1
		 Link State Database 

		         Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    2.2.2.2         2.2.2.2             34  48    8000000A       1
 Router    1.1.1.1         1.1.1.1             26  48    8000000B       1
 Router    3.3.3.3         3.3.3.3             27  48    80000007       1
 Network   172.16.33.1     1.1.1.1             26  36    80000008       0
 Sum-Net   0.0.0.0         3.3.3.3             99  28    80000001       1
 




AR2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 172.16.33.2 29
Oct 15 2022 20:14:34-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]int l0
[r2-LoopBack0]ip address 172.16.35.1 24
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r2]ospf
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
做完NAT后,可以实现对公网环回的访问结果
<r2>ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=254 time=100 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=254 time=70 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=254 time=50 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/62/100 ms



AR3:
[r3]interface s4/0/0
[r3-Serial4/0/0]ip address 34.0.0.1 24
[r3-Serial4/0/0]
Oct 15 2022 19:40:29-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the UP state. 
[r3]ip route-static 0.0.0.0 0 34.0.0.2 
[r3]ping 46.0.0.2
  PING 46.0.0.2: 56  data bytes, press CTRL_C to break
    Reply from 46.0.0.2: bytes=56 Sequence=1 ttl=255 time=170 ms
    Reply from 46.0.0.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 46.0.0.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 46.0.0.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 46.0.0.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 46.0.0.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/52/170 ms
配置中心的MGRE 环境
[r3]interface t	
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.1.1 29
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
此处的source必须指定地址,如果是MESH环境,既是中心,又是分支,可以不指定
[r3-Tunnel0/0/0]source 34.0.0.1
Oct 15 2022 19:54:38-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
注意此处可以通过创建nhrp池来确定目标
[r3-Tunnel0/0/0]nhrp network-id 100
伪广播开启	
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 172.16.33.3 29
Oct 15 2022 20:16:31-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
[r3]int  l0
[r3-LoopBack0]ip address 172.16.36.1 24
OSPF宣告
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]display ip interface brief
*down: administratively down
[r3-ospf-1]display ip interface 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OSPF(开放最短路径优先)是一种用于路由的动态路由协议,它是根据路由器之间的链路状态来计算最短路径的。 在一个OSPF综合实验案例中,可以模拟一个复杂的网络拓扑,包括多个路由器和连接它们的链路。假设有5个路由器A、B、C、D和E,它们之间通过不同的链路相连。 首先,需要配置每个路由器上的OSPF进程,并为它们分配一个路由器ID。然后,在每个链路上配置正确的IP地址和子网掩码。接下来,通过在OSPF进程中启用不同的区域,将路由器分成不同的区域。 然后,需要配置每个路由器之间的OSPF邻居关系。这可以通过指定邻居的路由器ID和链路上的IP地址来完成。路由器之间的邻居关系建立后,它们将开始交换链路状态信息(LSA)。 每个路由器将根据接收到的LSA计算自己的链路状态数据库(LSDB)。然后,通过运行Dijkstra算法,每个路由器将计算出到达其他路由器的最短路径。最后,每个路由器将根据最短路径选择相应的接口进行路由。 在这个实验案例中,还可以模拟链路故障的情况,观察OSPF的快速收敛性。当某个链路出现故障时,路由器将发送通告信息给邻居,通知它们链路状态已经改变。邻居将更新自己的LSDB,并重新计算最短路径。 通过这个综合实验案例,可以深入了解OSPF协议的工作原理和功能。同时,还可以通过观察实验结果,了解OSPF网络中的优势和效率。这些知识和经验将帮助网络工程师更好地设计、优化和故障排除复杂的网络拓扑。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值