在 现代 Debian 中,默认情况下不能直接使用 ifconfig,但可以安装后使用。
ifconfig 属于 net-tools 工具包ip 命令(iproute2)ifconfig 会提示:bash: ifconfig: command not found
sudo apt update
sudo apt install net-tools
ifconfig
Debian 官方更推荐使用 ip 命令:
ip addr # 查看网卡
ip link # 查看链路状态
ip route # 查看路由
✅ Debian 可以使用 ifconfig
❌ 但默认不自带,需安装 net-tools
✅ 新系统建议学习并使用 ip 命令
如果你是服务器环境或脚本兼容性需求,我可以帮你对比 ifconfig 和 ip 的对应用法。