Is it possible to use nmcli completely without nm-applet?

12,040

Solution 1

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.

Solution 2

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:
12,040
Hongxu Chen
Author by

Hongxu Chen

Updated on September 18, 2022

Comments

  • Hongxu Chen
    Hongxu Chen over 1 year

    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?

  • Hongxu Chen
    Hongxu Chen almost 13 years
    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?
  • NorTicUs
    NorTicUs over 11 years
    Can you develop your answer? For instance, can you answer the two bold questions of Hongxu Chen? Thank you
  • pabouk - Ukraine stay strong
    pabouk - Ukraine stay strong over 8 years
    On which version of Ubuntu should this work? Ubuntu 14.04.3 has nmcli tool, version 0.9.8.8 which does not understand nmcli con add …: Usage: nmcli connection { COMMAND | help } COMMAND := { list | status | up | down | delete }.
  • pabouk - Ukraine stay strong
    pabouk - Ukraine stay strong over 8 years
    OK, it seems that since Ubuntu 15.04 there is nmcli 0.9.10.0 which supports nmcli con add …. ...but this version of Ubuntu was not available at the time of writing your answer :)