From 776d6164610e41f027bb87170a9081620ba8fe64 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 31 Mar 2025 20:49:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Console=E9=85=8D=E7=BD=AE=E3=80=81Telnet?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=81SSH=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...343\200\201SSH\351\205\215\347\275\256.md" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "42\345\220\264\351\221\253\351\270\277/20250331Console\351\205\215\347\275\256\343\200\201Telnet\351\205\215\347\275\256\343\200\201SSH\351\205\215\347\275\256.md" diff --git "a/42\345\220\264\351\221\253\351\270\277/20250331Console\351\205\215\347\275\256\343\200\201Telnet\351\205\215\347\275\256\343\200\201SSH\351\205\215\347\275\256.md" "b/42\345\220\264\351\221\253\351\270\277/20250331Console\351\205\215\347\275\256\343\200\201Telnet\351\205\215\347\275\256\343\200\201SSH\351\205\215\347\275\256.md" new file mode 100644 index 0000000..440b1f4 --- /dev/null +++ "b/42\345\220\264\351\221\253\351\270\277/20250331Console\351\205\215\347\275\256\343\200\201Telnet\351\205\215\347\275\256\343\200\201SSH\351\205\215\347\275\256.md" @@ -0,0 +1,49 @@ +## Console密码配置 +- Switch> enable //进入特权模式 +- Switch# configure terminal //进入全局模式 +- Switch(config)# line console 0 //控制台线路模式,"0"表示第一个控制台接口 +- Switch(config-line)# password +密码 //设置控制台登录密码 +- Switch(config-line)# login //强制连接控制台时输入密码,若不配置不会生效 +- Switch(config-line)# end //直接退出所有配置模式,返回特权执行模式 +- Switch# show running-config //显示配置文件内容,用来检查配置是否生效, 特权模式 +- Switch# write //保存配置 +### 在 Cisco 设备中,以下密码默认以 **明文形式** 存储于配置文件中: +- 控制台密码 +- Telnet/VTY 密码 +- 特权模式密码 +- Switch(config)# service password-encryption // 对明文密码进行弱加密 +## Telnet配置 +- Switch>enable +- Switch#configure terminal +- Switch(config)#line vty 0 4 /进入虚拟终端线路配置模式(0-4表示5个并发远程连接) +- Switch(config-line)#password +密码 //设置Telnet登录密码 +- Switch(config-line)#login //启用密码验证(必须配置才能使密码生效) +- Switch(config-line)#transport input telnet //指定这些线路只接受Telnet连接 +- Switch(config-line)#exit //退出当前配置模式(返回上一级) +- Switch(config)#interface vlan 1 //进入VLAN 1接口配置模式(默认管理VLAN) +- Switch(config-if)#ip address 192.168.10.1 255.255.255.0 //为交换机设置管理IP地址和子网掩码 +- Switch(config-if)#no shutdown //激活该虚拟接口(默认交换机物理接口常开,但VLAN接口需手动激活) + ### 对特权模式也配置密码 + - Switch(config)# enable secret 222222 //加密密码 + - Switch#show running-config | include enable //可见密码被加密 + ## SSH配置 +- Switch(config)# hostname +主机名 //主机名(RSA密钥生成必需) +- SW1(config)# ip domain-name +域名 //域名(RSA密钥生成必需) +- SW1(config)# crypto key generate rsa //生成RSA密钥,可直接回车 +- SW1(config)# username +账户名 secret abc //创建本地用户admin,密码abc(SSH登录用) +- SW1(config)# line vty 0 4 +- SW1(config-line)# transport input ssh //只允许SSH +- SW1(config-line)# login local //使用本地用户认证 +- SW1# show ip ssh //确认SSH已启用 +### 连接 +- ssh -l admin +域名 + +## 练习 +- Console配置 +Console配置.png + +- Telnet配置 +Telnet配置.png + +- SSH配置 +SSH配置.png \ No newline at end of file -- Gitee From 4bd3f2bd82d15d38e2089ed5176149d468427983 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 1 Apr 2025 17:37:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E6=9C=BAVLAN=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...46\234\272VLAN\351\205\215\347\275\256.md" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "42\345\220\264\351\221\253\351\270\277/20250401\344\272\244\346\215\242\346\234\272VLAN\351\205\215\347\275\256.md" diff --git "a/42\345\220\264\351\221\253\351\270\277/20250401\344\272\244\346\215\242\346\234\272VLAN\351\205\215\347\275\256.md" "b/42\345\220\264\351\221\253\351\270\277/20250401\344\272\244\346\215\242\346\234\272VLAN\351\205\215\347\275\256.md" new file mode 100644 index 0000000..ee2df90 --- /dev/null +++ "b/42\345\220\264\351\221\253\351\270\277/20250401\344\272\244\346\215\242\346\234\272VLAN\351\205\215\347\275\256.md" @@ -0,0 +1,35 @@ +## 单交换机划分VLAN +- 默认所有端口都属于VLAN1 +- 管理交换机的VLAN通常通过端口来划分LVAN ID +- 只有同一个VLAN编号内的主机才可以互相通讯 +### 创建对应的VLAN ID +- Switch(config)#vlan 10 +- Switch(config-vlan)#exit +- Switch(config)#vlan 20 +- Switch(config-vlan)#exit +- Switch(config)#vlan 30 +- Switch(config-vlan)#exit + +**注:**给vlan改名字,默认是VALN0020 + +Switch(config)#vlan 20 + +Switch(config-vlan)#name students +### 查看VLAN的信息 +- Switch#show vlan brief +### 选择对应的接口,划入对应的VLAN编号 +- 单接口:Switch(config)#interface fastEthernet 0/1 // 选择一个接口 + +Switch(config-if)#switchport access vlan 10 //将接口划入VLAN10 ,access模式用来连接网络设备和主机电脑 + +- 连续的多接口:Switch(config)#interface range f0/2-3 // 连续的2到3 + +Switch(config-if-range)#switchport access vlan 10 +## 多交换机划分VLAN +- 交换机连接交换机的端接口要改成中继模式trunk + +Switch(config-if)#switchport mode trunk + +**注:**查看所有接口的信息: + +Switch#show interfaces status \ No newline at end of file -- Gitee