Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Since I don't use GNOME now and try wmii, the nm-applet is no longer available for me.I know there is nmcli for the control. What I'm really interested in is that can it really be a substitute for nm-applet.

man nmcli, there are these words, which makes me confused:

  1. It is not meant as a replacement of nm-applet or other similar clients.

    What does other similar clients mean?

  2. The use case comprise:

    • Servers, headless machines:No GUI is available; then nmcli is used to talk directly to NetworkManager and control only system-wide connections.

    • User sessions: For this case, nmcli can talk to nm-applet to find user connections.It can still talk directly to NetworkManager for manipulating these connections. As nmcli doesn't have direct access to user configuration data in GConf, nm-applet handles that itself. That may, for example, cause the applet to pop up keyring dialogs when secrets are needed.

    As nmcli can work directly without X, Why can't it work as well when secrets are needed?

PS. Is there any alternate easy approach to control connections using command line?

share|improve this question

4 Answers 4

First of all let me say that nm-applet can be used in environments other than Gnome: I used it successfully in awesome and in openbox.

nmcli do not provide the same functionalities of nm-applet, e.g. you cannot configure new connections.

A valid alternative to connect to wired or wireless networks from command line is wicd-curses.

share|improve this answer

similar clients mean applications that do similar things as nm-applet, but isn't nm-applet. Since Network Manager is driven by DBus, anyone is free to write clients to control it without interacting with Network Managers code in any way. It's sort of like how you can connect to a web server with different browsers without changing the server.

Headless servers doesn't need secrets the same way a laptop does.

I don't think the manpage says you can't use secrets. It says that if you have nm-applet installed, then it can be reused to provide per-user network configurations and personal passwords. If it isn't available, then I assume you would have to provide the secrets yourself.

I don't normally use Network Manager from the command line. But it uses DBus, so it would be relatively easy to write a curses-application for it, or something. Or you could just use dbus-end manually, but that might not be pleasant.

share|improve this answer
I think I should read the manual more carefully. BTW,are there any friendly but powerful tools as substitutes for networkmanager from the command line? – Hongxu Chen Jul 25 '11 at 0:34

You can use the command line to configure a connection. For example, this command will create a vpn connection:

nmcli con add type vpn ifname '*' vpn-type libreswan

If you need a secret then you can edit the config files for a vpn directly. These are located at

/etc/NetworkManager/system-connections/[connection name]. 

Open the file in your favorite editor and add the lines

password=[my password]

If you give a man a command he can use linux for the day, if you teach a man to man, he will be a professional

share|improve this answer
On which version of Ubuntu should this work? Ubuntu 14.04.3 has nmcli tool, version which does not understand nmcli con add …: Usage: nmcli connection { COMMAND | help } COMMAND := { list | status | up | down | delete }. – pabouk Sep 23 at 13:46
OK, it seems that since Ubuntu 15.04 there is nmcli which supports nmcli con add …. ...but this version of Ubuntu was not available at the time of writing your answer :) – pabouk Sep 23 at 13:56

Yes, you can use nmcli to connect instead of nm-applet. you can totally control your network connection using command line.

share|improve this answer
Can you develop your answer? For instance, can you answer the two bold questions of Hongxu Chen? Thank you – NorTicUs Oct 23 '12 at 9:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.