在 较新版本的 Debian(尤其是 Debian 9 及以后)中,ifconfig 命令“不见了”,原因主要如下:
ifconfig 属于 net-tools,已被弃用ifconfig、route、netstat 等命令来自 net-toolsip 命令(iproute2)Debian 从某个版本开始:
net-toolsifconfigwhich ifconfig
如果输出为空,说明没安装。
ip(推荐)ip addr
ip link
ip route
等价关系:
| 旧命令 | 新命令 |
|---|---|
| ifconfig | ip addr / ip link |
| route | ip route |
| netstat | ss |
sudo apt update
sudo apt install net-tools
安装后:
ifconfig
iproute2 功能更强大不是 Debian 删了 ifconfig,而是默认不再装 net-tools。
如果你愿意,我可以:
ifconfig → ip 对照速查表