CentOS 7中没有ifconfig命令,而且不能发现eth0

来源:互联网 发布:法学网络课程 编辑:程序博客网 时间:2024/05/06 00:54

1、由于安装时使用的是最小化安装CentOS 7,安装完成后没有发现ifconfig命令

      检查/sbin下也没有这个命令。使用的是root身份。
      #yum install -y net-tools\*
     可以成功安装ifconfig
CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
 2、我的网卡是Atheros AR8131 PCI-E,但是安装过程中没有提示设置网卡,安装好后也没有发现ifcfg-eth0的          配置文件。
CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
      使用dmesg | grep -in eth检查开机信息中有没有eth0的消息
CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
      发现由interface eth0改为了ens33
3、更改网卡的名字 -  由ens33改为eth0
CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
    修改grub中的GRUB_CMDLINE_LINUX,追加语句"net.ifnames=0 biosdevname=0“。
    然后执行# grub2-mkconfig -o /boot/grub2/grub.cfg
    之后重启# reboot
CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
  再查看网卡,发现名字已经更改过来了。
 CentOS 7中没有ifconfig命令,而且不能发现eth0 - Aaron - 飄緲峰主人
 但是仍需要将/etc/sysconfig/network-scripts/ifcfg-ens33更名为ifcfg-eth0,同时修改其内容,指定IP、NETMASK及GATEWAY,同时修改onboot=no为yes。最后执行service restart network。
0 0