H3C 交换机命令

356 字
2 分钟
H3C 交换机命令

一、系统基础#

Terminal window
system-view // 进入系统视图
sysname SW1-Group4 // 修改设备名称
save // 保存配置
reboot // 重启设备
undo shutdown // 开启接口
display current-configuration // 查看当前配置(dis cu)
display saved-configuration // 查看已保存配置

二、VLAN 与接口配置#

Terminal window
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

三、三层接口与网关#

Terminal window
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

四、静态路由#

Terminal window
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

五、单臂路由#

Terminal window
interface GigabitEthernet 1/0/1.10
vlan-type dot1q vid 10
ip address 192.168.10.254 255.255.255.0

六、SSH 远程管理#

Terminal window
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 基础#

Terminal window
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

八、常用查看命令速记#

Terminal window
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

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!

赞助
H3C 交换机命令
https://www.linglog.cc/posts/h3c/
作者
Jaye
发布于
2026-05-06
许可协议
CC BY-NC-SA 4.0

评论区

文章目录