设备管理方式
本地管理
- 通过 console 口进行管理, 使用 console 线
- 默认情况下, 是不需要密码的
- 为了安全, 配置密码
1. 确定当前的设备管理方式: show user
2. 在 console 口下配置密码;
- line console 0
- password nihao
3. 在 console 口下启用认证功能;
- line console 0
- login
4. 验证与测试
show running-config
退出设备, 再次登录, 应该是需要密码的
远程管理
特权密码配置
- 默认情况下, 用户模式进入特权模式, 是不需要密码的
- 为了安全, 配置特权密码
1.enable password nihao, 该方式配置的密码为明文
2.enable secret wobuhao, 配置的密码为密文
-enable secret 优先级高于 enable password;
- 删除 "特权密码"
R1(config)#no enable password 或 no asecret password
注意:
为了设备中的所有密码, 都能够以加密的方式存在
我们为设备开启了密码加密服务 (默认该服务关闭状态)
R1(config)#service password-encrytion
当开启该服务后, line console 和 vty 下面的密码都以加密的形式
存在于 running-config 中
密码破解
- 针对路由器
# 核心: 配置寄存器
默认值为 0x2102
为了实现密码破解, 需要更改寄存器的值为 0x2142, 目的是
为了: 在启动过程的中, 跳过查找并加载配置文件的步骤;
- # 配置命令:
- R1(config)#config-register 0x2142 // 重启之后才会生效
- # 验证命令
- show version // 查看设备的配置寄存器
- reload // 设备重启命令
- # 破解步骤
0. 设备加电, 并一直按下组合键: ctrl+break;
此时设备会进入到 romm 模式 (类似 pc 的安全模式)
1. 修改配置寄存器值为 0x2142, 并重启设备
romm1>confreg 0x2142 或者 room2> O/r 0x2142
room2>reset// 在 room 模式下重启设备
设备重启以后进入到 "系统对话框配置" 模式,
进行选择 - no
随后进入到用户模式
2. 将启动配置文件 copy 到内存中:
copy startup-config running-config
3. 修改配置文件中的密码;
4. 将配置寄存器修改为默认值: 0x2102
5. 保存配置: write
6. 将设备重启: reload
交换机密码破解:
- 本质: 让交换机在启动过程中查找配置文件的名字的时候,
找不到对应文件名的文件 (该文件是: config.text)
- 破解步骤:
1, 设备加电, 并一直不停的按 mode 键, 设备进入到 switch:
模式 ;
2, 在 switch: 模式下输入 flash_init 命令;
3, 查找, 更改并验证配置文件名字已经修改为其他名字;
- switch:dir
- switch:rename {
- source-file
- } {
- destination-file
- }
比如:
- rename flash:config.text flash:111
- switch: dir // 验证文件名字是否更改成功;
4, 重启设备 : switch : boot // 在交换机的 romm 模式重启设备
5, 进入到设备的 "特权模式", 确定并修改配置文件名字为
- config.text
- Switch# dir
- Switch# rename flash:111 flash:config.text
- Switch# dir
6, 将启动配置文件 复制到 内存中:
Switch# copy startup-config running-config
7, 修改交换机的密码;
8, 保存配置;
案例 2:
1, 配置 PC
- ip - 192.168.1.2
- mask - 255.255.255.0
- gateway - 192.168.1.1
2, 配置网关
- interface gi0/0 // PC 的网关端口 IP 地址;
- no shutdown
- ip address 192.168.1.1 255.255.255.0
- interface gi0/1 // 交换机 SW1 的网关端口 IP 地址;
- no shutdown
- ip address 10.0.0.1 255.255.255.0
3, 配置交换机
- # 配置管理 IP 地址;
- interface vlan 1
- no shutdown
- ip address 10.0.0.2 255.255.255.0
- # 配置交换机的默认网关;
- ip default-gateway 10.0.0.1
4, 配置远程访问所需要的相关参数;
- # 配置 VTY 密码;
- line vty 0 4
- password nihao
- # 配置 特权密码;
- enable password / secret cisco
5, 验证与测试
PC - 接口 IP 地址;
网关 - show ip interface brief
- switch - show ip interface brief / show running-config
- PC:
- telnet 10.0.0.2
- password : nihao
erase nvram: 删除启动配置文件;
erase flash: 删除 iOS ;
思科设备安装 iOS:
1,console 线 --- xmodem , 速度极慢;
2,tftp : 在设备无法正常启动 iOS 时, 也会进入到 romm 模式,
该模式下, 是支持 TFTP 功能的;
复习思路
来源: http://www.bubuko.com/infodetail-2984558.html