温馨提示×

debian是否自带ifconfig

小樊
44
2026-09-09 13:47:48
栏目: 智能运维

在较新版本的 Debian(例如 Debian 9 及以后,尤其是 Debian 10/11/12)中,默认已经不再自带 ifconfig 命令。

原因:

  • ifconfig 属于 net-tools 软件包
  • 新版 Debian 默认使用 iproute2(ip 命令)替代 net-tools
  • 安装系统时通常不会自动安装 net-tools

✅ 检查是否可用:

which ifconfig

若没有输出,说明未安装。

✅ 安装 ifconfig(如果需要):

sudo apt update
sudo apt install net-tools

✅ 推荐替代命令(Debian 自带):

ip addr
ip link
ip route

总结:

  • 老版本 Debian(≤8):一般自带
  • 新版本 Debian(≥9):默认不带,需要手动安装 net-tools

如果你是服务器或容器环境,通常也是没有 ifconfig 的。

0 踩