参考博客https://blog.csdn.net/q290994/article/details/61643500
我下载的linux版本cetos7,默认情况下不能使用ifconfig命令,可以通过安装net-tools工具解决,yum -y install net-tools命令安装net-tools工具。若失败则是因为网卡没有配置成功,需要应用vi工具打开
vi /etc/resolv.conf
进入配置文件后加入
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
按 ESC键跳回命令模式,输入:wq!保存并退出。
接着在shell中输入yum -y install net-tools
输入ifconfig 就能成功了