From cfe0c2b1b310bdc5e0c154eebe755ef78bc18258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=99=E8=8B=8F=E6=96=87?= <12071386+que-su-wen@user.noreply.gitee.com> Date: Tue, 16 Apr 2024 12:09:41 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 阙苏文 <12071386+que-su-wen@user.noreply.gitee.com> --- .../20240416\347\254\224\350\256\260.md" | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 "22 \351\230\231\350\213\217\346\226\207/20240416\347\254\224\350\256\260.md" diff --git "a/22 \351\230\231\350\213\217\346\226\207/20240416\347\254\224\350\256\260.md" "b/22 \351\230\231\350\213\217\346\226\207/20240416\347\254\224\350\256\260.md" new file mode 100644 index 0000000..76aa174 --- /dev/null +++ "b/22 \351\230\231\350\213\217\346\226\207/20240416\347\254\224\350\256\260.md" @@ -0,0 +1,93 @@ +#### 技术原理 + +1.二层交换机依赖于链路层中的信息(如MAC地址)完成不同端口数据间的线速交换 + +2.按功能复杂性可分为非网管型和网管型交换机 + +#### 快捷方式 + +~~~~0 +补充命令:Tab +返回特权模式:ctrl+Z 或 end命令 +ping 或 traceroute 之类的进程:ctrl+shift+6 +放弃当前命令并退出配置模式:Ctrl-C +~~~~ + +#### 查看命令 + +~~~ js +查看当前所有的配置信息:# show rubning-config +查看一个端口号:# shou f0/1 +查看所有端口号:# show interfaces +查看交换机记录的mac地址:# show mac-address-table +~~~ + +###### 把do放在其他命令前表示将命令临时用特权模式运行(相对于一次性) + +#### 修改接口对的通信方式和速度 + +~~~ js +(config)# int f0/1 +(config-if)# speed 100 //速率 +(config-if)# duplex full //全双工 + auto //自动 + half //半双工 +~~~ + +#### 进入多个端口 + +int range f0/1-10 简写:int r f0/1-10 + +#### 给密码加密 + +(config)# service password-encryption + +#### 加密码 + +~~~js +明文:enable password 666 +密文:enable secret 666 +~~~ + +#### console端口设置密码 + +~~~ js +(config)#line console 0 +(config-line)#password 666 +(config-line)#login //开启密码登录 +(config-line)#no login //关闭密码登录 +~~~ + +#### 保存配置信息 + +#write + +#### 重启设备 + +#reload + +#### 常见的错误 + +~~~js +(config)#router ospf +% Incomplete command. // 命令不完整、或缺少参数 +~~~ + +~~~js +(config)#router ospd 1 + ^ +% Invalid input detected at ‘^’ marker. !! // 箭头所指字符无法识别,可能输 +入有误 + +~~~ + +~~~js +(config)#s +% Ambiguous command: `s` !! //未知的输入 +~~~ + +~~~js +Switch>hostname ? +% Unrecognized command // 不被支持的命令,一般是模式不对 +~~~ + -- Gitee