温馨提示×

debian能否使用ifconfig

小樊
52
2026-09-06 16:02:55
栏目: 智能运维

现代 Debian 中,默认情况下不能直接使用 ifconfig,但可以安装后使用

情况说明

  • ifconfig 属于 net-tools 工具包
  • 新版本 Debian(如 Debian 9 及以后)默认只装 ip 命令(iproute2)
  • 所以刚装完系统执行 ifconfig 会提示:
    bash: ifconfig: command not found
    

如何使用 ifconfig

1️⃣ 安装 net-tools

sudo apt update
sudo apt install net-tools

2️⃣ 然后使用

ifconfig

推荐方式(官方建议)

Debian 官方更推荐使用 ip 命令:

ip addr        # 查看网卡
ip link        # 查看链路状态
ip route       # 查看路由

总结

✅ Debian 可以使用 ifconfig
❌ 但默认不自带,需安装 net-tools
✅ 新系统建议学习并使用 ip 命令

如果你是服务器环境或脚本兼容性需求,我可以帮你对比 ifconfigip 的对应用法。

0