温馨提示×

debian ifconfig怎么找

小樊
34
2026-10-09 11:39:17
栏目: 智能运维

在 Debian 里分几种情况,下面按最常见场景说明:


1️⃣ ifconfig 命令找不到(推荐先看这个)

新版本 Debian 默认不安装 net-tools,所以直接运行会提示:

bash: ifconfig: command not found

安装 ifconfig

sudo apt update
sudo apt install net-tools

然后就能用了:

ifconfig

2️⃣ 查看网络接口(不装 ifconfig 也行)

Debian 推荐使用 ip 命令:

ip addr

或简写:

ip a

查看网卡状态:

ip link

3️⃣ 只查看网卡名(找接口)

ls /sys/class/net

4️⃣ 查看路由

ip route

(老命令是 route)


5️⃣ Debian 网络配置文件位置

/etc/network/interfaces

或用 NetworkManager:

nmcli device status

✅ 总结

需求 命令
找网卡 ip a
想用 ifconfig apt install net-tools
看 IP ip addr
看网关 ip route

如果你是想配置静态 IP / 查不到网卡 / 虚拟机没网,可以把情况说一下,我可以直接帮你写配置。

0 踩