导读 CentOS 发行版在安装锐速安装包时需要配置设备的网卡因此会使用到 ipconfig 命令来完成某些必要的操作。

其他情况下你可能也会使用 ipconfig 命令来配置网络选项,如果是初次安装的系统你可能就会遇到如下问题:

ipconfig: command not found
serverspeeder.sh: line 141: ifconfig: command not found
serverspeeder.sh: line 144: ifconfig: command not found

出现此问题的原因绝大多数情况下可能都是系统没有附带ipconfig,例如你安装的是CentOS最小安装包模式。

因此这个时候只需要我们使用命令安装ipconfig即可,命令如下:

yum install upgrade
yum install net-tools

如果本身已经安装了ipconfig但依然报错那就需要看看环境变量的设置:

#echo $PATH

如果环境变量中没有包含ipconfig命令的路径则需要临时修改环境变量:

$export PATH = $PATH:/sbin

修改完成后测试ipconfig是否可以正常使用,如果可以正常使用则需要永久修改:打开/etc/profile

然后在该文件中填写export PATH=$PATH:/sbin并保存,保存后重启系统即可直接使用ipconfig命令了。

原文来自:https://www.landiannews.com/archives/38609.html

本文地址:https://www.linuxprobe.com/centos-ifconfig-not.html编辑:倪家兴,审核员:逄增宝

Linux命令大全:https://www.linuxcool.com/

Linux系统大全:https://www.linuxdown.com/

红帽认证RHCE考试心得:https://www.rhce.net/