华为交换机配置远程连接

项目需求:交换机可远程登录配置。
模拟场景:通过R2路由器来远程LSW2交换机;

注意:在华为模拟器中选用这个名为:“router”的路由,不然别的路由E口不支持配置ip(默认为二层设备端口)
在这里插入图片描述

实验思路

1、路由器配置ip,交换机配置ip实现互通。
2、由于模拟器中交换机是二层设备,所以端口不可以直接配置ip,所以要借助绑定vlan的方法类实现互通。
3、当两台主机互通后,开启交换机上面的telnet功能, 并且配置相应权限以及密码等。
4、最后验证

远程有两种方式,下面是aaapassword的区别,我这里都演示一下,认真看,每条命令都会有解释。
在这里插入图片描述

配置链路通信

实验步骤(从路由器开始,注意主机名):

R2:

<Huawei>system-view  ##进入系统视图
Enter system view, return user view with Ctrl+Z. 提示按Ctrl+Z可以直接退回到用户视图

[Huawei]sysname R2 	##改名为R2
[R2]int e0/0/0 		##进入0/0口,注意看图,因为连的是0/0所以要进0/0
[R2-Ethernet0/0/0]ip address 192.168.1.2 24 		##给端口设置ip
[R2-Ethernet0/0/0]dis th							##查看配置情况
#
interface Ethernet0/0/0
ip address 192.168.1.2 255.255.255.0
Return
4
#
<R2>save   			##保存配置

到此,路由器上面的ip就配置完成了、下面开始配置交换机;

SW2:

<Huawei>sys 			##进入系统视图
Enter system view, return user view with Ctrl+Z.

[Huawei]sysname SW2		##改名为SW2
[SW2]int vl	
[SW2]int Vlanif 1 		##进入vlan1
[SW2-Vlanif1]ip address 192.168.1.1 24  	##配置vlan的ip
[SW2-Vlanif1]dis th  						##查看配置情况
#
interface Vlanif1
 ip address 192.168.1.1 255.255.255.0
#
return
-----------------------------------------------
[SW2-Vlanif1]q 			##退回到上一层视图
[SW2]int g0/0/1  		##进入0/1端口
[SW2-GigabitEthernet0/0/1]port ? 			##在华为交换机中一定要善于使用"tab"(补全)以及"?" 
  add-tag        Add outer tag based on acl 
  discard        Discard
  hybrid         Hybrid port
  link-flap      Link flap 
  link-type      Switch port link type
  mux-vlan       Multiplex vlan
  priority       Specify current port's priority
  type           Type 
  vlan-mapping   VLAN Mapping
  vlan-stacking  VLAN Stacking
[SW2-GigabitEthernet0/0/1]port link-type access 	##给端口设置通信类型	
[SW2-GigabitEthernet0/0/1]port default vlan 1  		
##给端口绑定vlan (这样做的目的是为了让端口可以利用vlan的ip)
[SW2-GigabitEthernet0/0/1]dis th  	 				##查看配置情况
#
interface GigabitEthernet0/0/1
 port link-type access
#
Return   

(由于模拟器的bug,所以上面没有显示prot default;但并不影响什么)
到现在,便可以验证了,我上面配置的R1是192.168.1.2而SW2配置的是192.168.1.1
下面验证两台机器是否可以通信:
在这里插入图片描述
既然已经可以通信了,说明我可以配置telnet服务了。

配置telnet

Password方式

<SW2>sys 					##进入系统视图
Enter system view, return user view with Ctrl+Z.
[SW2]telnet server enable  	##开启telnet功能
	
[SW2]user-interface ?
  INTEGER<0,34-48,50-54>   The first user terminal interface to be configured
  console                  Primary user terminal interface
  current                  The current user terminal interface
  maximum-vty              The maximum number of VTY users, the default value
                           is 5
  vty                      The virtual user terminal interface 

  
[SW2]user-interface vty 0 4				##进入vty 0-4 模式
[SW2-ui-vty0-4]protocol inbound telnet 	##指定协议的走向为telnet

[SW2-ui-vty0-4]set authentication password cipher djp		##设置远程登录密码为djp
[SW2-ui-vty0-4]user privilege level 15  					##给权限15(所有权限)
ctrl+Z				##退回到用户视图
<SW2>save  			##保存配置

验证(利用R2远程SW2):
在这里插入图片描述

aaa方式

当两个设备可以正常通信后,下面开始配置aaa模式:

<SW2>sys  ##进入系统视图
Enter system view, return user view with Ctrl+Z.
[SW2]user-interface vty 0 4  			##进入vty模式
[SW2-ui-vty0-4]authentication-mode aaa  ##配置用户登录模式为aaa	
[SW2-ui-vty0-4]protocol inbound all   	##配置协议的准入
[SW2-ui-vty0-4]qu						##退回到系统视图
[SW2]aaa								##进入aaa视图

[SW2-aaa]local-user jxp password cipher abc123,	
##创建一个远程用户名为jxp,密码为abc123,
[SW2-aaa]local-user djp privilege level 15  ##给djp用户授权为15
[SW2-aaa]local-user djp service-type telnet	##将djp的准入协议设置为telnet
<SW2>save    							##保存配置

验证:
在这里插入图片描述
实验结束;

主要命令:

Password方式:

[SW2]telnet server enable                   ##开启telnet功能
[SW2]user-interface vty 0 4		            ##进入vty 0-4 模式
[SW2-ui-vty0-4]protocol inbound telnet      ##指定协议的走向为telnet
[SW2-ui-vty0-4]set authentication password cipher djp  ##设置远程登录密码为djp

aaa方式:

[SW2]user-interface vty 0 4                  ##进入vty模式
[SW2-ui-vty0-4]authentication-mode aaa       ##配置用户登录模式为aaa
[SW2-ui-vty0-4]protocol inbound all          ##配置协议的准入
[SW2-aaa]local-user djp password cipher abc123,	##创建一个远程用户名为djp,密码为abc123,
[SW2-aaa]local-user djp privilege level 15   ##给djp用户授权为15
[SW2-aaa]local-user djp service-type telnet	 ##将djp的准入协议设置为telnet
  • 6
    点赞
  • 72
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
华为交换机远程管理可以通过Telnet、SSH、SNMP等协议实现。下面我将就Telnet和SSH两种协议进行介绍: 1. Telnet 使用Telnet协议可以远程连接华为交换机,并进行配置和管理。具体操作步骤如下: 1.1 配置交换机IP地址和登录密码 首先需要在交换机配置IP地址和登录密码,具体命令如下: ``` <HUAWEI>system-view [HUAWEI] interface vlanif 1 [HUAWEI-Vlanif1] ip address 192.168.1.1 24 [HUAWEI-Vlanif1] quit [HUAWEI] user-interface vty 0 4 [HUAWEI-ui-vty0-4] authentication-mode password [HUAWEI-ui-vty0-4] set authentication password cipher huawei [HUAWEI-ui-vty0-4] quit ``` 其中,192.168.1.1是交换机的IP地址,huawei是登录密码。 1.2 通过Telnet远程登录交换机 使用Telnet客户端(如SecureCRT、PuTTY等)输入交换机的IP地址和登录密码,即可远程登录交换机。 ``` Username: admin Password: huawei ``` 2. SSH 使用SSH协议可以更加安全地远程连接华为交换机,并进行配置和管理。具体操作步骤如下: 2.1 配置SSH服务 首先需要在交换机配置SSH服务,具体命令如下: ``` <HUAWEI>system-view [HUAWEI] user-interface vty 0 4 [HUAWEI-ui-vty0-4] protocol inbound ssh [HUAWEI-ui-vty0-4] authentication-mode aaa [HUAWEI-ui-vty0-4] quit [HUAWEI] aaa [HUAWEI-aaa] local-user admin password irreversible-cipher huawei [HUAWEI-aaa] local-user admin service-type ssh [HUAWEI-aaa] quit ``` 其中,admin是用户名,huawei是登录密码。 2.2 通过SSH远程登录交换机 使用SSH客户端(如SecureCRT、PuTTY等)输入交换机的IP地址和登录密码,即可远程登录交换机。 ``` Username: admin Password: huawei ``` 以上是关于华为交换机配置远程管理的基本步骤,希望能对你有所帮助。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值