报错
bash: ifconfig: command not found
原因
Debian 上默认不安装 ifconfig 软件包。这是因为 ifconfig 已被弃用,取而代之的是新的 ip 命令。该 ip 命令现在负责修改或显示路由、网络设备、接口和隧道
如果仍然想使用旧的 ifconfig 命令,则必须显式安装它。
解决方案
安装net-tools套件
sudo apt install net-tools
可能遇到的问题
用户没有权限
可能的一种解决方案:Linux下 <用户名> is not in the sudoers file-CSDN博客
安装之后可以使用命令
sudo ifconfig
使用iproute2套件
参考链接:https://blog.csdn.net/yimaoya/article/details/125341754
ip addr
该命令和ifconfig作用相同