Javiertury (talk | contribs) No edit summary |
Javiertury (talk | contribs) |
||
Line 54: | Line 54: | ||
To edit an already existing connection using an interactive editor | To edit an already existing connection using an interactive editor | ||
<pre>nmcli connection edit <connection name></pre> | <pre>nmcli connection edit <connection name></pre> | ||
===Example=== | |||
Let's create a new connection | |||
<pre>nmcli connection edit con-name <name of new connection></pre> | |||
It will ask us to define a connection type, in this example we will use ethernet | |||
<pre>'''Valid connection types: 802-3-ethernet (ethernet), 802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, 802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, bridge-slave | |||
Enter connection type:''' ethernet </pre> | |||
===Manually editing=== | |||
To manually edit a connection configuration open or create with a text editor the configuration file of the connection located in "/etc/sysconfig/network-scripts/ifcfg-<connection name>" | To manually edit a connection configuration open or create with a text editor the configuration file of the connection located in "/etc/sysconfig/network-scripts/ifcfg-<connection name>" |
Revision as of 13:57, 18 December 2013
Description
nmcli is a tool that allows NetworkManager management from command line.
NetworkManager status
Display overall status of NetworkManager
nmcli general status
Display active connections
nmcli connection show active
Display all configured connections
nmcli connection show configured
Connect/disconnect to an already configured connection
Connect to a configured connection by name
nmcli connection up id <connection name>
Disconnection by name
nmcli connection down id <connection name>
Wifi
Get Wifi status
nmcli radio wifi
Turn wifi on or off
nmcli radio wifi <on|off>
List available access points(AP) to connect to
nmcli device wifi list
Refresh previous list
nmcli device wifi rescan
Create a new connection to an open AP
nmcli device wifi connect <SSID|BSSID>
Create a new connection to a password protected AP
nmcli device wifi connect <SSID|BSSID> password <password>
Network interfaces
List available devices and their status
nmcli device status
Disconnect an interface
nmcli device disconnect iface <interface>
Create or modify a connection
To create a new connection using an interactive editor
nmcli connection edit con-name <name of new connection>
To edit an already existing connection using an interactive editor
nmcli connection edit <connection name>
Example
Let's create a new connection
nmcli connection edit con-name <name of new connection>
It will ask us to define a connection type, in this example we will use ethernet
'''Valid connection types: 802-3-ethernet (ethernet), 802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, 802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, bridge-slave Enter connection type:''' ethernet
Manually editing
To manually edit a connection configuration open or create with a text editor the configuration file of the connection located in "/etc/sysconfig/network-scripts/ifcfg-<connection name>"
For versions previous to NetworkManager 0.9.9.0
These versions lack some features described in this page and some of the commands may vary. If your current version is lower than 0.9.9.0 update NetworkManager. If you decide not to do so check the info pages for more information about your current version.
info nmcli
However as those previous version lack the support for connection editing, this have to be done manually. Open with a text editor the configuration file of the connection. The file is located in "/etc/sysconfig/network-scripts/" under the name of "ifcfg-<connection name>"
Connect automatically to that connection
Edit to or add the line "ONBOOT=yes"
Make the connection available only to one user
Edit or add the line "USERS=<username>"
Spoof MAC address
Edit or add the line "MACADDR=<spoofed MAC>". Don't change the line "HWADDR=<real MAC>" to spoof your MAC address.
Edit a connection password
To modify a connection password open with a text editor and edit the file "keys-<connection id>" located in "/etc/sysconfig/network-scripts/". The password is stored in plain text
Apply changes
Finally save the files and to apply changes to an already active connection execute
nmcli connection up id <connection name>
Delete a connection configuration
In case that the connection is active
nmcli connection down id <connection name>
Delete the connection
nmcli connection delete id <connection name>
Notes
nmcli maybe contain some bugs and lack some features graphical tools for NetworkManager have.
To see all available options for your version of nmcli
info nmcli