在 Debian 下,ifconfig 默认 不再预装,它属于 net-tools 软件包。
sudo apt update
sudo apt install net-tools
安装完成后即可使用:
ifconfig
which ifconfig
通常路径是:
/sbin/ifconfig
现代 Debian 更推荐使用 ip 命令:
ip addr # 查看 IP 地址
ip link # 查看网卡状态
ip route # 查看路由
apt install net-tools/sbin/ifconfigip 命令如果你是在 Docker / 最小化 Debian 里,我也可以帮你确认适合的网络查看方式。