You are not logged in.

#1 2014-03-19 07:17:39

ansh_kumar
Member
Registered: 2013-02-01
Posts: 89

[SOLVED]using NetworkManager through nmcli

I want to connect to my college wifi through command. So I'm using nmcli. I've created a configuration file /etc/NetworkManager/system-connections/library.conf with the following content:

    [802-11-wireless]
    mac-address=0c:84:dc:xx:xx:xx
    #ssid=
    mode=infrastructure
    #security=802-11-wireless-security

    #[802-11-wireless-security]
    #key-mgmt=wpa-psk
    #psk=YOUR PASSWORD

    [connection]
    id=library
    uuid=60268d4e-8124-4193-a539-832276025ce2
    type=802-11-wireless
    timestamp=0
    autoconnect=true

    [ipv4]
    method=manual
    address=212.224.xxxx.xxx
    gateway=212.224.xxx.xxx
    netmask=255.255.xxx.xxx
    dns=8.8.8.8
    auto-dns=212.224.xxx.xxx
    
    [ipv6]
    method=auto

The wifi connection is open and have to manually set the ipv4 setting as follows

IP:	212.224.xxx.xxx
subnet mask:	255.255.xxx.xxx
gateway:	212.224.xxx.xxx
DNS:	8.8.8.8
Alter:	212.224.xxx.xxx

I've changed the permission of the file /etc/NetworkManager/system-connections/library.conf  to 0600.
When I type "nmcli connection list" I'm able to get the connection in the list but when I type "nmcli con up id library" it shows the following error:

Error: Unknown connection: library.

What am I doing wrong ?

Last edited by ansh_kumar (2014-03-22 14:25:52)

Offline

#2 2014-03-22 14:19:01

ansh_kumar
Member
Registered: 2013-02-01
Posts: 89

Re: [SOLVED]using NetworkManager through nmcli

I've found the solution myself.
Here is the configuration file which was wrong previously

etc/NetworkManager/system-connections/@LIBRARY

[connection]
id=@LIBRARY
uuid=8f3d0e25-7965-4cb7-acb4-bb7c00a5c46e
type=802-11-wireless
permissions=user:ansh:;

[802-11-wireless]
ssid=@LIBRARY
mode=infrastructure
mac-address=74:E5:xx:xx:xx:xx
cloned-mac-address=0C:84:xx:xx:xx:xx

[ipv6]
method=auto

[ipv4]
method=manual
dns=8.8.8.8;
dns-search=212.xxx.xxx.xx;
address1=212.xxx.xxx.xx/24,212.xxx.xxx.xx
may-fail=false

Offline

#3 2014-03-22 14:22:39

ansh_kumar
Member
Registered: 2013-02-01
Posts: 89

Re: [SOLVED]using NetworkManager through nmcli

netctl is also a good tool so here is the configuration file for wifi static:

/etc/netctl/@LIBRARY

Description='Automatically generated profile by wifi-menu'
Interface=wlo1
Connection=wireless
Security=none
ESSID=@LIBRARY
IP=static
Address='212.xxx.xxx.xxx/24'
Gateway='212.xxx.xxx.xx'
DNS='8.8.8.8'
DNSSearch='212.xxx.xxx.xx'

Last edited by ansh_kumar (2014-03-22 14:22:55)

Offline

#4 2014-03-22 16:10:44

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]using NetworkManager through nmcli

If you want to connect with nmcli, why did you go through the process or hand writing the configuration files.  Doesn't that kind of defeat the purpose of nmcli?

Offline

#5 2014-03-22 16:27:54

ansh_kumar
Member
Registered: 2013-02-01
Posts: 89

Re: [SOLVED]using NetworkManager through nmcli

Actually previously I was using applets but they were not good. Always had some type of problem.I've not manually written the configuration file it's generated by the applet except the netctl profile(it's written by me).

Last edited by ansh_kumar (2014-03-22 16:28:56)

Offline

#6 2014-03-22 18:46:27

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]using NetworkManager through nmcli

If you still have interest in using NetworkManager's nmcli, see the nmcli man page.  In partiulcar, you should check out the examples at towards the bottom.  It isn't the easiest command line client, but it does have tab completion which can help.

Offline

#7 2014-03-23 06:33:27

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: [SOLVED]using NetworkManager through nmcli

Some more information on nmcli: http://fedoraproject.org/wiki/Networking/CLI

Alternatively you can have a look at 'nmtui': http://www.phoronix.com/scan.php?page=n … px=MTU0Mjg

Offline

#8 2014-03-23 07:05:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]using NetworkManager through nmcli

@orschiro, I think that the nmtui needs to be explicity enabled in the ./configure line when building.  As far as I know the Arch package does not (yet?) provide this.  I am fairly certain that it would also mean additional dependencies for the package as well.

Offline

#9 2014-03-23 07:48:12

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: [SOLVED]using NetworkManager through nmcli

@WonderWoofy

I am actually surprised that nobody has packaged it yet for the AUR. I haven't tested nmtui myself but read promising things about it.

Offline

Board footer

Powered by FluxBB