Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that device eth0 does not exist under centos

How to solve the problem that device eth0 does not exist under centos

WJ
WJOriginal
2020-06-03 15:42:263911browse

How to solve the problem that device eth0 does not exist under centos

How to solve the problem that device eth0 does not exist under centos?

1. Create a new ifcfg-eth0 file in the /etc/sysconfig/network-scripts/ directory;

2. Correctly set the DEVICE, BOOTPROTO, ONBOOT, IPADDR, GATEWAY, DNS1, DOMAIN, NETMASK, NETWORK, NAME, etc. of ifcfg-eth0,

For example:

            DEVICE=eth0                    物理设备名称
            IPADDR=192.168.1.x         IP地址
            NETMASK=255.255.255.0  子网掩码
            NETWORK=192.168.1.0     指定网络,通过IP地址和子网掩码自动计算得到
            GATEWAY=192.168.1.1     网关地址
            BROADCAST=192.168.1.255 广播地址,通过IP地址和子网掩码自动计算得到
            ONBOOT=[yes|no]             引导时是否激活设备
            USERCTL=[yes|no]           非ROOT用户是否可以控制该设备
            BOOTPROTO=[none|static|bootp|dhcp]    引导时不使用协议|静态分配|BOOTP协议|dhcp协议
            HWADDR=00:13:D3:27:9F:80   MAC地址
            NAME=eth0 名称

3. After the above settings, it can be successful under normal circumstances. If there are still problems, add # at the end of the file /etc/rc.d/rc.local ##ifup eth0 (/etc/rc.local script is executed after all other initialization scripts have been executed).

4. Restart the computer, OK.

Related reference:

centOS tutorial

The above is the detailed content of How to solve the problem that device eth0 does not exist under centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn