当前位置: 首页 > news >正文

思科配置路由器,四台主机互相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 upMyRouter0(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 shutdownMyRouter0(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upMyRouter0(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 upMyRouter1(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 upMyRouter1(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 consoleMyRouter1#

五、 命令总结

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

http://www.lryc.cn/news/376335.html

相关文章:

  • 个人博客测试用例设计
  • Java输入输出语句 和 保留字
  • 生成对抗网络——GAN深度卷积实现(代码+理解)
  • gbase8s数据库阻塞检查点和非阻塞检查点的执行机制
  • ARM32开发--串口库封装(初级)
  • 统一管理:Vue公共组件/公共样式/全局自定义指令
  • Linux之旅: 基础知识点的终极指南
  • C#部分方法有什么用处?和传统方法有什么区别?什么时候用合适?
  • elasticsearch hanlp插件远程词典配置
  • 力扣每日一题 6/18 字符串/模拟
  • 架构设计 - Nginx Proxy Cache 缓存配置
  • 【前端】HTML5基础
  • 9个最佳性能测试工具(2024)
  • RTthread+STM32F407ZGTx+烟雾报警检测+蜂鸣器报警+LED闪烁||使用RTthread Studio
  • k8s资源的基本操作
  • 19.面包屑导航制作
  • 做动画?Animatediff 和 ComfyUI 更配哦!
  • 笔记-python里面的xlrd模块详解
  • oracle将字符串中的字符和数字拆分开等功能
  • 汇编基础之使用vscode写hello world
  • APS计划排程系统如何打破装备使用约束
  • gigachad - suid
  • QtScript模块
  • qt中for循环不要使用循环中会更改的变量
  • spark独立集群搭建
  • 【BFS算法】广度搜索·由起点开始逐层向周围扩散求得最短路径(算法框架+题目)
  • 微信小程序---登录
  • IPython大师课:提升数据科学工作效率的终极工具
  • 抖音素材网站平台有哪些?素材下载网站库分享
  • MODBUS TCP协议实例数据帧详细分析