報錯
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作用相同