0基础入门网络工程师,交换机配置入门,交换机登录设备配置
一、基本配置
1、配置设备名称
我们拿到一台交换机设备默认设备名称为Huawei,右键设备启动按钮就可以启动设备,我们通过华为推荐的ENSP软件模拟器进行自学华为网络工程师。和真实设备配置几乎一样,省去购买网络设备学网络的成本。
<Huawei>//登录进去设备后 默认是用户模式
<Huawei>system-view//进入特权模式
[Huawei]sysname SW1//更改设备名称为SW1
2、配置设备系统时钟
设置时区的命令行为clock timezone XXX add | minus offset,time-zone-name用户定义的时区名,标识配置时区。add为正向偏移,minus为负向偏移。
<SW1>clock timezone BJ add 08:00//配置北京时区
配置好时区后就可以设置设备当前的日期和时间
<SW1>clock datetime ?// HH:MM:SS为时间
HH:MM:SS Specify the time
<SW1>clock datetime 12:12:12 ?//YYYY-MM-DD为日期
YYYY-MM-DD Specify the date from 2000 to 2099
<SW1>clock datetime 12:12:12 2021-12-12
配置完毕后查看显示的当前设备的日期
3、配置IP地址
我们可以通过console线连接console口、MiniUSB、及telnet登录设备配置,主流现网用的比较多的就是console和telnet,我们重点熟练使用这两个功能
1)、配置方法1
[SW1]interface MEth 0/0/1
[SW1-MEth0/0/1]ip address 192.168.1.254 255.255.255.0//配置接口IP地址192.168.1.254
2)、配置方法2
[SW1-MEth0/0/1]ip address 192.168.1.254 24//三个255可以使用24掩码长度表示
二、配置VTY telnet用户登录
1、VTY配置最大用户数
[SW1]user-interface maximum-vty ?最多允许15个用户同时telnet登录设备
INTEGER<0-15> The maximum number of VTY users, the default value is 5
2、配置VTY用户级别
[SW1]user-interface vty 0 14//进入VTY配置界面,对15个用户统一进行配置
[SW1-ui-vty0-14]user privilege level 2//配置用户级别为2
[SW1-ui-vty0-14]authentication-mode aaa//配置验证方式为aaa
3、配置AAA的用户名密码
[SW1-aaa]local-user bert password cipher bert@123//配置AAA的用户名密码
[SW1-aaa]local-user bert service-type telnet//配置类型为telnet
可以顺利telnet登录设备,测试成功后只要网络可达,其他设备就可以正常telnet登录
<SW1>display users//查看登录的用户
三、配置Console
Console一般用于管理员登录调试,所以我们配置最高的级别权限。用password验证
[SW1]user-interface console 0//进入console口进行配置
[SW1-ui-console0]user privilege level 15//配置登录级别为最高级别15
[SW1-ui-console0]authentication-mode password//配置密码认证
[SW1-ui-console0]set authentication password cipher bert@123//配置认证密码
display current-configuration 查看配置,默认配置保存在设备内存中需要save进行存盘。
[SW1]display current-configuration
sysname SW1
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user bert password cipher +\[+!7+L9Q-NZPO3JBXBHA!!
local-user bert service-type telnet
local-user admin password simple admin
local-user admin service-type http
interface Vlanif1
ip address 192.168.2.254 255.255.255.0
interface MEth0/0/1
ip address 192.168.1.254 255.255.255.
user-interface maximum-vty 15
user-interface con 0
authentication-mode password
user privilege level 15
set authentication password cipher MJ%#~O(rV%'eKRQqbl+Ohg{#
user-interface vty 0 14
authentication-mode aaa
user privilege level 2
#pgc-card .pgc-card-href { text-decoration: none; outline: none; display: block; width: 100%; height: 100%; } #pgc-card .pgc-card-href:hover { text-decoration: none; } /*pc 样式*/ .pgc-card { box-sizing: border-box; height: 164px; border: 1px solid #e8e8e8; position: relative; padding: 20px 94px 12px 180px; overflow: hidden; } .pgc-card::after { content: " "; display: block; border-left: 1px solid #e8e8e8; height: 120px; position: absolute; right: 76px; top: 20px; } .pgc-cover { position: absolute; width: 162px; height: 162px; top: 0; left: 0; background-size: cover; } .pgc-content { overflow: hidden; position: relative; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .pgc-content-title { font-size: 18px; color: #222; line-height: 1; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pgc-content-desc { font-size: 14px; color: #444; overflow: hidden; text-overflow: ellipsis; padding-top: 9px; overflow: hidden; line-height: 1.2em; display: -webkit-inline-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pgc-content-price { font-size: 22px; color: #f85959; padding-top: 18px; line-height: 1em; } .pgc-card-buy { width: 75px; position: absolute; right: 0; top: 50px; color: #406599; font-size: 14px; text-align: center; } .pgc-buy-text { padding-top: 10px; } .pgc-icon-buy { height: 23px; width: 20px; display: inline-block; background: url(https://lf3-cdn-tos.bytescm.com/obj/cdn-static-resource/pgc/v2/pgc_tpl/static/image/commodity_buy_f2b4d1a.png); } #pgc-card .pgc-card-href { text-decoration: none; outline: none; display: block; width: 100%; height: 100%; } #pgc-card .pgc-card-href:hover { text-decoration: none; } /*pc 样式*/ .pgc-card { box-sizing: border-box; height: 164px; border: 1px solid #e8e8e8; position: relative; padding: 20px 94px 12px 180px; overflow: hidden; } .pgc-card::after { content: " "; display: block; border-left: 1px solid #e8e8e8; height: 120px; position: absolute; right: 76px; top: 20px; } .pgc-cover { position: absolute; width: 162px; height: 162px; top: 0; left: 0; background-size: cover; } .pgc-content { overflow: hidden; position: relative; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .pgc-content-title { font-size: 18px; color: #222; line-height: 1; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pgc-content-desc { font-size: 14px; color: #444; overflow: hidden; text-overflow: ellipsis; padding-top: 9px; overflow: hidden; line-height: 1.2em; display: -webkit-inline-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pgc-content-price { font-size: 22px; color: #f85959; padding-top: 18px; line-height: 1em; } .pgc-card-buy { width: 75px; position: absolute; right: 0; top: 50px; color: #406599; font-size: 14px; text-align: center; } .pgc-buy-text { padding-top: 10px; } .pgc-icon-buy { height: 23px; width: 20px; display: inline-block; background: url(https://lf3-cdn-tos.bytescm.com/obj/cdn-static-resource/pgc/v2/pgc_tpl/static/image/commodity_buy_f2b4d1a.png); }