Skip to content

Commit 4f3cbef

Browse files
Auto-update blog content
1 parent 00fc250 commit 4f3cbef

File tree

63 files changed

+19957
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+19957
-0
lines changed

content/posts/2025-11-22-155129311.md

Lines changed: 1450 additions & 0 deletions
Large diffs are not rendered by default.

content/posts/2025-11-22-155130314.md

Lines changed: 450 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
---
2+
layout: post
3+
title: "一CiscoOSPF多进程环境下的路由引入与互通实践251010-"
4+
date: 2025-11-22T16:32:18+0800
5+
description: "本文基于CiscoPacketTracer,设计并实现了一个多OSPF进程路由重分发实验。通过配置四台路由器,将三个网段分别划入OSPF进程1、2、3,并全部置于骨干区域0。实验首先验证了不同OSPF进程间的天然隔离性,随后在边界路由器R2与R3上配置双向路由重分发。通过对比配置前后路由表的变化,并执行端到端ping测试,结果证实:路由重分发成功打破了进程间的壁垒,实现了全网路由信息的无缝共享与互通。本实验不仅完整演示了路由重分发的配置流程与验证方法,更深化了对OSPF进程边界与路由控制原理的理解。"
6+
keywords: "ospf 如何把接口路由引入"
7+
categories: ['未分类']
8+
tags: ['路由重分发', '路由控制', '网络工程', '网络互通', 'Packettracer', 'Ospf', 'Cisco']
9+
artid: "155133944"
10+
arturl: "https://blog.csdn.net/aml258__/article/details/155133944"
11+
image:
12+
path: https://api.vvhan.com/api/bing?rand=sj&artid=155133944
13+
alt: "一CiscoOSPF多进程环境下的路由引入与互通实践251010-"
14+
render_with_liquid: false
15+
featuredImage: https://bing.ee123.net/img/rand?artid=155133944
16+
featuredImagePreview: https://bing.ee123.net/img/rand?artid=155133944
17+
cover: https://bing.ee123.net/img/rand?artid=155133944
18+
img: https://bing.ee123.net/img/rand?artid=155133944
19+
---
20+
21+
22+
23+
# 一、Cisco(OSPF多进程环境下的路由引入与互通实践)251010
24+
25+
26+
27+
**一、使用的软件**
28+
29+
Cisco Packet Tracer 8.0
30+
31+
**二、实验名称**
32+
33+
OSPF多进程路由重分发实现跨进程网络互通
34+
35+
**三、实验设备**
36+
37+
**路由器:**
38+
39+
4 台 2911 Router-PT(R1、R2、R3、R4)
40+
41+
**四、实验要求**
42+
43+
1、配置4台路由器IP 。
44+
45+
2、10.19.0.0/24网段划入 ospf 1 、20.19.0.0/24网段划入 ospf 2 、30.19.0.0/24网段划入 ospf 3
46+
47+
, 区域全部为骨干区域 area 0 。
48+
49+
 3、要求不同 ospf进程 间可以互相通信
50+
51+
**五、端口连接概况**
52+
53+
R1设备的 GigabitEthernet0/0 接口连接 R2设备的 GigabitEthernet 0/0 接口相连;
54+
55+
R2设备的 GigabitEthernet0/1 接口连接 R3设备的 GigabitEthernet 0/1 接口相连;
56+
57+
R3设备的 GigabitEthernet0/0 接口连接 R4设备的 GigabitEthernet 0/0 接口相连。
58+
59+
**六、实验拓扑图**
60+
61+
(各设备接口连接见 “端口连接概况”):
62+
63+
![](https://i-blog.csdnimg.cn/direct/17dc4846324f4d708e571bb2f0770cda.png)
64+
65+
**七、实验配置**
66+
67+
(注意:保存配置用write memory)
68+
**R1:**
69+
Router>enable 
70+
Router#configure terminal  # 进入全局配置模式
71+
Router(config)#hostname R1 # 设置设备名称为R1
72+
73+
R1(config)#interface gig0/0 # 进入接口
74+
R1(config-if)#ip address 10.19.0.1 255.255.255.0 # 配置接口IP地址和子网掩码
75+
R1(config-if)#no shutdown  # 启用接口
76+
R1(config-if)#exit # 退出接口配置模式
77+
R1(config)#interface loopback 0 # 创建环回接口0
78+
R1(config-if)#ip address 1.1.1.1 255.255.255.0 # 配置环回接口IP,用于路由器ID
79+
R1(config-if)#exit # 退出接口
80+
81+
R1(config)#router ospf 1 # 启用OSPF进程1
82+
R1(config-router)#router-id 1.1.1.1 # 手动设置OSPF路由器ID
83+
R1(config-router)#network 10.19.0.0 0.0.0.255 area 0 # 将10.19.0.0/24网段宣告到OSPF区域0
84+
R1(config-router)#network 1.1.1.1 0.0.0.255 area 0 # 将环回接口宣告到OSPF区域0
85+
R1(config-router)#exit # 退出OSPF配置模式
86+
87+
R1(config)#exit # 退出全局配置模式
88+
R1#write memory  # 保存当前配置
89+
90+
**R2:**
91+
Router>enable 
92+
Router#configure terminal  # 进入全局配置模式
93+
Router(config)#hostname R2 # 设置设备名称为R2
94+
95+
R2(config)#interface gig0/0 # 进入接口
96+
R2(config-if)#ip address 10.19.0.2 255.255.255.0 # 配置接口IP
97+
R2(config-if)#no shutdown  # 启用接口
98+
R2(config-if)#exit # 退出接口
99+
R2(config)#interface gig0/1 # 进入接口
100+
R2(config-if)#ip address 20.19.0.1 255.255.255.0 # 配置接口IP
101+
R2(config-if)#no shutdown  # 启用接口
102+
R2(config-if)#exit # 退出接口
103+
104+
R2(config)#router ospf 1 # 启用OSPF进程1
105+
R2(config-router)#router-id 2.2.2.2 # 手动设置OSPF路由器ID
106+
R2(config-router)#network 10.19.0.0 0.0.0.255 area 0 # 将10.19.0.0/24网段宣告到OSPF进程1的区域0
107+
R2(config-router)#exit # 退出OSPF进程1配置模式
108+
109+
R2(config)#router ospf 2 # 启用OSPF进程2
110+
R2(config-router)#network 20.19.0.0 0.0.0.255 area 0 # 将20.19.0.0/24网段宣告到OSPF进程2的区域0
111+
R2(config-router)#exit # 退出OSPF进程2配置模式
112+
113+
**# 配置双向路由重分发实现OSPF进程间通信**
114+
R2(config)#router ospf 1 # 重新进入OSPF进程1配置模式
115+
R2(config-router)#redistribute ospf 2 subnets  # 将OSPF进程2的路由重分发到进程1
116+
R2(config-router)#exit # 退出OSPF进程1配置模式
117+
R2(config)#router ospf 2 # 重新进入OSPF进程2配置模式
118+
R2(config-router)#redistribute ospf 1 subnets  # 将OSPF进程1的路由重分发到进程2
119+
R2(config-router)#exit # 退出OSPF进程2配置模式
120+
121+
R2(config)#exit # 退出全局配置模式
122+
R2#write memory # 保存当前配置
123+
124+
**R3:**
125+
Router>enable 
126+
Router#configure terminal  # 进入全局配置模式
127+
Router(config)#hostname R3 # 设置设备名称为R3
128+
129+
R3(config)#interface gig0/1 # 进入接口
130+
R3(config-if)#ip address 20.19.0.2 255.255.255.0 # 配置接口IP
131+
R3(config-if)#no shutdown  # 启用接口
132+
R3(config-if)#exit # 退出接口
133+
134+
R3(config)#interface gig0/0 # 进入接口
135+
R3(config-if)#ip address 30.19.0.1 255.255.255.0 # 配置接口IP
136+
R3(config-if)#no shutdown  # 启用接口
137+
R3(config-if)#exit # 退出接口
138+
139+
R3(config)#router ospf 2 # 启用OSPF进程2
140+
R3(config-router)#router-id 3.3.3.3 # 手动设置OSPF路由器ID
141+
R3(config-router)#network 20.19.0.0 0.0.0.255 area 0 # 将20.19.0.0/24网段宣告到OSPF进程2的区域0
142+
R3(config-router)#exit # 退出OSPF进程2配置模式
143+
R3(config)#router ospf 3 # 启用OSPF进程3
144+
R3(config-router)#network 30.19.0.0 0.0.0.255 area 0 # 将30.19.0.0/24网段宣告到OSPF进程3的区域0
145+
R3(config-router)#exit # 退出OSPF进程3配置模式
146+
147+
**# 配置双向路由重分发实现OSPF进程间通信**
148+
R3(config)#router ospf 2 # 重新进入OSPF进程2配置模式
149+
R3(config-router)#redistribute ospf 3 subnets  # 将OSPF进程3的路由重分发到进程2
150+
R3(config-router)#exit # 退出OSPF进程2配置模式
151+
R3(config)#router ospf 3 # 重新进入OSPF进程3配置模式
152+
R3(config-router)#redistribute ospf 2 subnets  # 将OSPF进程2的路由重分发到进程3
153+
R3(config-router)#exit # 退出OSPF进程3配置模式
154+
155+
R3(config)#exit # 退出全局配置模式
156+
R3#write memory  # 保存当前配置
157+
158+
**R4:**
159+
Router>enable 
160+
Router#configure terminal  # 进入全局配置模式
161+
Router(config)#hostname R4 # 设置设备名称为R4
162+
163+
R4(config)#interface gig0/0 # 进入接口
164+
R4(config-if)#ip address 30.19.0.2 255.255.255.0 # 配置连接口IP
165+
R4(config-if)#no shutdown  # 启用接口
166+
R4(config-if)#exit # 退出接口配置模式
167+
168+
R4(config)#router ospf 3 # 启用OSPF进程3
169+
R4(config-router)#router-id 4.4.4.4 # 手动设置OSPF路由器ID
170+
R4(config-router)#network 30.19.0.0 0.0.0.255 area 0 # 将30.19.0.0/24网段宣告到OSPF进程3的区域0
171+
R4(config-router)#exit # 退出OSPF配置模式
172+
173+
R4(config)#exit # 退出全局配置模式
174+
R4#write memory # 保存当前配置
175+
176+
**八、实验结果**
177+
178+
**1、在宣告了自身网段以及未使用路由重分布的情况下,观察R1、R2、R3、R4的路由条目。(使用命令: show ip route)**
179+
180+
R1的路由条目:
181+
182+
![](https://i-blog.csdnimg.cn/direct/cfb24712e8f1451eb7f4165f584b89ee.png)
183+
184+
R2的路由条目:
185+
186+
![](https://i-blog.csdnimg.cn/direct/34c2f5c63e43471387ab642aecbc6df2.png)
187+
188+
R3的路由条目:
189+
190+
![](https://i-blog.csdnimg.cn/direct/6f1f262dcf724211b48991ae28318765.png)
191+
192+
R4的路由条目:
193+
194+
![](https://i-blog.csdnimg.cn/direct/c4eeab06353e41f093b98279aa0ccb1a.png)
195+
196+
结果:
197+
198+
R1 路由表包含:1.1.1.1/24 (自身), 10.19.0.0/24 (直连,OSPF 1);
199+
200+
R2 路由表包含:1.1.1.1/24 (OSPF 1), 10.19.0.0/24 (直连,OSPF 1), 20.19.0.0/24 (直连,OSPF 2);
201+
202+
R3 路由表包含:20.19.0.0/24 (直连,OSPF 2), 30.19.0.0/24 (直连,OSPF 3);
203+
204+
R4 路由表包含:30.19.0.0/24 (直连,OSPF 3);
205+
206+
**2、在宣告了自身网段以及在R2上使用路由重分布的情况下,观察R1、R2、R3、R4的路由条目。(使用命令: show ip route)**
207+
208+
R1的路由条目:
209+
210+
![](https://i-blog.csdnimg.cn/direct/1f24da6165834b1cb9687bb8bcbc85d8.png)
211+
212+
R2的路由条目:
213+
214+
![](https://i-blog.csdnimg.cn/direct/6fdd41071d2f48efabaf80123e6d1fbf.png)
215+
216+
R3的路由条目:
217+
218+
![](https://i-blog.csdnimg.cn/direct/283c59fc4a1c4be7aa0c8a13c9e70aa0.png)
219+
220+
R4的路由条目:
221+
222+
![](https://i-blog.csdnimg.cn/direct/be94003904a24f598fe72e5151003310.png)
223+
224+
结果:
225+
226+
R1 路由表包含:1.1.1.1/24 (自身), 10.19.0.0/24 (直连,OSPF 1), 20.19.0.0/24(重分发);
227+
228+
R2 路由表包含:1.1.1.1/24 (OSPF 1), 10.19.0.0/24 (直连,OSPF 1), 20.19.0.0/24 (直连,OSPF 2);
229+
230+
R3 路由表包含:20.19.0.0/24 (直连,OSPF 2), 30.19.0.0/24 (直连,OSPF 3),1.1.1.1/24 (重分发),10.19.0.0/24(重分发);
231+
232+
R4 路由表包含:30.19.0.0/24 (直连,OSPF 3);
233+
234+
**3、在前两个的条件下,在R3上进行路由重分布,观察R1、R2、R3、R4的路由条目。(使用命令: show ip route)**
235+
236+
R1的路由条目:
237+
238+
![](https://i-blog.csdnimg.cn/direct/b9a6c1e13a16475bbe4b746c010321dd.png)
239+
240+
R2的路由条目:
241+
242+
![](https://i-blog.csdnimg.cn/direct/422d0770484e48129a10ecd552234125.png)
243+
244+
R3的路由条目:
245+
246+
![](https://i-blog.csdnimg.cn/direct/d60999d65b1e46cba699c7ef1fb3200f.png)
247+
248+
R4的路由条目:
249+
250+
![](https://i-blog.csdnimg.cn/direct/68049f75e3414b428922951c4eca8b30.png)
251+
252+
R1 路由表包含:1.1.1.1/24 (自身), 10.19.0.0/24 (直连,OSPF 1), 20.19.0.0/24(重分发), 30.19.0.0/24(重分发);
253+
254+
R2 路由表包含:1.1.1.1/24 (OSPF 1), 10.19.0.0/24 (直连,OSPF 1), 20.19.0.0/24 (直连,OSPF 2), 30.19.0.0/24(重分发);
255+
256+
R3 路由表包含:20.19.0.0/24 (直连,OSPF 2), 30.19.0.0/24 (直连,OSPF 3),1.1.1.1/24 (重分发),10.19.0.0/24(重分发);
257+
258+
R4 路由表包含:30.19.0.0/24 (直连,OSPF 3),1.1.1.1/24 (重分发), 10.19.0.0/24 (重分发), 20.19.0.0/24(重分发);
259+
260+
**4、检查在不同进程中的网络是否全网互通,使用 ospf1 中的R1 ping ospf3 中的R4 (相互ping一次)**
261+
262+
![](https://i-blog.csdnimg.cn/direct/c2ca7e6b7162411ca6cc1dd0b1d6e90b.png)
263+
264+
![](https://i-blog.csdnimg.cn/direct/b051253ce11e45638402117a8b686f10.png)
265+
266+
**九、实验结论**
267+
通过本次路由重分发实验,可以得出以下重要结论:
268+
**路由隔离性验证:**
269+
在同一台路由器上运行的不同OSPF进程默认相互隔离,各进程只能学习到本进程内宣告的路由,无法自动获取其他进程的路由信息。
270+
271+
**重分发有效性证明:**
272+
通过配置双向路由重分发(redistribute ospf X subnets),成功实现了不同OSPF进程间的路由信息共享,验证了路由重分发技术的实际效果。
273+
274+
**全网连通性达成:**
275+
在R2和R3上完成双向路由重分发配置后,四个路由器形成了完整的路由表:
276+
R1能够学习到20.19.0.0/24和30.19.0.0/24网段路由
277+
R4能够学习到10.19.0.0/24和20.19.0.0/24网段路由
278+
实现了OSPF进程1、2、3域间的全网互通
279+
路由传递路径清晰:路由信息按照"R1←→R2←→R3←→R4"的链式路径进行传递,体现了路由重分发在边界路由器上的关键作用。
280+
281+
**技术可行性确认:**
282+
实验证明,通过合理的路由重分发配置,可以解决多OSPF进程环境下的网络互通需求,为实际网络工程中的类似场景提供了技术参考。
283+
284+
**十、实验总结**
285+
本次路由重分发实验圆满完成,主要收获如下:
286+
**技术层面**
287+
**掌握了OSPF多进程的基本概念:**
288+
理解了在同一台路由器上运行多个OSPF进程的应用场景和配置方法。
289+
**深入理解了路由重分发原理:**
290+
通过实践验证了路由重分发在不同路由域间传递路由信息的工作机制,特别是redistribute命令的实际效果。
291+
292+
**熟悉了相关配置命令:**
293+
OSPF多进程的创建与网络宣告;
294+
路由重分发的基本配置语法;
295+
路由器ID的手动指定方法。
296+
297+
**实践层面
298+
提升了网络故障排查能力:**
299+
通过分阶段验证路由表的变化,培养了系统性分析网络连通性问题的思维方法。
300+
301+
**加深了对路由协议行为的理解:**
302+
观察到不同OSPF进程间路由信息的隔离特性,以及重分发后路由的传播路径。
303+
304+
**强化了网络规划设计意识:**
305+
认识到在复杂网络环境中,合理规划路由域边界和重分发点的重要性。
306+
307+
**现实意义**
308+
虽然本实验中的多OSPF进程场景在实际网络中应用有限,但所涉及的路由重分发技术是网络工程师必须掌握的核心技能。这种技术在网络合并、多厂商设备共存、协议迁移等真实场景中具有重要应用价值。
309+
310+
通过本次实验,不仅巩固了理论知识,更重要的是培养了解决实际网络问题的能力,为后续更复杂的网络工程实践打下了坚实基础。
311+
312+
313+

0 commit comments

Comments
 (0)