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

相关推荐
只会呼吸灯的小码农10 天前
sonic交换机之端口点灯
交换机·端口点灯
深念Y13 天前
光猫改桥接模式实战:通过Telnet获取超级管理员密码
ssh·路由器·桥接模式·逆向·光猫·telent·管理员密码
haosend15 天前
通俗易懂深入浅出OSPF-LSA类型讲解
路由器·交换机·数据网络·华三模拟器
haosend19 天前
传输网络概述:从PTN到SPN
路由器·交换机·spn·光传输·ptn
久绊A21 天前
H3C 交换机用户密码修改与策略管理指南
服务器·交换机·h3c
深念Y21 天前
腾达路由器无线中继模式:WISP与Client+AP什么意思
网络·wifi·智能路由器·路由器·ssid·腾达·无线中继
深念Y22 天前
OpenWrt路由器通过USB共享网络(随身WiFi/手机)简明教程
网络·智能手机·路由器·openwrt·数码·网络共享·流量
haosend24 天前
数据网络小知识-VLAN基础及延伸技术简介
路由器·vlan·交换机·数据网络
haosend1 个月前
IP计算不求人,掩码,反掩码,通配符一次学会
路由器·交换机·数据网络
haosend1 个月前
计算机基础百科-彻底搞懂子网掩码(Subnet Mask)与CIDR的地址掩码(Address Mask):从困惑到清晰
路由器·交换机·数据网络