哈喽大家好,欢迎来到虚拟化时代君(XNHCYL)。
“ 大家好,我是虚拟化时代君,一位潜心于互联网的技术宅男。这里每天为你分享各种你感兴趣的技术、教程、软件、资源、福利…(每天更新不间断,福利不见不散)
第一章、小叙
新的一周新的开始,我们今天汇总下H3C网络设备上常用的命令及其示例。这些命令涵盖了设备管理、接口配置、路由、VLAN、ACL等多个方面。
第二章、命令
1. 查看设备版本
display version
示例输出:
H3C S5120-28P-AC
Version: 5.20
Release Date: 2022-01-01
2. 查看当前配置
display current-configuration
示例输出:
# Current configuration:
hostname S5120
interface Vlan-interface1
ip address 192.168.1.1 255.255.255.0
3. 查看接口状态
display interface brief
示例输出:
Interface Status Protocol
Vlan-interface1 UP UP
GigabitEthernet1/0/1 UP UP
GigabitEthernet1/0/2 DOWN DOWN
4. 查看路由表
display ip routing-table
示例输出:
Destination Mask Next Hop Interface
192.168.1.0 255.255.255.0 0.0.0.0 Vlan-interface1
5. 查看MAC地址表
display mac-address
示例输出:
MAC Address VLAN ID Interface
00-1A-2B-3C-4D-5E 10 GigabitEthernet1/0/1
6. 查看ARP表
display arp
示例输出:
IP Address MAC Address Interface
192.168.1.2 00-1A-2B-3C-4D-5E Vlan-interface1
7. 查看CPU使用率
display cpu-usage
示例输出:
CPU utilization: 5%
8. 查看内存使用情况
display memory
示例输出:
Total memory: 512MB
Free memory: 256MB
9. 查看VLAN信息
display vlan
示例输出:
VLAN ID: 10
VLAN Name: Sales
Status: Active
10. 创建VLAN
vlan 10
11. 配置接口IP地址
interface Vlan-interface1
ip address 192.168.1.1 255.255.255.0
12. 启用接口
interface GigabitEthernet1/0/1
undo shutdown
13. 禁用接口
interface GigabitEthernet1/0/1
shutdown
14. 查看接口流量统计
display interface GigabitEthernet1/0/1
示例输出:
GigabitEthernet1/0/1
Input packets: 1000
Output packets: 800
15. 查看设备日志
display logbuffer
示例输出:
Log Buffer:
1. 2024-08-09 10:00:00: Interface GigabitEthernet1/0/1 up
16. 配置静态路由
ip route-static 192.168.2.0 255.255.255.0 192.168.1.254
17. 查看静态路由
display ip routing-table static
18. 配置动态路由(RIP)
rip 1
network 192.168.1.0
19. 查看RIP路由
display rip routing-table
20. 配置ACL
acl number 2000
rule permit ip source 192.168.1.0 0.0.0.255
21. 应用ACL到接口
interface GigabitEthernet1/0/1
packet-filter 2000 inbound
22. 查看ACL配置
display acl
23. 查看NTP状态
display ntp status
24. 配置NTP服务器
ntp-service unicast-server 192.168.1.100
25. 查看DHCP绑定
display dhcp binding
26. 配置DHCP服务
dhcp enable
ip pool Sales
network 192.168.1.0 mask 255.255.255.0
gateway 192.168.1.1
27. 查看端口镜像配置
display mirroring
28. 配置端口镜像
interface GigabitEthernet1/0/1
port-mirroring to GigabitEthernet1/0/2
29. 查看设备时间
display clock
30. 设置设备时间
clock timezone 8
31. 查看设备状态
display device
32. 查看链路聚合状态
display link-aggregation
33. 配置链路聚合
interface GigabitEthernet1/0/1
link-aggregation group 1
34. 查看QoS配置
display qos
35. 配置QoS策略
traffic classifier test classifier
if-match ip
36. 查看SNMP状态
display snmp-agent
37. 配置SNMP
snmp-agent community read public
38. 查看IP SLA状态
display ip sla
39. 配置IP SLA
ip sla 1
icmp-echo 192.168.1.2
40. 查看防火墙状态
display firewall
41. 配置防火墙策略
firewall policy 1
rule permit ip
42. 查看VPN状态
display vpn
43. 配置VPN
ipsec proposal 1
transform esp-aes esp-sha-hmac
44. 查看流量统计
display traffic statistics
45. 配置流量限制
traffic shaping 1000
46. 查看设备接口速率
display interface GigabitEthernet1/0/1
47. 查看设备温度
display temperature
48. 查看设备电源状态
display power
49. 查看设备硬件信息
display hardware
50. 保存配置
save
以下链接可自行保存:(复制粘贴到浏览器)
https://www.yuque.com/hum0ro-qjxe9/bv7kh8/qah6ovyex8hybupt?singleDoc#
第三章、往期回顾
【Python】01-实验环境从GNS3入门到放弃-《网络工程师的Python之路》
【Python】02-使用EVE-NG模拟实验环境-《网络工程师的Python之路》
每日一句
“解决问题的能力,才是IT从业者最宝贵的财富。”