show running-config sh run
show startup-config sh star //查看配置文件//
copy running-config startup-config //保存配置文件//
erase nvram //刪除配置文件//
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
路由器和交換機的密碼設置
配置console密碼
全局模式下
line console 0
passwd 密碼
login
配置特權模式密碼
全局模式下
enable passwd 密碼 ==enable secret 密碼 //secret配置的密碼是密文的,當兩個密碼都配置,secret配置的生效//
全局模式下
service password-encryption //吧密碼全部加密爲密文//
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
路由器的密碼恢復
1.重啓路由器,並同時按下ctrl+breack,路由器將進入rom monitor模式
2.confreg 0x2142 //將配置寄存器的值改爲2142//
3.reset
4.copy startup-config running-config //進入配置模式,將配置文件加載過來//
5.通過sh run查看路由器配置了哪些密碼,並更改//
6.config-register 0x2102 //將寄存器的值修改回來,按exit保存退出//
7.copy running-config startup-config
--------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
交換機的密碼恢復
1.拔掉交換機插頭,重啓
2.插好插頭,立刻按住交換機和是哪個的“mode”鍵,當看到顯示“switch”可鬆開“mode”
3.flash_init //初始化flash//
4.rename flash:config.text flash:config.old //可以通過dir查看config.text//
5.boot //重啓//
6.rename flash:config.old flash:config.text //吧配置命令該回來//
7.copy flash:config.text system:running-config //加載配置文件//
-----------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
遠程管理的條件
1配置ip地址 交換機上配置管理地址
2配置vty密碼
全局模式下
line vty 0 4 //0 4 標誌允許同時進入vty0,vty1,vty2,vty3,vty4五個虛擬端口//
passwd 密碼
login
配置特權密碼
可以通過telnet遠程
如果交換機和管理員ip不在同意網段,就需要配置交換機的默認網關
全局模式下
ip default-gateway 192.168.2.254