posts - 15,comments - 0,views - 1227

第二章 设备原理与操作

设备硬件架构

image.png

ROM(Read-Only memory)

功能

启动系统,密码恢复、系统升级或恢复

组成

  1. POST程序:用于实现加点自检(Power-on Self-test)
  2. BootStrap程序:引导程序,用于引导加载操作系统
  3. Rommon程序:用于做密码恢复级系统升级

NVRAM

功能

放置配置文件+配置寄存器(configuration register)

配置寄存器的功能

用于影响路由器的启动流程

0x2102:正常加载操作系统并加载配置文件

0x2142:正常加载操作系统但不加载配置文件

#路由器#​和#交换机#​的启动

路由器

  1. 加电自检(POST)
  2. 从ROM中加载并运行Bootstrap微代码
  3. 查看NVRAM中的配置寄存值
  4. 从FLASH中寻找IOS映像
  5. 从RAM加载IOS映像
  6. 从VNRAM中寻找配置文件
  7. 从RAM加载配置文件
  8. 正常运行

交换机

  1. 加电自检(POST)
  2. 从ROM中加载并运行BOOTstrap微代码
  3. 寻找IOS映像文件
  4. 加载IOS映像文件
  5. 寻找配置文件
  6. 加载配置文件
  7. 正常运行

设备基础互联

设备连接方式

  1. 近端管理(带外管理)———— console线

  2. 远程管理(带内管理)———— telnet/Http

设备连接线缆

光纤

  1. 单模光纤:速度快,距离远,黄色

  2. 多模光纤:速度慢、距离近、橙色

网线(以太网线)

线序:

568B : 橙白 橙 绿白 蓝 蓝白 绿 棕白 棕

568A : 绿白 绿 橙白 蓝 蓝白 橙 棕白 综

两种线序关联:1-3, 2-6对调; 1/2/3/6是实际通信网芯,其他做备份

连线规则:

同级/层设备交叉线,不同级/层设备直通线

GNS3

#IOS#​基础

IOS操作模式

  • (0-1)>用户模式:普通用户,级别最低
  • (2-14)# 特权模式:管理员,级别中等
  • (15)config# 配置全局模式:超级管理员,级别最高
  • enable:使能,用户模式切换到特权模式
  • configure terminal:“配置终端”从特权模式切换到配置全局模式
  • exit:“退出”,从配置退回到特权,从特权到用户

快捷键

  • Ctrl + A 光标前移
  • Ctrl + E 光标后移
  • Ctrl + Z 退出,功能类似end命令
  • Ctrl + shift + 6 命令中断
  • Ctrl + Tab 标签切换
  • Alt + 序号 标签切换

IOS常用命令

用户模式

  • ping
  • traceroute 链路追踪
  • show arp 查看arp表
  • show clock 查看系统时间
  • show version 查看系统版本

特权模式

  • show flash: 查看硬盘大小
  • show running-config 查看运行配置(内存)
  • show startup-config 查看启动配置(NVRAM)
  • copy run start 保存配置
  • write 保存配置
  • show ip interface brief 查看三层接口IP信息
  • show interface f0/0 查看接口具体信息(包括二层)

配置模式

  • hostname R1 定义主机名
  • interface f0/0 进入接口
  • no shutdown 打开接口
  • ip address ip地址 子网掩码

配置虚拟终端(vty)--- server端

R2(config)#line vty 0
R2(config-line)#pass
R2(config-line)#password 123456
R2(config-line)#login
R2(config-line)#

接口类型

  • f:fastethernet 快速以太网
  • e:Ethernet 以太网
  • s:serial 广域网

接口序号

例:f0/0

  • 前面数值模块号
  • 后面数值接口/端口号

image.png

补充命令

  • no ip domain lookup 关闭域名解析
  • line console 0 进入console模式
  • exec-timeout 0 0 关闭发呆超时(exec-timeout 2 30 代表2分30秒踢出用户)
  • no logging synchronous 关闭日志干扰
  • no privilege level 15 关闭用户权限

#IOS#​进阶操作

管理密码<密码的配置及破解>

密码配置

  • 近端登录
R1(config)#lin con 0
R1(config-line)#pass
R1(config-line)#password 123456
R1(config-line)#login
  • 远端登录(VTY)
R1(config)#line vty 0 5 //六个用户可以同时登录
R1(config-line)#password 123456
R1(config-line)#login
R1(config-line)#
  • 用户名+密码
复杂的模式会代替简单的模式
R1(config)#username xiongmao password 123456
R1(config)#username kongfu password 123456
R1(config)#line console 0
R1(config-line)#login local
R1(config-line)#exit
  • 用户名+密码密文存储
R1(config)#username kongfu secret 123456
R1(config)#username panda secret 123456
R1(config)#line console 0
R1(config-line)#login local
R1(config-line)#exit
  • 特权密码
R1(config)#enable secret 123456       //加密
R1(config)#enable password 123456
  • 全局加密服务
R1(config)#service password-encryption

密码破解

  • 路由器密码破解
  1. 正常模式下重启(reload),并按住Ctrl+break键进入rommon模式
  2. rommon模式修改寄存值0x2142
rommon>confreg 0x2142
  1. rommon模式下重启
rommon>reset
  1. 正常模式下将配置文件加载到内存,并进行密码管理
R1(config)#copy startup-configure running-configure
R1(config)#show running-configure
R1(config)#no username **
R1# write
  1. 配置模式下将寄存值修改为0x2102
R1(config)# config-register 0x2102
  1. 正常模式下重启
R1(config)# reload
  1. 密码恢复成功

管理配置

  • 保存
copy run start
write
  • 恢复
copy start run   //路由器
copy flash:config.text run   //交换机

copy tftp: run
copy tftp: start
  • 删除
no + 命令
write erase  后 reload       //删除全部配置
  • 备份
copy run tftp:
copy start tftp:

管理IOS镜像文件

  • 备份IOS文件
copy flash:tftp:
boot system flash:指定镜像
  • 删除IOS镜像文件
delete flash:
  • 恢复IOS文件
copy tftp:flash:
  • 不正常恢复
rommon1> IP_ADDRESS=12.1.1.1
rommon1> IP_SUBNET_MASK=255.255.255.0
rommon1> DEFAULT_GATEWAY=12.1.1.2
rommon1> TFTP_SERVER=12.1.1.2
rommon1> TFTP_FILE=
rommon1> set        //检查上面命令是否正确
rommon1> tftpddnld
rommon1> reset
posted on   熊猫爱旅行  阅读(44)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示