[Turn]network-manager and Interfaces conflict

Source: Internet
Author: User
Tags nameserver

[Turn]network-manager and Interfaces conflict http://blog.sina.com.cn/s/blog_48a45b9501010681.html Two ways of network configuration
There are two ways to modify the network configuration under Ubuntu: Graphical Interface (Network-manager) and modify/etc/network/interfaces
However, if the network settings are different in both ways, there will be a conflict, namely: Network-manager and/etc/network/interfaces file conflicts.


Server version
In the Ubuntu server version, because only the command-line mode is available, you can only modify the configuration file/etc/network/interfaces if you want to set the network parameters. Here's how to set it up:
(1) Ubuntu Server modified IP Address
Open/etc/network/interfaces:
sudo vim/etc/network/interfaces
Add the following statement:
Autoeth0
   iface eth0 inetstatic
      addressxxx.xxx.xxx.xxx #IP地址
      netmask xxx.xxx.xxx.xxx# Subnet Mask
      gatewayxxx.xxx.xxx.xxx #网关
(2) Ubuntu Server modifies DNS
Open/etc/resolv.conf
   sudo vim/etc/resolv.conf
Change to the following content:
   Search localdomain# If this server is a DNS server, you can add this sentence, if not, you can not add
   nameserver 172.16.3.4# Want to modify the DNS
   nameserver 172.16.3.3# Want to modify the DNS
(3) Ubuntu Server Restart Network
Add this command to restart the network configuration in the rc.local:
   Sudo/etc/init.d/networkingrestart


Desktop version
In the desktop version, you can modify/etc/network/interfaces to configure it, and you can configure it directly in the Network-manager. Reference the server version by interfaces the modified method. Network-manager configuration and intuitive, follow the instructions to step by steps, such as. Interested friends, you can Google or Baidu.



Network-manager and/etc/network/interfaces conflict
if interfaces is modified and Network-manager (NM) is configured, you will find some puzzling questions:
The network settings in 1:interfaces and NM are different, which is the actual IP of the system?
2: Sometimes inexplicably, the network connection icon in the upper right corner of the interface is lost.
3: Clearly in NM configured the correct network settings, why can not network it?

In fact, we need to know the relationship between interfaces and NM, these problems are not difficult to explain.

the relationship between Network-manager and/etc/network/interfaces
1: When there are no third-party network management tools (such as NM) within the system, the system uses the parameters in the interfaces file for network configuration by default.
2: When NM is installed within the system, NM takes over the system's network configuration by default and is configured with NM's own network configuration parameters.
3: However, if the user after installing NM (desktop version by default, NM), and then manually modified the interfaces file,
That NM automatically stops the management of the system network, and the system uses the parameters within the interfaces file for network configuration.
At this point, to modify the parameters within NM, does not affect the actual network configuration of the system.
To allow the configuration in NM to take effect, you must re-enable the network configuration of the NM takeover system.

Now that you know the working relationship between the two, look at the three questions above:
1: To see if NM take over, if not take over, the actual IP settings of the system in the interfaces prevail. Conversely, in nm, whichever is the same.
2: When NM stops taking over, the network connection icon is lost.
3: The problem is likewise taken over.
If the user wants to use interfaces for network configuration directly in the desktop version, it is best to remove Network-manager.

Network-manager re-takeover
If you want to continue using NM for network configuration after the above problems occur, you need to do the following:
sudo service network-managerstop# Stop NM service
sudo rm/var/lib/networkmanager/networkmanager.state # remove NM status file
sudo gedit/etc/networkmanager/nm-system-settings.conf # Open NM configuration file
# # # inside a line: managed=true
# # If you hand-/etc/network/interfaces, NM will change the line to: Managed=false
# # Change False to True
sudo service network-managerstart # start NM service

[Turn]network-manager and Interfaces conflict

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.