CentOS7 ipconfig命令不可用~

  • Post author:
  • Post category:其他


使用CentOS时提示:



ifconfig: command not found,




ifconfig: command not found




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


1


echo


$PATH








首先


:先看看是不是root用户,如果不是就 su 切换到root用


su



其次:



(如果没看见 /sbin)很明显我们不是这个问题、、、


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

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




第三:

有可能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




成功!!




其他:(网络)



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