如何在Debian上安装ifconfig?

如果您尝试使用Debian 10中的ifconfig命令获取IP或网络详细信息,则会遇到“ifconfig: command not found”错误。
-bash: ifconfig: command not found
如何在Debian上安装ifconfig?
Debian默认未安装ifconfig软件包。这是因为不建议使用ifconfig,而推荐使用新的ip命令。现在,此ip命令负责修改或显示路由,网络设备,接口和隧道。
如果你还想使用旧的 ifconfig 命令,你必须重新安装它。
在Debian中安装ifconfig命令
如果尝试直接安装ifconfig命令,则Debian系统将找不到此软件包。
[email protected]:~# apt install ifconfig
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package ifconfig
如何在Debian上安装ifconfig?

这是因为ifconfig本身不是包。它与包含一些其他联网工具的net-tools软件包一起安装。
因此,要获取ifconfig,您需要安装net-tools软件包,如下所示:
sudo apt install net-tools
如何在Debian上安装ifconfig?
安装后,使用ifconfig命令:
ifconfig
但是,我强烈建议你开始使用IP命令。迟早有一天,net-tools会被完全废弃,你将无法安装它。A5互联https://www.a5idc.net/