! 设置主机名
sysname SW1
! 配置密码和登录设置
local-user <your_username>
password irreversible-cipher <your_user_password>
service-type ssh telnet terminal
authorization-attribute level 3
line vty 0 15
authentication-mode scheme
user-role network-admin
protocol inbound all
line class aux
user-role network-admin
! 生成SSH密钥,启用SSH
rsa local-key-pair create
ssh user <your_username> authentication-type password
ssh user <your_username> service-type stelnet
ssh user <your_username> level 3
ssh server enable
! 配置管理VLAN
vlan batch 99
interface Vlanif99
description Management_VLAN
ip address <your_management_ip> <your_management_subnet_mask>
interface GigabitEthernet0/0/x ! 请根据您的实际设备接口进行修改
port link-type hybrid
port hybrid pvid vlan 99
port hybrid untagged vlan 99
stp disable
! 配置交换机端口
interface range GigabitEthernet 0/0/1 to GigabitEthernet 0/0/48 ! 请根据您的实际设备接口进行修改
port link-type access
port default vlan <your_access_vlan>
stp disable
! 配置上行链路端口
interface range GigabitEthernet 0/0/49 to GigabitEthernet 0/0/52 ! 请根据您的实际设备接口进行修改
port link-type trunk
port trunk allow-pass vlan <your_allowed_vlans>
! 保存配置
save