在 较新版本的 Debian(大致从 Debian 9 / 10 起,尤其是使用 systemd 的版本)中:
ifconfig 为什么“消失”了?ifconfig 属于 net-tools 软件包net-toolsip)所以:
ifconfig
会出现:
bash: ifconfig: command not found
which ifconfig
或
command -v ifconfig
使用 ip 命令(已默认安装):
ip addr
# 或简写
ip a
ip route
ip link set eth0 up
ip link set eth0 down
可以手动安装:
sudo apt update
sudo apt install net-tools
安装后即可使用:
ifconfig
net-tools 已停止维护多年iproute2 功能更强大、更统一ip不是 ifconfig 消失,而是 Debian 默认不再安装它。
如果你愿意,我可以:
ifconfig 习惯平滑迁移到 ipifconfig 命令对应的 ip 写法