温馨提示×

为什么Debian无ifconfig

小樊
42
2026-09-03 11:44:01
栏目: 智能运维

较新版本的 Debian(如 Debian 9 及以后)中,默认不再安装 ifconfig,主要原因如下:


1. ifconfig 属于已废弃的工具集(net-tools)

  • ifconfig 来自 net-tools 软件包
  • net-tools 早已被上游(Linux 社区)废弃,不再积极维护
  • 官方推荐用 iproute2 替代

2. 推荐使用 ip 命令(iproute2)

Debian 默认安装的是 iproute2,对应命令是:

ip addr      # 替代 ifconfig
ip link      # 查看/管理网卡
ip route     # 替代 route

例如:

ip addr show

3. 最小化安装理念

Debian 越来越倾向于:

  • 最小化依赖
  • 默认只包含现代、维护中的工具

所以 net-tools 不再默认安装。


4. 如果你仍想用 ifconfig

可以手动安装:

sudo apt update
sudo apt install net-tools

安装后即可使用:

ifconfig

总结

不是 Debian 去掉了 ifconfig,而是它不再默认提供老旧、废弃的 net-tools,转而使用更强大、标准的 ip 命令。

如果你是学习或运维老资料,装回 net-tools 即可,但新环境建议习惯用 ip

需要我对比 ifconfigip 的命令对照表吗?

0