Ubuntu (14.04) network management based on NetworkManager Network management tool

Source: Internet
Author: User

In the command line in the multi-network management is a special demand from me, but for a variety of reasons, do not want to change back to network that old way to manage the network.

Let's talk about this particular need:

Run Ubuntu (virtual machine) in your notebook, with a Web site project, because both in the office and at home can be simultaneously through the external network debugging project, so also integrated peanut shell. In this case, because the network environment of home and office is different, So in Ubuntu with Networkmangager made two profiles, an Office configuration, a home configuration, each change in the environment, the desktop with the mouse network configuration switch.

The current issue, the development of this project into another phase, in order to allow other developers to access, but also to consider saving memory, from the virtual machine to reduce the memory value of Ubuntu, from the command line later on the network management.

Then the question comes,

1. Two configuration files are specified static IP address, so NetworkManager will think that both configuration files can be used, will not pass the intelligent detection of network switching;

2. How to manually switch NetworkManager at the command line.

You might say, to unify the network environment, the home and Office configuration can be accessed with an IP. This way, the office to change the network configuration, will certainly affect other colleagues, home to change the network environment, other devices will also be followed (cell phone, TV, Box ...) It's also a very troublesome thing.

Because just start Ubuntu environment, Master should have a better way, so please do not spray:

Let's take a look at NetworkManager's use Help:

USAGE:NMCLI [OPTIONS] OBJECT {COMMAND | help}


OPTIONS
-t[erse] Terse output
-p[retty] Pretty output
-m[ode] Tabular|multiline Output mode
-f[ields] <field1,field2,... >|all|common specify fields to output
-e[scape] yes|no Escape columns separators in values
-n[ocheck] don ' t check nmcli and NetworkManager versions
-v[ersion] Show program version
-H[ELP] Print this Help


OBJECT
NM NetworkManager ' s status
C[onnection] NetworkManager ' s connections
D[evice] devices managed by NetworkManager


Take a look at my configuration again:

dinofish@ubuntu:~$ NMCLI C
Name UUID type Real time stamp
Home 626e0ddd-c03d-4138-8b67-13284c6427f6 802-3-ethernet August 04, 2014 Monday 01:34 55 seconds
Office 2de58f26-884d-43e9-a451-0ccb68892637 802-3-ethernet August 04, 2014 Monday 01:15 34 seconds

One home configures an office configuration


So each time you switch, you only need to run the following command:

dinofish@ubuntu:~$ NMCLI c up ID Office

Or

dinofish@ubuntu:~$ NMCLI c up ID  home

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.