CentOS using ifconfig does not show ip centos7 only there are no ifcfg-eth0 ifcfg-ens33 (no Eth0 card)

/ Etc / sysconfig / network-scripts / ifcfg-eth0 to ONBOOT to yes. Then service network restart

 

If centos7 only there are no ifcfg-eth0 ifcfg-ens33 (no Eth0 card) , the following solutions!

https://www.cnblogs.com/feixiangtk/p/6819118.html

 

After CentOS7 system is installed, enter the command ifconfig found no eth0, not in our habits. But can not remote ssh connection,

To solve this problem is fairly simple:

  

  A permanent fix

    1 into the directory / etc / sysconfig / network-scripts /

    2. ifcfg-ens33 file rename ifcfg-eth0;

 (Note: the user changes need to switch to the root)

    3. Edit the ifcfg-eth0

    Use the command: vi ifcfg-eth0

    Only you need to modify a parameter can be,

      The NAME = ens33 changed NAME = eth0

(This is a dynamic IP, IP may become once restarted, my other person's computer IP is dynamic, fixed if I die, there may be an IP conflict)

     Save and exit

      If you require a static IP

This put the above write parameters correspond to change it and add, change according to their own network, BOOTPROTO must be changed to static.

    4. Modify the grub file

      Directory: / etc / default

      Edit grub file

        Use the command: vi grub

        GRUB_CMDLINE_LINUX behind the original argument plus "net.ifnames = 0 biosdevname = 0"

  Save and exit

    The command line to run commands

      grub2-mkconfig -o /boot/grub2/grub.cfg

6.完成了,重启一下就ok了,不过重启之前可以顺带修改一个计算机名

      编辑文件: vi /etc/hostname

 就一行内容,就是计算机名,怎么写都行(英文的),保存退出

    7.重启计算机

      reboot

 

8.完成

 

 

二,临时搞定

    给ens33网卡一个临时ip,

 

Guess you like

Origin www.cnblogs.com/zeug/p/11308294.html