学习telnet命令

目录

一、Telnet拓扑图:

注意事项

二、内存

三、SW1(服务器)的Telnet命令:

四、SW2(客户端)的Telnet命令:

 总结


一、Telnet拓扑图:

注意事项

注意:交换机的物理接口是不能配置IP地址的

交换机有一个虚拟接口,默认虚拟接口名称叫vlanif 1,我们可以给默认虚拟接口配置IP,即给二层交换机配置一个管理IP

[ ]interface vlanif 1

 Ip address 192.168.1.10  255.255.255.0

 undo shutdown 开启接口(交换机不需要打)

交换机/路由器虚拟接口特性:只要1设备启动,虚拟接口默认开启

交换机的物理接口默认是开启状态

<>save

<>telnet ip

user-interface vty 0 4 进入telnet

authentication-mode password 验证模式为密码模式

set authentication password simple Huawei 明文密码

user privilege level 3 用户权限

  1. 服务器上设置管理IP
  2. 开启telnet功能
  3. 设置telnet模式为密码模式
  4. 设置明文/密文密码
  5. 客户机上设置管理IP
  6. 客户机验证telnet服务器是否可以登陆

二、内存

RAM:易失性存储器

设备断电后当前文件信息会丢失

硬盘

ROM:只读存储器

设备断电后当前文件信息不会丢失

三、SW1(服务器)的Telnet命令:

 进入系统视图

<Huawei>system-view

修改名字

[Huawei]sysname SW1 

设置永不超时:

[SW1]user-interface console 0

[SW1-ui-console0]id

[SW1-ui-console0]idle-timeout 0 0

关闭弹窗:

[SW1]q

<SW1>undo terminal monitor

Info: Current terminal monitor is off.  提示弹窗已关闭

进入Telnet

[SW1]user-interface vty 0 4

验证模式为密码模式

[SW1-ui-vty0-4]authentication-mode password

Simple是密码为明文,cipher是密码为密文

[SW1-ui-vty0-4]set authentication password simple Huawei

用户权限:3-15都是管理员级别(0是参观级别:网络诊断命令,1是监控级:系统维护,业务故障诊断,2是配置级:业务配置)

[SW1-ui-vty0-4]user privilege level 3

配置IP

[SW1-ui-vty0-4]q

[SW1]interface vlanif 1

[SW1-Vlanif1]ip add 192.168.1.10   24

下面ping 一下客户端的IP,能出来代表成功;

[SW1-Vlanif1]q

[SW1]ping 192.168.1.5

  PING 192.168.1.10: 56  data bytes, press CTRL_C to break

    Reply from 192.168.1.5: bytes=56 Sequence=1 ttl=128 time=70 ms

    Reply from 192.168.1.5: bytes=56 Sequence=2 ttl=128 time=50 ms

    Reply from 192.168.1.5: bytes=56 Sequence=3 ttl=128 time=50 ms

    Reply from 192.168.1.5: bytes=56 Sequence=4 ttl=128 time=40 ms

    Reply from 192.168.1.5: bytes=56 Sequence=5 ttl=128 time=30 ms

  --- 192.168.1.5 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 30/48/70 ms

在用户视图保存你的配置,防止关机时丢失;

[SW1]q

<SW1>save

The current configuration will be written to the device.

Are you sure to continue?[Y/N]y

Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:  这里默认即可,有cfg和zip两种保存格式;

Now saving the current configuration to the slot 0.

Save the configuration successfully.  这里代表保存成功了。

四、SW2(客户端)的Telnet命令:

<Huawei>system-view  进入系统视图

[Huawei]sysname SW2  同样是修改名字

设置永不超时:

[SW1]user-interface console 0

[SW1-ui-console0]id

[SW1-ui-console0]idle-timeout 0 0

关闭弹窗:

[SW1]q

<SW1>undo terminal monitor

Info: Current terminal monitor is off.  提示弹窗已关闭

这里客户端我们不用进入Telnet,下面我们设置一个IP地址:

<SW2>system-view

[SW2]interface vlanif 1

[SW2-Vlanif1]ip add 192.168.1.20 24

这里ping 一下服务器IP,包没丢失代表成功;

[SW2-Vlanif1]ping 192.168.1.10

  PING 192.168.1.5: 56  data bytes, press CTRL_C to break

    Reply from 192.168.1.10: bytes=56 Sequence=1 ttl=255 time=50 ms

    Reply from 192.168.1.10 bytes=56 Sequence=2 ttl=255 time=50 ms

    Reply from 192.168.1.10: bytes=56 Sequence=3 ttl=255 time=50 ms

    Reply from 192.168.1.10: bytes=56 Sequence=4 ttl=255 time=40 ms

    Reply from 192.168.1.10: bytes=56 Sequence=5 ttl=255 time=60 ms

  --- 192.168.1.10 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 40/50/60 ms

下面我们用SW2作为客户机去访问我们的SW1服务器;

这里注意:Telnet要在用户视图下去测试才能出来效果,因为系统视图没有那个命令;

[SW2]q

<SW2>telnet 192.168.1.10

Trying 192.168.1.10 ...

Press CTRL+K to abort

Connected to 192.168.1.10...

Login authentication

Password:

Info: The max number of VTY users is 5, and the number

      of current VTY users on line is 1.

      The current login time is 2021-08-05 19:38:45.

<SW1>  这里我们是登入上去了,名称发生了改变;

下面我们查看一下当前配置:

<SW1>display current-configuration

#

user-interface con 0

 idle-timeout 0 0

user-interface vty 0 4

 user privilege level 3

 set authentication password simple huawei  这里我们是明文,所以可以看到密码;

查看保存过的配置信息:

<SW1>display saved-configuration

<SW1>  如果配置文件没保存,这里将会是空的;如果保存了,则跟display current-configuration 列出的信息一样;

下面我们退出SW1(服务器),进入客户端SW2保存一下配置:

<SW1>q

Info: The max number of VTY users is 5, and the number

      of current VTY users on line is 0.

Info: The connection was closed by the remote host.

<SW2>save

The current configuration will be written to the device.

Are you sure to continue?[Y/N]y

Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:

Now saving the current configuration to the slot 0.

Save the configuration successfully.

<SW2>

如下图已经完成

 总结

主要学习telnet命令,需要把里面的命令记熟才能掌握telnet命令

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值