交换机配置
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Switch>enable
进入特权模式
(switch#)
Switch#
show running-config(
简写
run)
查看当前配置信息
Switch#
show version
查看系统中的版本信息
Switch#
copy run start
保存配置
Switch#
write
保存配置
Switch#
show cdp neighbors
查看
cdp
邻居(附近接的交换机)
Switch#
show cdp trffic
邻居流量,邻居统计信息和公告数
Switch#
show interfaces f0/1
查看接口信息
Switch#
mac-address-table aging-time
恢复出厂值
Switch#
reload
重启
………(Y/N)“N”
Switch#
conf t
进入全局配置模式(
switch(config)#
)
Switch(config)#
hostname benet
修改名称
Switch(config)#
enable password
密码
设置密码,从用户模式到特权模式的密码
Switch(config)#
enable secret
密码
设置密码,从用户模式到特权模式的密码,此密码优先级高,加密存储
Switch(config)#
no enable secret
密码
清除密码
Switch(config)#
ip name-server <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.1.1.1
指定域名服务器的
IP
Switch(config)#
ip default-gateway 2.2.2.2
指定默认网关的
IP
Switch(config)#interface f0/1
进入端口模式
Switch(config-if)#
duplex full
全双工
Switch(config-if)#
duplex half
半双工
Switch(config-if)#
duplex auto
自动
Switch(config-if)#
speed 100
设置速度为
100M
Switch(config-if)#
speed?
查看命令寻求帮助
Switch(config)#int vlan1
进入虚拟接口,进入接口的命令来进入
Switch(config-if)#
ip address 192.168.1.1 255.255.255.0
配置接口的
IP
地址和掩码
Switch(config-if)#
no shutdown
开启此端口
远程连接
方法:
Switch(config)#int vlan1
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no sh
Switch(config)#line vty 0 15
开启虚拟终端(在真机上是
#line vty 0 4
)
0~4 5
个端口
Switch(config-line)#login
开启
登录
Switch(config-line)#password cisco
设置远程密码
在客户端电脑
:C:\>telnet 192.168.2.1
连接
注:
C:\>WINIP
配
IP
路由器配置
Route#sh ip int brie
查看路由器所有接口的汇总信息
Route#sh ip route
查看路由表
Route#sh controllers serial 0
检查接口是否是
DCE
(时钟频率同步提供端)
谁是
DCE
就打以下命令:
Route(config)#int s0
Route(config-if)#clock rate 64000
Route(config)#ip route
目标网段(非直连网段)
掩码
下一跳地址
步骤:
1
、
Router>en
2
、
Router#conf t
3
、
Router(config)#hostname r1
4
、
r1(config)#int s0
5
、
r1(config-if)#ip add 192.168.12.1 255.255.255.0
6
、
r1(config-if)#no sh
7
、
r1(config-if)#exit
8、r1(config)#int e0
9、r1(config-if)#ip add 192.168.1.1 255.255.255.0
10、r1(config-if)#no sh
11、r1(config-if)#exit
12、r1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.3
13、r1(config)#ip route 192.168.3.0 255.255.255.0 192.168.12.3
14、r1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.3
15
、
r1#sh controllers serial 0
16
、
r1#sh ip route
17、r1#ping 192.168.2.1
例:路由器忘记密码:
1
、重启
ROUTE
2
、按下
ctrl+Pause/Break
3
、进入
rommon1>
rommon1>confreg
0
×2142
rommon1>reset
密码清除
在特权模式下
#
#copy tftp startup
上传配置
#copy startup tftp
下载配置
#copy flash tftp
下载
OS
#copy tftp flash
上传
OS
#copy run start
保存配置
#copy start run
导出配置到内存
#show flash
查看操作系统的名称
转载于:https://blog.51cto.com/yuanyuan0122/17534