2580369hug@@@wery
给交换机配置ip
[SW1]inter vlan 1
[SW1-Vlan-interface1]ip add 172.16.adminr11.100 24
[SW1-Vlan-interface1]qu
2.开启telnet,创建用户密码和认证策略。
[SW1]telnet server enable
[SW1]local-user admin
[SW1-luser-manage-admin]password simple admin@123
[SW1-luser-manage-admin]authorization-attribute user-role network-admin
[SW1-luser-manage-admin]service-type telnet
配置telnet
[SW1]user-interface vty 0 4
[SW1-line-vty0-4]authentication-mode scheme
[SW1-line-vty0-4]protocol inbound telnet
[H3C-Vlan-interface1]display this
#
interface Vlan-interface1
ip address 192.168.56.4 255.255.255.0
#
return
[H3C-Vlan-interface1]quit
[H3C]telnet ?
client Specify telnet client attribute
server Telnet server configuration
[H3C]telnet server ?
acl Specify an ACL to control telnet clients' access
dscp Set the Differentiated Services Codepoint (DSCP) value
enable Enable telnet server function
ipv6 IPv6 information
port Specify the Telnet listening port
[H3C]telnet server enable
[H3C]local-user ?
STRING<1-80> Local user name, which can contain the domain name
[H3C]local-user admin
New local user added.
[H3C-luser-manage-admin]p
[H3C-luser-manage-admin]password
Password:
Confirm:
[H3C-luser-manage-admin]authorization-attribute user-role network-admin
[H3C-luser-manage-admin]service-type ?
ftp FTP service
http HTTP service type
https HTTPS service type
pad X.25 PAD service
ssh Secure Shell service
telnet Telnet service
terminal Terminal access service
[H3C-luser-manage-admin]service-type t
[H3C-luser-manage-admin]service-type tel
[H3C-luser-manage-admin]service-type telnet
[H3C-luser-manage-admin]service-type ht
[H3C-luser-manage-admin]service-type http
[H3C-luser-manage-admin]service-type https
[H3C-luser-manage-admin]
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]us
[H3C]user-int
[H3C]user-interface vt
[H3C]user-interface vty 0 4
[H3C-line-vty0-4]authentication-mode scheme
[H3C-line-vty0-4]protocol inbound telnet
您提供的代码是一系列用于配置H3C网络设备的命令。以下是每个命令的解释:
[H3C-Vlan-interface1]
: 这表示您处于名为Vlan-interface1的虚拟局域网接口的配置模式。display this
: 这个命令通常用于显示当前的配置上下文或特定的命令输出,但在这里它似乎没有被执行,因为后面没有显示任何输出。interface Vlan-interface1
: 重新进入Vlan-interface1接口的配置模式。ip address 192.168.56.4 255.255.255.0
: 为Vlan-interface1接口分配IP地址192.168.56.4和子网掩码255.255.255.0。#
: 井号在H3C设备上通常表示注释的开始,但它后面没有跟随任何文本。return
: 退出当前的配置模式,返回到上一级。[H3C]
: 这表示您现在处于设备的全局配置模式。telnet ?
: 查询telnet命令的可用选项。server
: 选择telnet服务器配置。telnet server ?
: 查询telnet服务器配置的可用选项。enable
: 启用telnet服务器功能。local-user ?
: 查询创建本地用户账户的可用选项。STRING<1-80>
: 这是创建本地用户时输入用户名的格式说明。local-user admin
: 创建一个名为admin的本地用户。[H3C-luser-manage-admin]
: 这表示您现在处于管理本地用户admin的配置模式。password
: 为admin用户设置密码。Password:
和Confirm:
: 系统提示您输入密码并确认。authorization-attribute user-role network-admin
: 将admin用户分配到network-admin用户角色,这通常意味着该用户具有网络管理的权限。service-type ?
: 查询分配给用户的服务类型的可用选项。t
,tel
,telnet
,ht
,http
,https
: 这些是尝试设置服务类型的命令,但只有telnet
是正确的服务类型命令,其余的都被取消或更正。<H3C>sys
: 进入系统视图。us
: 可能是一个错误的命令,因为没有在H3C的命令中找到对应的功能。user-int
: 可能是user-interface
的缩写,但没有在H3C的命令中找到对应的功能。user-interface vty 0 4
: 进入VTY(虚拟终端)0到4的配置模式,这通常用于配置远程登录设置。authentication-mode scheme
: 设置VTY线路的认证模式为某种scheme。protocol inbound telnet
: 允许通过telnet协议进行入站连接。
在您提供的命令 user-interface vty 0 4
中,数字 0
和 4
指定了一个VTY(虚拟终端)线路的编号范围。这里的 4
并不是指命令中的第几个参数,而是指VTY线路编号范围的结束值。
在许多网络设备的配置中,VTY线路通常用来提供远程访问,比如通过Telnet或SSH协议。当您配置一个范围的VTY线路时,您实际上是在批量配置多个VTY线路,这样可以节省时间,避免对每个VTY线路单独进行相同的配置。
具体来说:
0
是VTY线路编号的起始值。4
是VTY线路编号的结束值。
因此,这个命令是告诉设备您想要配置从VTY0到VTY4,即编号为0、1、2、3、4的五个VTY线路。如果您想要配置更多的VTY线路,可以相应地扩展这个范围,例如 user-interface vty 0 10
将会配置从VTY0到VTY10,共11个VTY线路。
至于 "telent" 应该是一个拼写错误,正确的应该是 "telnet",指的是Telnet协议,这是一种用于远程登录到网络设备的协议。在配置中启用Telnet允许远程用户通过Telnet客户端连接到设备。不过,出于安全考虑,现在更推荐使用SSH(Secure Shell),因为它提供了加密的通信,比Telnet更为安全。