网络管理【Linux/Unix/Windows】命令大全

发布于:2025-06-13 ⋅ 阅读:(20) ⋅ 点赞:(0)

在跨平台网络运维中,管理员常需快速切换Windows与Linux环境下的命令操作。本文整合了核心网络管理命令的跨平台对照表,涵盖连通性测试、路由追踪、DNS解析、ARP管理、会话监控等高频场景。无论您负责服务器维护、网络排障还是安全审计,此表可帮助您:
1️⃣ 一键匹配Windows/Linux等效命令。
2️⃣ 快速定位故障排查工具(如tcpdump流量分析、pathping路径诊断)。
3️⃣ 避免跨系统操作时的记忆成本。

序号

Windows命令

Unix/Linux命令

用途

举例说明

1

ping

ping

测试连通性

ping 192.168.168.168

2

ipconfig

ip

查看网络配置

ipconfig/all / ip addr show

3

netstat

ss

显示网络状态

netstat -a / ss -an

4

tracert

traceroute

跟踪路由

tracert / traceroute www.example.com

5

nslookup

nslookup/dig

DNS查询

nslookup / dig@www.example.com

6

telnet

telnet

远程登录

telnet 192.168.168.168

7

ssh

ssh

安全远程登录

ssh user@example.com

8

route

route

路由管理

route print / route -n

9

arp

arp

ARP表管理

arp -a

10

net use

mount

管理连接

net use <驱动器号Z>: \<服务器server>\share

11

net session

-

查看会话

net session

12

-

tcpdump

捕获分析流量

tcpdump -i <interface>

13

-

scp

安全文件传输

[选项][源文件][目标文件]

14

net view

-

网络共享管理

net view \computername

序号

Windows命令

Unix/Linux命令

用途

举例说明

15

net session

w

查看会话

net session

16

nets tat -r

ip route

显示路由表

nets tat -r

17

ipconfig /release

dhclient -r

释放DHCP地址

ipconfig /release

18

ipconfig /renew

dhclient

更新DHCP地址

ipconfig /renew

19

ipconfig /flushdns

resolvectl flushdns caches

清除DNS缓存

ipconfig /flushdns

20

route add

ip route add

添加路由

route add 192.168.2.0 mask 255.255.255.0 192.168.1.1

21

route delete

ip route del

删除路由

route delete 192.168.2.0

22

arp -d

arp -d

删除ARP条目

arp -d 192.168.1.1

23

arp -s

arp -s

添加静态ARP

arp -s 192.168.1.1 00-11-22-33-44-55

24

nets h interface

ifup/ifdown

接口管理

nets h interface ip show config

25

nets h interface ip set address

ip addr add

设置IP地址

nets h interface ip set address "Local Area Connection" static 192.168.1.10 255.255.255.0 192.168.1.1

26

nets h interface ip set dns

echo "nameserver 8.8.8.8" > /etc/resolv.conf

设置DNS服务器

nets h interface ip set dns "Local Area Connection" static 8.8.8.8

27

ipconfig /registerdns

nupdate

注册DNS记录

ipconfig /registerdns

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

提供的命令对照表已浓缩两平台最实用的网络管理工具,包含从基础操作到高阶功能的全链路