Turn off Network-manager Network setup problem in Ubuntu! "Server Version"

Source: Internet
Author: User

In the Ubuntuserver version, because there is only command-line mode, you can only modify the/etc/network/interfaces if you want to set the network parameters. Here's how to set it up:

(1) ubuntuserver Modify IP Address

Open/etc/network/interfaces

sudo vim/etc/network/interfaces

Add the following statement:

Auto Eth0

Iface eth0inet Static

Addressxxx.xxx.xxx.xxx #IP地址

Netmaskxxx.xxx.xxx.xxx #子网掩码

Gatewayxxx.xxx.xxx.xxx #网关

(2) Ubuntuserver Modify DNS

Open/etc/resolv.conf

sudo vim/etc/resolv.conf

Change to the following content:

Searchlocaldomain #如果本Server为DNS服务器, can add this sentence, if not, can not add

nameserver172.16.3.4 #希望修改成的DNS

nameserver172.16.3.3 #希望修改成的DNS

(3) The last and most important step of ubuntuserver

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

sudo/etc/init.d/networking restart

"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, in accordance with the prompt step-by-step operation can be interested in friends, you can Google or Baidu.

But if you modify the interfaces and configure the Network-manager (NM), 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 interface in the upper right corner of the network connection icon is lost.

3, clearly configured in NM the correct network settings, why not on the network?

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

First, when there are no third-party network management tools (such as NM) in the system, the system defaults to the network configuration using the parameters in the interfaces file. (Just like the server version)



Then, when NM is installed within the system, NM defaults to the network configuration of the system and is configured using NM's own network configuration parameters.

However, if the user has manually modified the interfaces file after installing NM (the desktop version by default, NM), then the NM will automatically stop the management of the system network, the system using 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 to interfaces in the prevail. Conversely, in nm, whichever is the same.

2, when NM stops taking over, the network connection icon is lost.

3, the same is the problem of takeover.

If the user wants to use interfaces for network configuration directly in the desktop version, it is best to remove Network-manager.

If you want to continue using NM for network configuration after the above problems occur, you need to do the following:

sudo servicenetwork-manager stop # 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

# #里面有一行: Managed=true

# # If you change it by hand/etc/network/interfaces,nm will turn it into a line: Managed=false

# # Change False to True

sudo servicenetwork-manager start

Turn: Sycamore Leaf Technology Blog



Debian/ubuntu's Network-manager

Debian/ubuntu's Network-manager

There are two things that Debian/ubuntu manage the network connection,Graphical NetworkmanageR andthe ifup/ifdown of words,If the network card information is set in the/etc/network/interfaces, then NetworkManager will not take over the network card, if not set NetworkManager default will take over the network card.
NetworkManager the most convenient place is the PC with wireless network, because the text interface Iwlist Wlan0 Scan is not very useful, and Networkmanger can be like Windows to list all available WiFi hotspots, If there is a Chinese garbled, but also can be connected, but if your machine is used to do the server, or in the office, there is a fixed routing environment, in general, there will be a fixed IP, because this can facilitate the sharing of resources on the intranet. In short, it is not personal use, and do not move to move, it is best to turn off this networkmanager, of course, if you often with a book run, want to go to the coffee shop, you must open this NetworkManager, automatic search wireless very convenient.
Here are two things to say:
1, using Networkmanger to network, this time, if the use of wireless connection routing, and in the/etc/network/interfaces configured wired connection eth0, there will be a super weird problem: can access the network, but not access to the intranet, For example, no line by IP 192.168.0.1,ping This address, will show the IP address of the wired network card can not ping, not wireless! Prove that when the wired eth0 is set, it will take precedence, but strangely, the external network connection is normal, all I suspect this may be a Debian bug. So when using NetworkManager, you can comment out all/etc/network/interfaces content, just keep the local loopback network:
Auto Lo
Iface Lo inet Loopback
These two sentences. Set the fixed IP, which can be configured in the NetworkManager graphical interface.
2, close NetworkManager, close command: Sudo/etc/init.d/network-manager stop reboot: chkconfig network-manager off restart network:/etc/init.d/ Networking restart
Modify the/etc/network/interfaces file,
System configuration section: Local loopback network.
Auto Lo
Iface Lo inet Loopback
Wired configuration section:
Auto Eth0
#iface eth0 inet DHCP # If you do not want to use a fixed IP, it is recommended to use a fixed IP, which eliminates the time required for routing assignment
Iface eth0 inet Static
Netmask 255.255.255.0
Gateway 192.168.0.1 #gateway 0.0.0.0 # dial-up Internet Please set the gateway all to 0
Address 192.168.0.112
Wireless configuration section:
Auto Wlan0
Iface wlan0 inet Static
Netmask 255.255.255.0
Gateway 192.168.0.1
        address 192.168.0.113
        pre-up IP link set wlan0 up
        pre-up iwconfig wlan0 Essid SSID
         WPA-SSID Tp-link # Here's the SSID for the wireless name set in the route
        WPA-PSK 12345678 # Wireless password
    ADSL Dial-up Internet:
        auto dsl-provider
         iface dsl-provider inet PPP # Dsl-provider is a previously configured dial name
         provider dsl-provider
    

Turn off Network-manager network setup problem in Ubuntu! "Server version"

Related Article

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.