在 Debian 系统中,查看网卡信息有多种方式,下面按常用程度给你介绍几种最实用的方法(适用于 Debian 10/11/12)。
ip 命令(最常用)ip addr
或简写:
ip a
✅ 可看到:
eth0、ens33、enp0s3)示例:
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether 00:0c:29:xx:xx:xx
inet 192.168.1.100/24
ip link
state UP ✅ 网卡已启用state DOWN ❌ 网卡未启用ip -s link
可以看到:
lspci | grep -i net
ethtool -i 网卡名
示例:
ethtool -i ens33
ethtool 网卡名
示例:
ethtool ens33
可看到:
ifconfig(需安装 net-tools)sudo apt install net-tools
ifconfig
⚠️ 已逐渐被 ip 命令取代。
cat /etc/network/interfaces
nmcli device status
nmcli device show
ip route
| 目的 | 命令 |
|---|---|
| 查看 IP | ip a |
| 查看状态 | ip link |
| 查看流量 | ip -s link |
| 查看驱动 | ethtool -i eth0 |
| 查看速率 | ethtool eth0 |
| 查看型号 | lspci | grep net |
如果你愿意,可以告诉我:
cat /etc/debian_version)我可以给你更精确的命令 ✅