10个高级Linux网络命令手册
10个高级Linux网络命令手册 | 10 Advanced Linux Networking Commands Handbook
1. ip命令集 | ip Command Suite
-
功能: 替代ifconfig/route的全能网络工具,支持路由、VLAN、隧道配置4,5,7
-
Function: Replace ifconfig/route with advanced routing/VLAN/tunnel management
典型用法: ip addr show # 查看所有接口IP ip route add 10.0.0.0/24 via 192.168.1.1 # 添加静态路由
2. ss网络分析 | ss Socket Statistics
-
功能: 实时套接字监控,比netstat快10倍5,8
-
Function: Real-time socket monitoring with higher efficiency
典型用法: ss -tulpnm # 显示进程关联端口 ss -o state established -p # 统计活跃连接
3. nmap安全扫描 | nmap Security Scanner
-
功能: 端口扫描/服务识别/漏洞检测1,5,10
-
Function: Port scanning and vulnerability detection
典型用法: nmap -sV -O 192.168.1.0/24 # 识别设备类型 nmap —script ssl-enum-ciphers # SSL配置审计
4. tcpdump抓包分析 | tcpdump Packet Capture
-
功能: 协议级流量嗅探与存储1,5,9
-
Function: Protocol-level packet analysis
典型用法: tcpdump -i any ‘port 80’ -w http.pcap # 捕获HTTP流量 tcpdump -nnvXSs 0 ‘icmp[icmptype]==8’ # 精确匹配ICMP请求
5. mtr路径追踪 | mtr Path Analysis
-
功能: 融合ping+traceroute的全链路诊断5,7
-
Function: Integrated path analysis
典型用法: mtr -4 -rwc 100 8.8.8.8 # IPv4持续测试 mtr —tcp -P 443 google.com # TCP端口路径测试
6. conntrack连接跟踪 | conntrack Connection Tracking
-
功能: Netfilter连接状态管理7,9
-
Function: Netfilter connection tracking
典型用法: conntrack -L -o extended # 查看NAT会话 conntrack -D -s 10.0.0.5 # 删除指定连接
7. ethtool网卡诊断 | ethtool NIC Diagnostics
-
功能: 物理层参数查看与设置2,8
-
Function: Physical layer parameter control
典型用法: ethtool -S eth0 # 统计信息 ethtool -s eth0 speed 1000 duplex full # 强制千兆全双工
8. iftop流量监控 | iftop Bandwidth Monitoring
-
功能: 实时带宽可视化5,7
-
Function: Real-time traffic visualization
典型用法: iftop -i eth0 -nNP # 禁用DNS解析 iftop -F 192.168.1.0/24 # 过滤子网流量
9. nload负载观测 | nload Traffic Observation
-
功能: 分设备流量速率监控7,9
-
Function: Per-device rate monitoring
典型用法: nload -m -u K eth0 # KB/s单位显示 nload -a 5 -t 2000 # 5秒刷新周期
10. netplan网络配置 | netplan Network Configuration
-
功能: Ubuntu YAML格式网络配置6,10
-
Function: YAML-based network config for Ubuntu
典型用法: sudo netplan try # 测试配置 sudo netplan apply # 应用配置
引用来源: 1,2,4,5,6,7,8,9,10
.wp-block-column { padding: 20px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 15px; } .wp-block-code code { background: #f8f9fa; padding: 8px; border-radius: 4px; } .wp-block-separator { margin: 40px 0; }