华为设备基本操作
一、实验拓扑
实验拓扑
二、基本功能配置
1.查看系统
display
version显示版本号,型号,启动时间
2.配置设备console密码,主机名,时间,时区,banner
system-viewà进入系统视图模式,相当于思科的全局配置模式
Enter system view, return user view withCtrl+Z.
在系统视图模式,可以用ctrl+Z,quit,return推出系统视图模式,如下图所示
system-view
Enter system view, return user view withCtrl+Z.
[Huawei]sysname
R1à在系统视图模式下面,命名主机名为R1
[R1]
[R1]header ?
login Specify the
loginauthentication banner
shell Specify the
start banner ofsession
[R1]header login information
"HelloWold!"à配置登录banner,如telnet
[R1]header shell information "Welcometo
HW"à配置登录banner,如console
[R1]user-interface console
0à进入console
0,默认无密码
[R1-ui-console0]authentication-modepassword
[R1-ui-console0]set authentication passwordcipher
Huaweià配置一个密文模式的密码(可以选择明文simple)
[R1-ui-console0]idle-timeout 20
30à配置空闲超时时间为20分钟30秒,默认为10分钟。
[R1]q
q User interface con0 isavailable
Please Press ENTER.
Hello Wold!
Login authentication
Password:
Welcome to HW
display
clockà显示时间系统
2015-04-29 11:36:15-08:00
Wednesday
Time Zone(China-Standard-Time) : UTC-08:00
clock timezone GMT add
08:00:00à配置时区
clock datetime
11:11:112011-11-11à配置系统时间
display clock
2011-11-11 11:11:16+09:00
Friday
Time Zone(GMT) :UTC+09:00
[R1]super password cipher
Huaweià配置super密码,防止用户非法提升权限
[R1]display current-configuration |
includesuperà查看密码
super password level 3
cipher;v+fT!."#Jpe}@HMNPn@@c!#
[R1]
3.配置接口地址
[R1]display interface
briefà查看接口状态
[R1]display interface Ethernet
0/0/0à查看接口详细信息
[R1]interface
e0/0/0à进入接口模式(接口默认是UP的,可以使用shutdown关闭,也可以使用restart开启)
[R1-Ethernet0/0/0]ip add
12.1.1.1255.255.255.0à配置IP地址
[R1-Ethernet0/0/0]display ip
interfacebriefà查看接口的三层信息
按照相同的方法配置R2,的IP地址。
4.telnet的配置
[R1]user-interface vty 0
4à进入先下模式
[R1-ui-vty0-4]set authentication passwordcipher
Huawei配置密码
[R1-ui-vty0-4]
[R1-ui-vty0-4]display telnet server
statusà查看telnetserver状态
TELNET IPv4
server
:Enable
TELNET IPv6
server
:Enable
TELNET server
port
:23
TELNET server source
address
:0.0.0.0
[R1-ui-vty0-4]
此时无法进入系统视图模式,要输入super密码
display
users查看用户信息
配置用户名+密码模式
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
[R1-ui-vty0-4]q
[R1]aaa
[R1-aaa]local-user jet password cipherhuawei privilege
level 15
[R1-aaa]local-user jet service-type telnet
5.SSH配置
[R1]rsa local-key-pair
createà生成RSA密钥
[R1]display rsa local-key-pair
publicà查看密钥
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode
aaa
[R1-ui-vty0-4]protocol inbound ssh
[R1-ui-vty0-4]q
[R1]aaa
[R1-aaa]
[R1-aaa]local-user llk password cipher Huawei
[R1-aaa]local-user llk service-type ssh
[R1-aaa]local-user llk privilege level 3
[R1]stelnet server
enableà开启stelnet功能
Info: Succeeded in starting the Stelnetserver.
[R1]
[R1]ssh user llk
authentication-typepassword-à配置SSH登录用户名服务类型
Info: Succeeded in adding a new SSH user.
[R1]
[R1]display ssh server status
6.查看、保存、清空、重启路由器
[R1]display
current-configurationà查看配置
#
sysname R1
#
super password level 3
cipher;v+fT!."#Jpe}@HMNPn@@c!#
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user jet password
cipherJ57zW7_P\!pe}@HMNPn@>PQ#
local-user jet privilege level
3
local-user jet service-type
telnet
local-user llk password
cipherVJR*GyS462ani^>"qh^;Go,#
local-user llk privilege level
3
local-user llk service-type
ssh
local-user admin password
cipherOOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type
http
local-user cisco password
cipher/8i4IQ_NDW3@9_G-B0Y2J/"#
local-user cisco privilege level
3
local-user cisco service-type
ssh
local-user huawei password
cipher:Y3xA/+P0Xani^>"qh^;&M_#
local-user huawei privilege level
3
local-user huawei service-type
ssh
#
firewall zone Local
priority 16
#
interface Ethernet0/0/0
ipaddress 12.1.1.1
255.255.255.0
#
interface Ethernet0/0/1
#
interface Serial0/0/0
link-protocol ppp
#
interface Serial0/0/1
link-protocol ppp
#
interface Serial0/0/2
link-protocol ppp
#
interface Serial0/0/3
link-protocol ppp
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
wlan
#
interface NULL0
#
stelnet server enable
ssh user cisco
ssh user cisco authentication-type rsa
ssh user cisco service-type stelnet
ssh user huawei
ssh user huawei authentication-type rsa
ssh user huawei service-type stelnet
ssh user llk
ssh user llk authentication-type rsa
#
header shell information "Welcome toHW"
header login information "HelloWold!"
#
user-interface con 0
authentication-mode password
setauthentication password cipher
HW7,K*KbwMani^>"qh^;PWl#
idle-timeout 20 30
user-interface vty 0 4
authentication-mode aaa
setauthentication password cipher
EZMLMGGxa8ECB7Ie7'/)~Ad#
protocol inbound ssh
user-interface vty 16 20
#
return
[R1]
save保存配置
reset saved-configuration清空配置
reboot重启路由器