Debian 并不是“彻底删除” ifconfig,而是从默认安装和推荐工具集中逐步弃用,原因主要是 网络管理模型演进 + iproute2 更强大、更统一。
下面分点说明。
ifconfig 属于“老旧工具集”ifconfig 来自 net-tools 软件包,其历史可追溯到 BSD 和早期 Linux:
Debian 在多年发展中,倾向于不再默认安装 net-tools。
iproute2 成为官方推荐替代Debian 从很早开始就推荐使用 iproute2(提供 ip 命令):
ip 命令功能覆盖并超越 ifconfig示例对比:
# ifconfig
ifconfig eth0
# ip 替代
ip addr show eth0
# ifconfig eth0 up
ip link set eth0 up
ifconfig 无法很好支持现代网络特性一些 ifconfig 不支持或支持很差的内容:
而 ip 是为这些特性设计的。
在 Debian:
net-toolsbash: ifconfig: command not found
ipDebian 仍然可以安装:
apt install net-tools
安装后 ifconfig 仍可用,只是:
现代 Debian 使用:
systemd-networkdNetworkManager这些工具:
ifconfigDebian 弃用 ifconfig,不是因为它坏了,而是因为 iproute2 更现代、更完整,且符合当前 Linux 网络架构的发展方向。
如果你愿意,我也可以:
ifconfig → ip 对照表