HCNA-3 通过配置Telnet登录系统
利用Router2和Router3模拟PC通过Telnet远程访问Router1设备;2为普通用户给予监控权,3为管理员给予最高管理权限。 1、基本配置 Router1 <Huawei>clocktimezone BJ add 8:00:00 <Huawei>clockdatetime 22:30 2020-04-13 <Huawei>system-view [Huawei]sysnameRouter1 [Router1]headerlogin information "welcome to ipgzj.com" //配置登录时标题文本信息为 [Router1]headershell information "welcome to zurkj.com" //配置登录成功后标题文本信息为 [Router1]interfaceGigabitEthernet 0/0/0 [Router1-GigabitEthernet0/0/0]ipaddress 10.1.1.1 24 [Router1-GigabitEthernet0/0/0]quit [Router1]displayip interface brief [Router1]return <Router1>save Router2 <Huawei>system-view [Huawei]sysnameRouter2 [Router2]interfaceGigabitEthernet 0/0/0 [Router2-GigabitEthernet0/0/0]ipaddress 10.1.1.100 24 [Router2-GigabitEthernet0/0/0]return <Router2>displayip interface brief <Router2>save Router3 <Huawei>system-view [Huawei]sysnameRouter3 [Router3]interfaceGigabitEthernet 0/0/0 [Router3-GigabitEthernet0/0/0]ipaddress 10.1.1.200 24 [Router3-GigabitEthernet0/0/0]return <Router3>displayip interface brief <Router3>save
2、配置Telnet密码验证 Router1 <Router1>system-view [Router1]user-interfacevty 0 4 //VTY用户界面 [Router1-ui-vty0-4]authentication-modepassword //认证模式为密码 Please configurethe login password (maximum length 16):admin1234 //配置密码: [Router1-ui-vty0-4]return <Router1>save 在Router2与Router3上Telnet连接Router1(系统默认给予权限) <Router2>telnet10.1.1.1 //远程登录 Press CTRL_] to quit telnet mode Trying 10.1.1.1 ... Connected to 10.1.1.1 ... Loginauthentication //登录认证 Password: <Router1>
3、配置Telnet区分不同用户的权限 <Router1>system-view [Router1]user-interfacevty 0 4 [Router1-ui-vty0-4]authentication-modepassword Please configurethe login password (maximum length 16):admin1234 [Router1-ui-vty0-4]setauthentication password cipher admin1234 (另一种配置密码的方式) [Router1-ui-vty0-4]userprivilege level 15 //配置用户权限 级别15 [Router1-ui-vty0-4]return <Router1>save 在Router2与Router3上Telnet连接Router1(配置级别为15的管理员权限) <Router2>telnet10.1.1.1 Press CTRL_] to quit telnet mode Trying 10.1.1.1 ... Connected to 10.1.1.1 ... Loginauthentication Password: <Router1>displayusers //查看用户 User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag 0 CON0 00:01:33 pass Username : Unspecified + 129 VTY 0 00:00:00 TEL 10.1.1.100 pass Username : Unspecified 通过AAA视图配置一个user及zurkj扮演用户和管理员角色 用户权限1;管理员15 Router1 <Router1>system-view [Router1]user-interfacevty 0 4 //VTY用户界面 [Router1-ui-vty0-4]authentication-modeaaa //认证模式 AAA [Router1-ui-vty0-4]quit [Router1-aaa]local-userzurkj password cipher admin1234 //本地用户zurkj 密码 密文显示admin1234 [Router1-aaa]local-userzurkj privilege level 15 //本地用户zurkj权限级别 15 [Router1-aaa]local-userzurkj service-type telnet //本地用户zurkj服务类型Telnet [Router1-aaa]local-useruser password cipher admin1234 privilege level 1 //密码和级别可同时配置 [Router1-aaa]local-useruser service-type telnet [Router1-aaa]quit [Router1]displaylocal-user //查看本地用户 ---------------------------------------------------------------------------- User-name State AuthMask AdminLevel ---------------------------------------------------------------------------- user A T 1 admin A H - zurkj A T 15 ---------------------------------------------------------------------------- Total 3 user(s) 在Router2与Router3上Telnet连接Router1 <Router2>telnet10.1.1.1 Press CTRL_] to quit telnet mode Trying 10.1.1.1 ... Connected to 10.1.1.1 ... Loginauthentication Username:user Password: ----------------------------------------------------------------------------- User last login information: ----------------------------------------------------------------------------- Access Type: Telnet IP-Address : 10.1.1.1 Time : 2020-04-13 20:38:43+08:00 ----------------------------------------------------------------------------- <Router1>system-view //无权限报错 ^ Error:Unrecognized command found at '^' position.
<Router3>telnet10.1.1.1 Press CTRL_] to quit telnet mode Trying 10.1.1.1 ... Connected to 10.1.1.1 ...
Loginauthentication Username:zurkj Password: ----------------------------------------------------------------------------- User last login information: ----------------------------------------------------------------------------- Access Type: Telnet IP-Address : 10.1.1.100 Time : 2020-04-13 20:34:12+08:00 ----------------------------------------------------------------------------- <Router1>system-view Entersystem view, return user view with Ctrl+Z. [Router1] |