一、系统基础
system-view // 进入系统视图
sysname SW1-Group4 // 修改设备名称
save // 保存配置
reboot // 重启设备
undo shutdown // 开启接口
display current-configuration // 查看当前配置(dis cu)
display saved-configuration // 查看已保存配置
二、VLAN 与接口配置
vlan 40
name Group4-PC-VLAN // VLAN 命名(可选)
interface GigabitEthernet 1/0/1
port link-type access
port access vlan 40
interface GigabitEthernet 1/0/24
port link-type trunk
port trunk permit vlan 40
port trunk pvid vlan 1
display vlan
display vlan brief
display port vlan
display mac-address
三、三层接口与网关
interface Vlan-interface 40
ip address 10.0.4.254 255.255.255.0
interface GigabitEthernet 1/0/24
undo portswitch // 切换为三层接口
ip address 10.99.0.2 255.255.255.252
display ip interface brief
display interface brief
display arp all
四、静态路由
ip route-static 0.0.0.0 0.0.0.0 10.99.0.1
ip route-static 10.0.1.0 255.255.255.0 10.99.0.1
ip route-static 10.0.2.0 24 10.99.0.1
display ip routing-table
ping 10.99.0.1
tracert 10.0.1.254
五、单臂路由
interface GigabitEthernet 1/0/1.10
vlan-type dot1q vid 10
ip address 192.168.10.254 255.255.255.0
六、SSH 远程管理
public-key local create rsa // 首次配置需生成 RSA 密钥
ssh server enable
local-user admin class manage
password simple Xgxy@2026
service-type ssh
authorization-attribute user-role level-15
user-interface vty 0 4
authentication-mode scheme
protocol inbound ssh
idle-timeout 10 0
display ssh server status
display users
七、ACL 基础
acl basic 2000
rule permit source 10.0.4.0 0.0.0.255
acl advanced 3000
rule deny tcp source any destination any destination-port eq 80
interface GigabitEthernet 1/0/1
packet-filter 3000 inbound
display acl all
八、常用查看命令速记
dis cu | inc vlan // 查看 VLAN 相关配置
dis int br // 接口状态
dis ip int br // IP 地址表
dis ip rou // 路由表
dis mac-add // MAC 地址表
dis arp // ARP 表
dis vlan // VLAN 信息
ping -a 10.0.4.254 10.0.1.1