10个高级Linux网络命令手册 | 10 Advanced Linux Networking Commands Handbook
1. ip命令集 | ip Command Suite
- 功能: 替代ifconfig/route的全能网络工具,支持路由、VLAN、隧道配置[4,5,7](@ref)
- 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](@ref)
- Function: Real-time socket monitoring with higher efficiency
- 典型用法:
ss -tulpnm # 显示进程关联端口 ss -o state established -p # 统计活跃连接
3. nmap安全扫描 | nmap Security Scanner
- 功能: 端口扫描/服务识别/漏洞检测[1,5,10](@ref)
- 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](@ref)
- 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](@ref)
- 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](@ref)
- Function: Netfilter connection tracking
- 典型用法:
conntrack -L -o extended # 查看NAT会话 conntrack -D -s 10.0.0.5 # 删除指定连接
7. ethtool网卡诊断 | ethtool NIC Diagnostics
- 功能: 物理层参数查看与设置[2,8](@ref)
- Function: Physical layer parameter control
- 典型用法:
ethtool -S eth0 # 统计信息 ethtool -s eth0 speed 1000 duplex full # 强制千兆全双工
8. iftop流量监控 | iftop Bandwidth Monitoring
- 功能: 实时带宽可视化[5,7](@ref)
- Function: Real-time traffic visualization
- 典型用法:
iftop -i eth0 -nNP # 禁用DNS解析 iftop -F 192.168.1.0/24 # 过滤子网流量
9. nload负载观测 | nload Traffic Observation
- 功能: 分设备流量速率监控[7,9](@ref)
- 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](@ref)
- Function: YAML-based network config for Ubuntu
- 典型用法:
sudo netplan try # 测试配置 sudo netplan apply # 应用配置
引用来源:
[1,2,4,5,6,7,8,9,10](@ref)