华为交换机管理vlan配置

应用场景:
当用户通过远端网管集中管理设备时,需要在设备上通过VLANIF接口配置IP地址作为设备管理IP,通过管理IP地址连接到设备上来管理。若设备上其他端口相连的用户加入该VLAN,也可以访问该交换设备,增加了交换设备的不安全因素。
配置VLAN为管理VLAN后,不允许Access类型和Dot1q-tunnel类型接口加入该VLAN。由于Access类型和Dot1q-tunnel类型通常用于连接用户,限制这两种类型接口加入管理VLAN,与该端口相连的用户就无法访问该交换设备,从而增加了交换设备的安全性。
配置VLAN为管理VLAN后,加入该VLAN的接口必须为Trunk或Hybrid类型。
执行命令display vlan,可以看到管理VLAN的配置信息,带有 的VLAN为管理VLAN。
实际上这是个画蛇添足的功能,配置acl控制普通vlan中的登陆ip即可。可能便于审计需求,形式主义。

举例:配置管理VLAN实现对本地设备的集中管理

 

操作步骤
创建管理VLAN。
<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan 2
[DeviceA-vlan2] management-vlan
[DeviceA-vlan2] quit

配置接口加入到管理VLAN中。
[DeviceA] interface 10ge 0/0/1
[DeviceA-10GE0/0/1] port link-type trunk
[DeviceA-10GE0/0/1] port trunk allow-pass vlan 2
[DeviceA-10GE0/0/1] quit

创建VLANIF接口,并配置VLANIF接口的IP地址。
[DeviceA] interface vlanif 2
[DeviceA-Vlanif2] ip address 10.10.10.2 24
[DeviceA-Vlanif2] quit

在DeviceA上生成本地密钥对。
[DeviceA] rsa local-key-pair create
The key name will be:Host
The range of public key size is (2048, 3072).
NOTE: Key pair generation will take a short while.
Please input the modulus [default = 3072]:

在DeviceA上配置VTY用户界面。
[DeviceA] user-interface vty 0 4
[DeviceA-ui-vty0-4] authentication-mode aaa
[DeviceA-ui-vty0-4] protocol inbound ssh
[DeviceA-ui-vty0-4] quit

创建SSH用户。
[DeviceA] aaa
[DeviceA-aaa] local-user client001 password irreversible-cipher Huawei@123
[DeviceA-aaa] local-user client001 privilege level 3
[DeviceA-aaa] local-user client001 service-type ssh
[DeviceA-aaa] quit
[DeviceA] ssh user client001
[DeviceA] ssh user client001 authentication-type password

启用STelnet服务功能。
[DeviceA] stelnet server enable
[DeviceA] ssh user client001 service-type stelnet

参考:https://support.huawei.com/hedex/hdx.do?docid=EDOC1100318336&id=ZH-CN_TASK_0000001130622864

posted @ 2025-05-25 14:35  莫让年华付水流  阅读(331)  评论(0)    收藏  举报