Article Title: solution to invalid Nic configuration in Linux. Linux is a technology channel of the IT lab in China. Some basic categories, such as desktop applications, Linux system management, kernel research, embedded systems, and open source, often occur. netconfig is used to set an IP address for the NIC, such as 192.168.1.2. then, when the service network restart is used, the error message is displayed: "the ip address of the NIC in use for eth0 is 172.16.0.
Nic cannot get the IP address of 192.168.1.2 eth0 startup failed.
The reason for this is that there are two Nic configuration files under linux. The two configuration files are inconsistent.
The solution is much easier. You can solve the problem by changing the two configuration files of the network card to the same one.
Nic configuration file storage location:
/Etc/sysconfig/network-scripts/ifcfg-eth0
/Etc/sysconfig/networking/devices/ifcfg-eth0
While the network command just modified the/etc/sysconfig/network-scripts/ifcfg-eth0 and another configuration file did not change. However, it is troublesome to modify these two files every time. The lazy method is to set one file to another connection. In the future, you only need to modify either of the two.
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