NetworkManager Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 25: Line 25:
<pre>
<pre>
nmcli dev[ice] status
nmcli dev[ice] status
</pre>
=⁠Adding a Static Ethernet Connection=
<pre>
nmcli connection add type ethernet con-name <connection-name> ifname <interface-name> ip4 <address> gw4 <address>
</pre>
Note that a connection with the same name exists, NetworkManager will add another one, so you will end up with two connections with the same name. It is best if the existing one is either deleted or edited.
Example:
<pre>
mcli con del eth0
nmcli con add type ethernet con-name eth0 ifname eth0 ip4 172.30.0.4/16 gw4 172.30.0.1
</pre>
</pre>

Revision as of 16:46, 22 May 2017

Internal

General Status

nmcli general status

Show All Connections

nmcli con[nection] show

Show All Devices

To show devices recognized by NetworkManager and their state:

nmcli dev[ice] show
nmcli dev[ice] status

⁠Adding a Static Ethernet Connection

nmcli connection add type ethernet con-name <connection-name> ifname <interface-name> ip4 <address> gw4 <address>

Note that a connection with the same name exists, NetworkManager will add another one, so you will end up with two connections with the same name. It is best if the existing one is either deleted or edited.

Example:

mcli con del eth0
nmcli con add type ethernet con-name eth0 ifname eth0 ip4 172.30.0.4/16 gw4 172.30.0.1