ifconfig: command not found(CentOS专版,其他的可以参考)

    xiaoxiao2021-03-25  69

    ifconfig: command not found(CentOS专版,其他的可以参考)

    ifconfig: command not found

    查看path配置(echo相当于c中的printf,C#中的Console.WriteLine)

    1 echo  $PATH

     

    解决方案1:先看看是不是root用户,如果不是就 su 切换到root用户

    su

    解决方案2:(如果没看见 /sbin)【我们这显然不是这个问题】

    这个一般都是因为配置没弄好,永久解决:

    打开/etc/profile文件,在其中输入export PATH=$PATH:/sbin

     

    解决方案3:(CentOS后来换指令了,看看我们是不是【ipconfig==>ip】)

    在 /(根目录)里面查找 name(名字)是 ifconfig 的东东

    说明ipconfig真的换了,淡定

    看看信息

    1 ip addr

    发现木有(看 2:eth0 没有ipv4)

    跳转到 /etc/sysconfig/network-scripts 目录

    1 cd  /etc/sysconfig/network-scripts

    用vi打开 ifcfg-eth0 (你的可能是eth1,或者其他,不是每个电脑都是这个的)【如果想改成这个可以参考:http://jingyan.baidu.com/article/7f41ecec1b022e593d095c1e.html】

     i 进去编辑模式 ,修改箭头处,然后按 esc 退回命令模式,输入:wq 并回车

    重启一下 

    1 reboot

    用root用户登陆后 输入 

    1 ip addr

    成功!!

     

    解决方案4:(网络)

    http://blog.sina.com.cn/s/blog_946cb2b70100wx2j.html

     

    yum install setuptool安装setup,不过安装后使用运行setup只有Authentication configuration可用。

    如想配置IP,安装system-config-network-tui即可。

    yum install system-config-firewall-tui安装图形化Firewall配置工具。

    yum list system-config*  全部安装。

     

    参考:http://blog.csdn.net/johnstrive/article/details/5625121

    转载请注明原文地址: https://ju.6miu.com/read-39102.html

    最新回复(0)