思科配置路由器,四台主机互相ping通

一、如图配置

PC4和PC5用来配置路由器,各ip、接口如图所示。

二、配置各主机ip、子网掩码SNM、默认网关DGW

(一)、PC0

(二)、PC1

(三)、PC2

(四)、PC3

三、 配置路由器Router0

(期间报错是打错了字母)

复制代码
Router>en
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname MyRouter0
MyRouter0(config)#interface fa0/0
MyRouter0(config-if)#ip address 172.1.1.3 255.255.255.0
MyRouter0(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

MyRouter0(config-if)#ex
MyRouter0(config)#int fa0/1
MyRouter0(config-if)#ip address 192.168.1.1 255.255.255.0
MyRouter0(config-if)#no shutdown

MyRouter0(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

MyRouter0(config-if)#ex
MyRouter0(config)#ip route 172.2.2.0 255.255.255.0 192.168.1.2 
MyRouter0(config)#end
MyRouter0#
%SYS-5-CONFIG_I: Configured from console by console

四、配置路由器Router1

复制代码
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname MyRouter1
MyRouter1(config)#int f0/0
MyRouter1(config-if)#ip add 172.2.2.3 255.255.255.0
MyRouter1(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

MyRouter1(config-if)#ex
MyRouter1(config)#int fa0/1
MyRouter1(config-if)#ip add 192.168.1.2 255.255.255.0
MyRouter1(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

MyRouter1(config-if)#ex
MyRouter1(config)#ip route 172.1.1.0 255.255.255.0 192.168.1.1
MyRouter1(config)#end
MyRouter1#
%SYS-5-CONFIG_I: Configured from console by console

MyRouter1#

五、 命令总结

复制代码
confgure terminal  
hostname MyRouter0  
int f0/0  
ip address 172.1.1.3 255.255.255.0  
no shutdown   
ex   
int f0/1 
ip add 192.168.1.1 255.255.255.0 
no shut  
ex  
ip route 172.2.2.0 255.255.255.0 192.168.1.2   

六、ping效果


七、参考视频

计算机网络实验11-静态路由实验_哔哩哔哩_bilibili

相关推荐
haosend17 小时前
计算机基础百科-彻底搞懂子网掩码(Subnet Mask)与CIDR的地址掩码(Address Mask):从困惑到清晰
路由器·交换机·数据网络
haosend6 天前
【练习版】使用paramiko批量的查询,管理,配置路由器交换机
python·路由器·交换机·网络自动化
haosend7 天前
极简小白Python教程-实现能基本看懂和简单编写代码
python·路由器·交换机·网络自动化
Trouvaille ~14 天前
【Linux】网络层与IP协议详解:从地址到路由的完整指南
linux·运维·服务器·网络·tcp/ip·路由器·网络层
希赛网18 天前
2026华为认证数通HCIA备考知识:生成树协议的原理、选举过程与配置要点
服务器·网络·stp·交换机·2026华为认证数通考试·stp生成树的概念·stp常用配置
那就回到过去24 天前
交换机特性
网络·hcip·ensp·交换机
崎岖Qiu25 天前
【计算机网络 | 第二篇】三种交换方式和互联网的核心部分
网络·笔记·计算机网络·路由器
碎梦归途1 个月前
思科网络设备配置命令大全,涵盖从交换机到路由器的核心配置命令
linux·运维·服务器·网络·网络协议·路由器·交换机
交换机路由器测试之路1 个月前
交换机专题:什么是ALS(激光器自动关断)
运维·网络·以太网·交换机·节能
xixixi777771 个月前
无网通信——不依赖传统集中式蜂窝网络(如4G/5G基站)或互联网基础设施(如光纤、路由器) 的通信方式
网络·路由器·数据安全·通信·卫星通信·无网通信