Cisco Packet Tracer 8.2 路由器基础配置:3台PC+2台路由器拓扑搭建与连通性验证
📅 2026/7/12 7:10:53
👁️ 阅读次数
📝 编程学习
Cisco Packet Tracer 8.2 路由器基础配置实战:3台PC+2台路由器拓扑搭建与连通性验证
1. 实验环境准备与拓扑设计
在开始配置之前,我们需要先了解实验的基本环境和拓扑结构。本次实验将使用Cisco Packet Tracer 8.2模拟器搭建一个包含3台PC和2台路由器的经典网络拓扑。
实验设备清单:
- Cisco 2911路由器 ×2
- 终端PC ×3
- 交叉线(Copper Cross-Over)
- 串行DCE线(Serial DCE)
- 控制台线(Console)
网络拓扑规划:
PC1 <--> Router0 <--> Router1 <--> PC2 | v PC3IP地址规划表:
| 设备 | 接口 | IP地址 | 子网掩码 | 网关 |
|---|---|---|---|---|
| PC1 | Fa0/0 | 192.168.1.2 | 255.255.255.0 | 192.168.1.1 |
| PC2 | Fa0/0 | 10.1.1.2 | 255.0.0.0 | 10.1.1.1 |
| PC3 | Fa0/1 | 172.16.1.2 | 255.255.255.0 | 172.16.1.1 |
| Router0 | Fa0/0 | 192.168.1.1 | 255.255.255.0 | - |
| Router0 | Fa0/1 | 172.16.1.1 | 255.255.255.0 | - |
| Router0 | S0/0/0 | 209.165.201.1 | 255.255.255.252 | - |
| Router1 | Fa0/0 | 10.1.1.1 | 255.0.0.0 | - |
| Router1 | S0/0/0 | 209.165.201.2 | 255.255.255.252 | - |
提示:在实际实验中,可以根据需要调整IP地址规划,但需确保同一网段设备使用相同的子网掩码。
2. 拓扑搭建与设备连接
2.1 设备放置与模块安装
添加设备到工作区:
- 从设备列表中拖放2台2911路由器和3台PC到工作区
- 合理排列设备位置,便于后续连线
路由器模块安装: 路由器默认可能缺少某些接口模块,需要手动添加:
# 在路由器物理视图下操作: # 关闭路由器电源 Router> enable Router# configure terminal Router(config)# interface FastEthernet0/0 Router(config-if)# no shutdown Router(config-if)# exit # 添加串行接口模块(在物理视图下操作) 1. 点击路由器进入物理视图 2. 关闭电源开关 3. 将HWIC-2T模块拖放到空插槽 4. 重新打开电源2.2 网络连线配置
连接方案:
| 连接类型 | 连接设备A | 接口A | 连接设备B | 接口B |
|---|---|---|---|---|
| 交叉线 | PC1 | FastEthernet | Router0 | FastEthernet0/0 |
| 交叉线 | PC3 | FastEthernet | Router0 | FastEthernet0/1 |
| 交叉线 | PC2 | FastEthernet | Router1 | FastEthernet0/0 |
| 串行DCE | Router0 | Serial0/0/0 | Router1 | Serial0/0/0 |
| 控制台线 | PC1 | RS232 | Router0 | Console |
关键连线步骤:
使用交叉线连接PC与路由器:
- PC1 <-> Router0 Fa0/0
- PC3 <-> Router0 Fa0/1
- PC2 <-> Router1 Fa0/0
使用串行DCE线连接两台路由器:
- 注意DCE端应连接在Router0上(提供时钟信号)
- Router0 S0/0/0 <-> Router1 S0/0/0
(可选)使用控制台线连接PC1与Router0用于配置
注意:串行连接必须有一端是DCE,负责提供时钟信号。在Packet Tracer中,先连接的一端会自动成为DCE端。
3. 路由器基础配置
3.1 路由器基本参数配置
Router0配置示例:
Router> enable Router# configure terminal Router(config)# hostname R0 R0(config)# enable secret class123 # 设置特权模式密码 R0(config)# line console 0 R0(config-line)# password cisco R0(config-line)# login R0(config-line)# exit R0(config)# line vty 0 4 R0(config-line)# password cisco R0(config-line)# login R0(config-line)# exitRouter1配置示例:
Router> enable Router# configure terminal Router(config)# hostname R1 R1(config)# enable secret class123 R1(config)# line console 0 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# exit R1(config)# line vty 0 4 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# exit3.2 接口IP地址配置
Router0接口配置:
R0(config)# interface FastEthernet0/0 R0(config-if)# ip address 192.168.1.1 255.255.255.0 R0(config-if)# no shutdown R0(config-if)# exit R0(config)# interface FastEthernet0/1 R0(config-if)# ip address 172.16.1.1 255.255.255.0 R0(config-if)# no shutdown R0(config-if)# exit R0(config)# interface Serial0/0/0 R0(config-if)# ip address 209.165.201.1 255.255.255.252 R0(config-if)# clock rate 64000 # 仅DCE端需要配置时钟 R0(config-if)# no shutdown R0(config-if)# exitRouter1接口配置:
R1(config)# interface FastEthernet0/0 R1(config-if)# ip address 10.1.1.1 255.0.0.0 R1(config-if)# no shutdown R1(config-if)# exit R1(config)# interface Serial0/0/0 R1(config-if)# ip address 209.165.201.2 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# exit3.3 静态路由配置
Router0静态路由配置:
R0(config)# ip route 10.0.0.0 255.0.0.0 209.165.201.2Router1静态路由配置:
R1(config)# ip route 192.168.1.0 255.255.255.0 209.165.201.1 R1(config)# ip route 172.16.1.0 255.255.255.0 209.165.201.1路由表验证命令:
R0# show ip route R1# show ip route4. PC配置与连通性测试
4.1 PC网络配置
PC1配置:
- IP地址:192.168.1.2
- 子网掩码:255.255.255.0
- 默认网关:192.168.1.1
PC2配置:
- IP地址:10.1.1.2
- 子网掩码:255.0.0.0
- 默认网关:10.1.1.1
PC3配置:
- IP地址:172.16.1.2
- 子网掩码:255.255.255.0
- 默认网关:172.16.1.1
4.2 连通性测试方法
基本ping测试:
PC1测试到网关:
PC1> ping 192.168.1.1PC1测试跨路由器通信:
PC1> ping 10.1.1.2 PC1> ping 172.16.1.2PC2测试跨路由器通信:
PC2> ping 192.168.1.2 PC2> ping 172.16.1.2
扩展测试命令:
# 跟踪路由路径 PC1> tracert 10.1.1.2 # 测试远程登录 PC1> telnet 192.168.1.14.3 常见问题排查
连接问题排查表:
| 问题现象 | 可能原因 | 解决方法 |
|---|---|---|
| ping不通网关 | 物理连接问题 | 检查网线连接状态 |
| ping不通网关 | 接口未激活 | 检查路由器接口是否"no shutdown" |
| ping不通对端PC | 路由缺失 | 检查路由器路由表"show ip route" |
| 串行链路不通 | 时钟未配置 | 确认DCE端配置了clock rate |
| 远程登录失败 | 密码错误 | 检查line vty密码配置 |
诊断命令参考:
# 查看接口状态 Router# show ip interface brief # 查看CDP邻居信息 Router# show cdp neighbors # 清除ARP缓存(PC端) PC1> arp -d5. 实验验证与结果分析
5.1 关键验证步骤
接口状态验证:
R0# show interfaces FastEthernet0/0 R0# show interfaces Serial0/0/0确认接口状态为"up/up"
路由表验证:
R0# show ip route确认存在到所有网段的路由
端到端连通性测试:
PC1> ping 10.1.1.2 PC2> ping 172.16.1.2
5.2 预期结果记录
连通性测试结果表:
| 测试源 | 测试目标 | 预期结果 | 实际结果 |
|---|---|---|---|
| PC1 | PC2 | 成功 | - |
| PC1 | PC3 | 成功 | - |
| PC2 | PC1 | 成功 | - |
| PC2 | PC3 | 成功 | - |
| PC3 | PC1 | 成功 | - |
| PC3 | PC2 | 成功 | - |
5.3 配置备份与保存
路由器配置保存:
Router# copy running-config startup-configPacket Tracer文件保存:
- 保存为.pkt文件,包含完整拓扑和配置
配置导出示例:
R0# show running-config R1# show running-config可以将输出复制保存为文本文件
编程学习
技术分享
实战经验