Network-manager conflicts with Interfaces

Source: Internet
Author: User

[From] rotate.

There are two ways to modify the network configuration in Ubuntu: network-manager and/etc/network/interfaces, the network-manager file conflicts with the/etc/network/interfaces file.

1 Server version

In Ubuntu Server, because only the command line mode exists, you can only modify the configuration file to set network parameters.
/Etc/network/interfaces. The specific settings are as follows:
(1) modify the IP address of Ubuntu Server
Open/etc/network/interfaces:

sudo vim /etc/network/interfaces

Add the following statement:

Auto eth0iface eth0 inet staticaddressxxx. xxx # IP address netmask xxx. xxx # subnet mask gateway xxx. xxx # gateway

(2) modify the DNS of Ubuntu Server
Open/etc/resolv. conf

sudo vim /etc/resolv.conf

Change to the following content:

Search localdomain # If this Server is a DNS Server, add this sentence. If not, do not add nameserver 172.16.3.4 # the DNS Server you want to modify to: DNSnameserver 172.16.3.3 #

(3)
Ubuntu Server restarts the network

Add the command to restart the network configuration in rc. local:

sudo /etc/init.d/networking restart

2. Desktop version
In the Desktop version, you can modify/etc/network/interfaces for configuration. You can also directly configure it in network-manager. Use interfaces to modify the Server version. The network-manager configuration is intuitive and can be performed step by step as prompted. If you are interested, you can Google or Baidu on your own.
If interfaces is modified and network-manager (nm) is configured, you will find some inexplicable problems:

  1. The network settings in interfaces and nm are different. What is the actual IP address of the system?
  2. Sometimes, the network connection icon in the upper-right corner of the interface is lost.
  3. Why can't I access the network even if the correct network settings are configured in nm?

In fact, we need to know the relationship between interfaces and nm, and these problems are not difficult to explain.
Network-manager and/etc/network/interfaces:

  1. When no third-party network management tools (such as nm) exist in the system, the system uses parameters in the interfaces file by default for network configuration.
  2. After nm is installed in the system, nm takes over the network configuration of the system by default, and uses its own network configuration parameters for configuration.
  3. However, if you manually modify the interfaces file after the nm is installed (the nm is installed by default in the Desktop version), the nm will automatically stop managing the system network and change the system usage.
    Configure the parameters in the interfaces file. In this case, modify the parameter in nm without affecting the actual network configuration of the system. To make the configuration within the nm take effect, you must re-enable the nm.
    Take over the network configuration of the system.

Now that we know the working relationship between the two, let's look at the above three questions:

  1. It depends on whether the nm takes over. If the system does not, the actual IP settings of the system are subject to interfaces. Otherwise, take the value in nm as the standard.
  2. When nm stops taking over, the network connection icon is lost.
  3. It is also a matter of taking over. If you want to directly use interfaces for network configuration in the Desktop version, you 'd better delete network-manager.
    .

Network-manager
If you want to continue using nm for network configuration after the above problem occurs, you need to perform the following operations:

Sudo service network-managerstop # Stop the nm service sudo rm/var/lib/NetworkManager. state # Remove the state file sudo gedit/etc/NetworkManager/nm-system-settings.conf # Open the configuration file # There is a line in it: managed = true # If you manually change/etc/network/interfaces, nm will change this line to: managed = false # Change false to truesudo service network-manager start

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.