一、学习目标
二、交换机
1)作用
用于将多台计算机/交换机连接到一起,组建网络
交换机负责为其中任意两台计算机提供独享线路进行通信
连接电脑组建局域网(组建局域网的主要设备)
2)类型
非网管(即插即用),便宜,不可管理
网管(智能),较贵,可以方便管理(隔离、限速、ACL、堆叠)
3)在工作中如何能够配置多种类型的交换机设备
1、搜索:www.huawei.com
2、服务器支持→产品支持
3、选择想要查找的交换机型号
三、部署ENSP平台
1)eNSP:华为的网络设备仿真平台(交换机、路由器、防火墙、wifi、电脑)
2)进入物理交换机配置界面
使用console线一端连接交换console口,另一端连接计算机USB或com口,Putty、SecureCRT、Xshell等终端程序进入设备的配置界面。
四、交换机组建局域网
五、认识配置视图
1)认识设备的配置视图
<Huawei> 用户视图 【查看运行状态】
[Huawei] 系统视图 【配置设备的系统参数】
[Huaiwei-GigabitEthernet0/0/1] 接口视图 【配置接口参数】
[Huawei-ospf-1] 协议视图 【配置XX协议】
2)切换视图
<Huawei> //用户视图
<Huawei> system-view //进入系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei] //系统视图
[Huawei] interface GigabitEthernet 0/0/1 //进入接口视图
[Huawei-GigabitEthernet0/0/1] //接口视图
3)退回视图
① quit 退回到上一个视图(逐级退回)
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]quit
<Huawei>
② return或者 快捷键Ctrl+Z 直接返回到用户视图
[Huawei-GigabitEthernet0/0/3]return
4)操作技巧
① 命令是不区分大小写的
② 按?可以获取到帮助信息
方法一:直接在视图上敲?(在该视图上能够敲的命令有哪些)
方法二:问命令全拼 (例如:s?)
方法三:问命令后面能跟哪些命令(例如:interface ?)
③ 命令可以简写
④ 按TAB键自动补全
六、交换机基本配置命令
1、display version //查看系统版本信息
<Huawei>display version
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.110 (S5700 V200R001C00)
备注:设备系统,版本,型号
Copyright (c) 2000-2011 HUAWEI TECH CO., LTD
Quidway S5700-28C-HI Routing Switch uptime is 0 week, 0 day, 1 hour, 25 minutes
备注:查看设备的开启时长(week=周,day=天,hour=小时,minutes=分钟)
2、language-mode Chinese //切换语言模式为中文
<Huawei>language-mode Chinese
Change language mode, confirm? [Y/N] y
备注:更改语言模式,确认吗?Y确认
提示:改变语言模式成功。
<Huawei>language-mode English //切换语言模式为英文
3、sysname 设备名 //配置设备名称
[Huawei]sysname SW1 修改设备名为SW1
设备命名规范:部门-位置-机架编号[还是要根据公司规定的命名规范进行命名]
4、undo shutdown //开启接口 shutdown //关闭接口
[SW1-GigabitEthernet0/0/1]**undo shutdown
Feb 16 2023 15:48:28-08:00 SW1 %%01PHY/1/PHY(l)[3]:GigabitEthernet0/0/1: cha
nge status to up 接口已开启
[SW1-GigabitEthernet0/0/1]shutdown
Feb 16 2023 15:51:16-08:00 SW1 %%01PHY/1/PHY(l)[4]:GigabitEthernet0/0/1: cha
nge status to down 接口已关闭
5、undo terminal monitor //取消终端提示
<SW2>undo terminal monitor //取消终端提示
Info: Current terminal monitor is off.
提醒:当前终端提示已经关闭
<SW2>terminal monitor //开启终端提示
Info: Current terminal monitor is on.
提示:当前终端提示已经开启
<SW2>u t m //取消终端提示简写
Info: Current terminal monitor is off.
6、display this //查看当前视图配置
display current-configuration //查看当前有效配置
[Huawei-GigabitEthernet0/0/1] display this
<Huawei> display current-configuration
7、save //保存配置
<Huawei>save
The current configuration will be written to the device.
当前配置将要被写入到设备中**
Are you sure to continue?[Y/N]y 你确定要继续嘛?
......
Save the configuration successfully.配置保存成功
8、设置交换机闲置会话时间
user-interface console 0 //进终端进行配置
[SW1]user-interface console 0 //进终端进行配置
[SW1-ui-console0]idle-timeout 1 //将闲置会话时间设置为1分钟
9、设置终端密码
[SW1]user-interface console 0 //进入终端进行配置
[SW1-ui-console0]authentication-mode password //启用密码认证
[SW1-ui-console0]set authentication password simple 123456 //设置终端密码为123456(明文)
[SW1-ui-console0]set authentication password cipher 123456 //设置终端密码为123456(密文)
想要验证密码,在用户视图中直接敲入quit即可退出会话
10、重启终端
<SW1>reboot //重启终端
Warning: All the configuration will be saved to the configuration file for the n
ext startup:flash:/vrpcfg.zip, Continue?[Y/N]:Y //提示是否保存当前配置,选择是Y/否N
.......
System will reboot! Continue?[Y/N]:Y //提示设备是否要重启,选择是Y/否N
11、恢复出厂设置
<SW1>reset saved-configuration //恢复出厂设置
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y //是否要回复出厂设置
..........
Info: Succeeded in clearing the configuration in the device.
<SW1>reboot //重启终端
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n //提示是否保存当前配置,选择是Y/否N
...........
System will reboot! Continue?[Y/N]:y //提示设备是否要重启,选择是Y/否N