Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What about the network failure caused by Linux backing up ifcfg-eth0 files?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to do the network failure caused by Linux backup ifcfg-eth0 file". In the daily operation, I believe that many people have doubts about how to do the network failure caused by Linux backup ifcfg-eth0 file. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the question of "how to do the network failure caused by Linux backup ifcfg-eth0 file". Next, please follow the editor to study!

The network was not configured when the system was installed, and the network was not configured until the system was installed and learned the IP, subnet mask and gateway information from the system administrator. Back up a configuration file before modifying the ifcfg-eth0 Nic configuration file, so as not to restore to the original configuration due to improper modification. This is also the cause of things.

[root@localhost ~] # cd / etc/sysconfig/network-scripts/ [root@localhost network-scripts] # cp ifcfg-eth0 ifcfg-eth0_bak [root@localhost network-scripts] # more ifcfg-eth0_bak # Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth0 BOOTPROTO=dhcp HWADDR=00:50:56:92:56:05 ONBOOT=yes

Next, add IP address, subnet mask, etc.

[root@localhost network-scripts] # vi ifcfg-eth0 # Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth0 BOOTPROTO=static # BROADCAST=192.168.7.255 HWADDR=00:50:56:92:56:05 IPADDR=192.168.7.222 NETMASK=255.255.255.0 ONBOOT=yes TYPE=Ethernet

After adding the gateway information under the configuration file / etc/sysconfig/network, restart the network service, and the result is as follows:

[root@localhost network-scripts] # more / etc/sysconfig/network

NETWORKING=yes

GATEWAY=192.168.7.1

NETWORKING_IPV6=no

HOSTNAME=localhost.localdomain

Then enter the graphical configuration interface through the setup command, and the result is as follows. Because the backup file name is ifcfg-eth0_bak, the Linux system regards it as the configuration information of another network card. As a result, the IP address cannot be bound to the network card (because there is nothing in the configuration file).

[root@localhost ~] # setup

So rename the backup file to bak_ifcfg-eth0, restart the network service, OK, the network card bound to the IP address, the network is unblocked.

[root@localhost network-scripts] # mv ifcfg-eth0_bak bak_ifcfg-eth0 [root@localhost network-scripts] # service network restart Shutting down interface eth0: [OK] Shutting down loopback interface: [OK] Bringing up loopback interface: [OK] Bringing up interface eth0: [OK] [root@localhost network-scripts] # at this point, the study on "what to do with the network failure caused by Linux backing up ifcfg-eth0 files" is over. I hope to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report