Network faults caused by Linux backup of ifcfg-eth0 files

Source: Internet
Author: User

Today, when I configure a network for an Oracle Linux Server release 5.7 Server, I encountered the problem of backing up the ifcfg-eth0 configuration file, which caused the NIC to be unable to bind an IP address. I think this is an interesting case. I would like to record it for your reference to avoid making similar mistakes in the future.

The network is not configured when the system is installed. After the system is installed, the system administrator will learn about the IP address, subnet mask, and gateway information before configuring the network. Back up a configuration file before modifying the ifcfg-eth0 Nic configuration file to avoid the failure to restore to the original configuration due to improper modification. This is also the cause of the incident.

[Root @ localhost ~] # Cd/etc/sysconfig/network-scripts/

[Root @ localhost network-scripts] # cp ifcfg-eth0 ifcfg-eth0_bak

[Root @ localhost network-scripts] # ifcfg-eth0_bak more

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE = eth0

BOOTPROTO = dhcp

HWADDR = 00: 50: 56: 92: 56: 05

ONBOOT = yes

Next, add IP addresses and subnet masks.

[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

For more details, please continue to read the 2nd page content:

Recommended reading:

VMware clones CentOS 6.4 and then resets eth0

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.