配置通过Console口首次登录设备后进行基本配置的示例
组网需求
通过Console口首次登录设备后,对设备进行基本配置并配置通过Telnet远程登录的0~4号用户的级别为15级,认证方式为AAA认证。PC2与设备之间路由可达。
操作步骤
- PC1通过设备Console口登录设备,具体操作请参见通过Console口首次登录设备
- 对设备进行基本配置
# 设置系统的日期、时间和时区。
<HUAWEI> clock timezone BJ add 08:00:00 <HUAWEI> clock datetime 20:20:00 2018-08-08
在配置设备的当前时间和日期前,需要执行clock timezone命令配置时区。如果不配置时区,执行clock datetime命令配置的是UTC时间。
# 设置设备名称和管理IP地址。
<HUAWEI> system-view [HUAWEI] sysname Server [Server] vlan 10 [Server-vlan10] quit [Server] interface vlanif 10 [Server-Vlanif10] ip address 10.137.217.177 24 [Server-Vlanif10] quit [Server] interface gigabitethernet 0/0/10 [Server-GigabitEthernet0/0/10] port link-type access [Server-GigabitEthernet0/0/10] port default vlan 10 [Server-GigabitEthernet0/0/10] quit
# 假如设备的网关是10.137.217.1,配置设备的缺省路由。[Server] ip route-static 0.0.0.0 0 10.137.217.1
# 设置Telnet用户的级别和认证方式。
[Server] telnet server enable [Server] user-interface vty 0 4 [Server-ui-vty0-4] protocol inbound telnet [Server-ui-vty0-4] authentication-mode aaa [Server-ui-vty0-4] user privilege level 15 [Server-ui-vty0-4] quit [Server] aaa [Server-aaa] local-user admin1234 password irreversible-cipher Helloworld@6789 [Server-aaa] local-user admin1234 privilege level 15 [Server-aaa] local-user admin1234 service-type telnet [Server-aaa] quit
- 验证配置结果
完成以上配置后,可以从PC2以Telnet方式远程登录设备。
# 进入Windows的命令行提示符,并执行以下命令,通过Telnet方式登录设备。
C:\Documents and Settings\Administrator> telnet 10.137.217.177
按“Enter”键后,在登录窗口输入用户名和密码,验证通过后,出现用户视图的命令行提示符。(以下显示信息仅为示意)
Login authentication Username:admin1234 Password: Info: The max number of VTY users is 20, and the number of current VTY users on line is 1. The current login time is 2012-07-26 20:10:05+08:00. <Server>
配置文件
Switch的配置文件
# sysname Server # telnet server enable # clock timezone BJ add 08:00:00 # aaa local-user admin1234 password irreversible-cipher $1a$aVW8S=aP=B<OWi1Bu'^R[=_!~oR*85r_nNY+kA(I}[TiLiVGR-i/'DFGAI-O$ local-user admin1234 privilege level 15 local-user admin1234 service-type telnet # interface Vlanif10 ip address 10.137.217.177 255.255.255.0 # interface GigabitEthernet0/0/10 port link-type access port default vlan 10 # ip route-static 0.0.0.0 0.0.0.0 10.137.217.1 # user-interface vty 0 4 authentication-mode aaa user privilege level 15 protocol inbound telnet # return