思科配置路由器,四台主机互相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

相关推荐
十月ooOO1 小时前
小米AX3000T 路由器如何开启 SSH 安装 OpenWRT 系统,不需要降级 v1.0.91 (2025)
网络·ssh·路由器·openwrt
Hmi12346 天前
「原创」Xiaomi-R3 免刷Openwrt实现路由器锐捷认证 (含网络守护脚本)
路由器
昂辉科技9 天前
[AUTOSAR通信] - PDUR模块解读
架构·汽车·路由器·autosar·通信·pdur·工具链
一只小灿灿15 天前
路由器及工作原理与常用路由配置命令详解
网络·路由器
zeruns80225 天前
爱快 IK-W35 面板式AP 简单开箱评测和拆解,双频WiFi6 AX3000,2.5G网口
5g·wifi·路由器·无线路由器·爱快·ik-w35
zeruns8021 个月前
2.5G交换机 TL-SE2420 简单开箱评测,16个2.5G电口+4个10G光口(SFP+)
网络·交换机·2.5g
zeruns8021 个月前
2.5G PoE交换机 TL-SE2109P 简单开箱评测,8个2.5G电口+1个10G光口(SFP+)
交换机·2.5g·poe·tplink·普联
秋说1 个月前
【网络协议】交换机概念与配置(第一部分)
网络协议·交换机
秋说1 个月前
【网络协议】ACL(访问控制列表)第一部分
网络协议·网络安全·路由器·acl
凡许真2 个月前
RabbitMQ生产消息【交换机、路由键】与消费消息的简单使用
分布式·rabbitmq·消费·交换机·生产·路由键