Tip: Using nmcli to connect to Internet in Enlightenment

April 03, 2015
If you are using Enlightenment in OpenSUSE or some other Linux distribution1 , chances are you may face problems in using the NetworkManager to connect to Internet.

This is because the  NetworkManager applet (nm-applet) doesn't show itself in the taskbar of the Enlightenment desktop. And as the saying goes - what you can't see, you can't control.



Fortunately, NetworkManager uses the command line tool called 'nmcli' in the back-end to do all its tasks. If you know which options to use, you can directly run nmcli on the command line and connect to Internet.

Here I will explain a neat trick I learnt to connect my cellphone (BSNL network) to Internet from Enlightenment desktop.

  1. Connect the cell phone to your PC using a USB cable.
  2. Open a terminal while in Enlightenment and type the following command.
    $ nmcli d status
    I got the following output.
    DEVICE   TYPE      STATE         CONNECTION 
    ttyACM0  gsm       disconnected  --         
    enp3s0   ethernet  unavailable   --         
    lo       loopback  unmanaged     --        
  3. From the above output, I inferred that ttyACM0 is my cellphone as its type is 'gsm' and it is in a disconnected state.
  4. To connect to internet, I just typed the following command.
    $ nmcli d connect ttyACM0
    and I received the following message.
    Device 'ttyACM0' successfully activated with '75f8f423-8a37-4be5-822f-b5f30e24b2f9'.
  5. When I did a status check, I received the following message.
    $ nmcli d status
    DEVICE   TYPE      STATE        CONNECTION               
    ttyACM0  gsm       connected    BSNL/CellOne New GPRS/3G 
    ppp0     unknown   connected    ppp0                    
  6. To disconnect your device and log off from Internet do the following.
    $ nmcli d disconnect ttyACM0
nmcli has a lot more options which allow you to create and manage a variety of network connections including wireless networks.  But the above set of commands helped me to connect to Internet using my cell phone in Enlightenment. For more details check the man page of nmcli command.

1 Bodhi Linux is an exception.