Network configuration
to use NetworkManager text user interface tool nmtui configure the interface
to use command-line tools nmcli NetworkManager an interface
for manually configuring the network interface
to a graphical user interface tool to configure the network

nmtui
text nmtui user interface tools can be used to configure the interface in a terminal window. Issue the following command to start the tool:
~] $ nmtui

Installation package
yum install NetworkManager-tui

nmcli
users and scripts can use nmcli utility to control the NetworkManager:

 对于服务器,headless machines和终端,nmcli可用于直接控制NetworkManager,无需GUI,包括创建,编辑,启动和停止网络连接以及查看网络状态。
 对于脚本,nmcli支持简洁的输出格式,更适合脚本处理。 这是一种集成网络配置而非手动管理网络连接的方法。

Nmcli command basic format is as follows:

nmcli OPTIONS OBJECT {COMMAND | help }

OBJECT which can be one of the following options: general, networking, radio, connection , device, agent, and monitor. You can use any prefix these options in the command. For example: nmcli con help.
-t
This mode is designed for computer (script) process.
-p
This results nmcli production of human-readable output. For example, the alignment value and print titles.
-h, help
print help information.
nmcli tool has some built-in context-sensitive help:
nmcli Help 
This command lists to be used in the subsequent command options available and object names.
nmcli object help
This command displays a list of available objects associated with the specified operation. For example,
nmcli Help C

NetworkManager overall state:
nmcli General Status
of the current state of NetworkManager logging:
nmcli General logging
all connections:
nmcli Connection Show
only the currently active connections, add --active (or -a) option, as follows:
nmcli Connection Show - Active
NetworkManager identified devices and their status:
nmcli device status

Use nmcli start and stop interfaces
nmcli tool can be used to start and stop any network interface
nmcli CON up the above mentioned id bond0
nmcli CON up the above mentioned id PORT0
nmcli dev disconnect bond0
nmcli dev disconnect ens3

nmcli connection down command for deactivating the connection device, without preventing device further automatically activated.
nmcli device disconnect command to disconnect the device and prevent the device automatically activates the other connector, without human intervention.

nmcli interactive connection editor
nmcli connecting tool has an interactive editor. To use it, enter the following command:

〜] $ nmcli con edit

You will be prompted to enter a valid connection type from the list that appears. After entering the connection type, you will be placed under nmcli prompt. If you are familiar with the type of connection, you can con edit command to add a valid connection type option to nmcli, and direct access to nmcli prompt. Format edit an existing connection profile is as follows:

nmcli con edit [id | uuid |path] ID

To edit a new connector configuration file, apply the following formats:

nmcli con edit [type new-connection-type] [con-name new-connection-name]

Nmcli type help at the prompt to view the list of valid commands. For a description of using the describe command set its attributes. Format is as follows:

describe setting.property

E.g:

nmcli> describe team.config

Create and modify connection profiles
connection configuration file contains information about the connection properties required to connect to the data source. To create a new profile for NetworkManager, use the following command:

nmcli c add {ARGUMENTS}

nmcli c add receiving two different types of parameters:

 NetworkManager用于在内部描述连接的名称。 最重要的是:

connection.type
nmcli c add connection.type bond

    connection.interface-name

    nmcli c add connection.interface-name eth0

    connection.id

    nmcli c add connection.id "My Connection" 有关属性及其设置的更多信息,请参见man nm-settings

Alias
internally translated into human-readable attribute names. The most common is:
of the type (at The connection.type Property)

    nmcli c add type bond

    ifname (the connection.interface-name property) nmcli c add ifname eth0 con-name (the connection.id property) nmcli c add con-name "My Connection"

In previous versions nmcli, using the alias create the desired connection. For example, ifname eth0 and con-name My Connection. You can use the following command in the format:
nmcli c ifname the Add of the type ethernet eth0 CON-name "My Connection"

In the updated version, the attribute names and aliases can be used interchangeably. The following examples are valid and equivalent:
nmcli the Add C-CON eth0 ifname Ethernet type name "My Connection" ethernet.mtu 1600

nmcli c add connection.type ethernet ifname eth0 con-name "My Connection" ethernet.mtu 1600

nmcli c add connection.type ethernet connection.interface-name eth0 connection.id "My Connection" ethernet.mtu 1600

The different parameters of the type of connection. For all connection types, only the type parameter is required, whereas for all types except bond, team, bridge and the vlan, ifname is required.

type type_name
the type of connection. E.g:

nmcli c add type bond

ifname interface_name
an interface for connection to bind. For example:
nmcli the Add ifname c interface_name of the type ethernet

To modify the connection profile of the one or more attributes, use the following command:
nmcli Modify C

For example, to change from connection.id My Connection to My favorite connection, change the connection.interface-name is eth1, issue the command as follows:

nmcli c modify "My Connection" connection.id "My favorite connection" connection.interface-name eth1

Note that
the best use of the property name. Aliases only for compatibility reasons.

Further, to the Ethernet MTU is set to 1600, according to the size of your modified as follows:
nmcli C Modify "My Favorite Connection" ethernet.mtu 1600

connection.type
connection type. Allowed values are: adsl, bond, bond-slave , bridge, bridge-slave, bluetooth, cdma, ethernet, gsm, infiniband, olpc-mesh, team, team-slave, vlan, wifi, wimax. Each type has a specific connection options to the type of command. You can see a list of TYPE_SPECIFIC_OPTIONS in nmcli (1) man page. E.g:

    gsm连接需要apn中指定的访问点名称。

    nmcli c add connection.type gsm apn access_point_name
 wifi设备需要ssid中指定的服务集标识符。

nmcli c add connection.type wifi ssid My identifier

connection.interface-name
associated with the connection device name.
nmcli con add connection.interface-name eth0 type ethernet

connection.id
name for the connection profile. If not specified connection name, connection name will be generated as follows:
connection.type -connection.interface-name
connection.id is the name of the connection profile, should not be confused with the interface name (wlan0, ens3, em1) represents device. However, the user can name the connection after the interface, but they are not the same thing. A plurality of connection profiles may be provided for the device. This is particularly useful for mobile devices or the network cable switch back and forth between different devices. Rather than edit the configuration, create different profiles and apply them as needed interface. id option also cited the connection profile name.

nmcli command of the most important options, such as show, up, down is:
ID
user identification string assigned to the connection profiles. Id may be identified in connection nmcli connection command. NAME field always indicates the command output connection ID. It refers to the con-name has the same connection profile name.
UUID
system unique identification string assigned to the connection profile. Uuid connection may be identified in connection nmcli command.

~] $ Nmcli CON Show
NAME UUID the TYPE the DEVICE
Auto Ethernet 9b7f2511-5432-40ae-B091-af2457dfd988 802-3-ethernet -
ens3 fb157a65-ad32-47ed-858C-102a48e064a2 802-3-ethernet ens3
MyWiFi 91451385-4eb8-4080 -8b82-720aab8328dd 802-11-wireless wlan0
Note, nAME field always indicates the output connection ID (name). It is not the name of the interface, even though it may look the same. In the second connector shown above, NAME field ens3 is applied to the user ID of the interface connector ens3 profile. In a final connection shown, the user has assigned to the interface connection ID MyWiFi wlan0.

Add Ethernet connectivity means to create a configuration profile, and then assign it to the device. Before you create a new profile, please review the available devices in the following ways:
~] $ nmcli Device Status
the DEVICE the TYPE STATE CONNECTION
ens3 ethernet disconnected -
ens9 ethernet disconnected -
LO the Loopback unmanaged -
To set the device without NetworkManager management:
$ nmcli device set ifname managed no

For example, to set eth2 unmanaged:
$ nmcli device status
DEVICE TYPE STATE CONNECTION
bond0 bond connected bond0
virbr0 bridge connected virbr0
eth1 ethernet connected bond-slave-eth1
eth2 ethernet connected bond-slave-eth2
eth0 ethernet unmanaged --

Nmcli the SET eth2 Managed Device $ NO ----> the SET eth2 unmanaged:
$ nmcli Device Status
the DEVICE the TYPE STATE CONNECTION
bond0 Bond Connected bond0
virbr0 Bridge Connected virbr0
eth1 ethernet Connected Bond-Slave-eth1
eth2 unmanaged ethernet -
eth0 ethernet unmanaged -
when you set the device to unmanaged, NetworkManager does not control it. However, the device is still connected.

Add a dynamic Ethernet connection
to add an Ethernet profile with dynamic IP configuration, allowing DHCP to assign network, can command of the form:
nmcli the Add Connection type Ethernet Connection-CON-name name name-interface ifname

For example, to create a dynamic connection configuration file called my-office, issue the command as follows:
~] $ nmcli the Add CON name of the type ethernet CON-my-office ifname ens3

NetworkManager connection.autoconnect its internal parameter set to yes. NetworkManager also set write / etc / sysconfig / network-scripts / ifcfg-my-office, where ONBOOT instruction set to yes.

Please note that before the next start interface, NetworkManager will not notice the changes to the manual ifcfg file.
To open an Ethernet connection, issue the following command:
~] $ nmcli CON-up My Office

To change the host name of the host sends a DHCP server, modify dhcp-hostname properties as follows:
~] $ nmcli CON-Modify My Office My Office ipv4.dhcp-hostname-hostname-ipv6.dhcp hostname host- name

To change the IPv4 client ID transmitted by the host as a DHCP server, modify shown dhcp-client-id attributes are as follows:
~] $ nmcli CON-Modify My Office My Office ipv4.dhcp-Client-Client-ID-ID- string

IPv6 is no dhcp-client-id attribute, dhclient Creates an identifier for IPv6. For more information, see the dhclient (8) manual page.
To ignore the host sends a DHCP server to the DNS server, modify the ignore-auto-dns properties as follows:
~] $ nmcli CON-Modify My Office My Office ipv4.ignore-DNS-Auto-Yes ipv6.ignore-Auto- dns yes

For more information about the property and its settings, see the nm-settings (5) manual page.

Add a static Ethernet connections
to use a static IPv4 configuration add an Ethernet connection, you can use the following command in the format:
You can add IPv6 address and gateway information using ip6 and gw6 options.
Please note that this DNS server will replace any previously set. Alternatively, to add other DNS servers to any previous settings, use the + prefix, as follows:

〜] $ nmcli con mod test-lab + ipv4.dns“8.8.8.8 8.8.4.4”

To view detailed information about the new connection configuration, issue the command as follows:
~] $ nmcli -p-CON Show the Test Lab

                 Connection profile details (test-lab)

===============================================================================
connection.id: test-lab
connection.uuid: 05abfd5e-324e-4461-844e-8501ba704773
connection.interface-name: ens9
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.timestamp: 1410428968
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
[output truncated]
使用-p, - pretty选项会在输出中添加标题横幅和分节符。

The configuration file is locked to a particular device
to place the configuration file is locked to a specific interface device, used in this example comprises a command interface name. For example:
nmcli the Add Connection type Ethernet Connection-CON-name name name-interface ifname

To make the profile available to all compatible Ethernet interface, issue the following command:
nmcli the Add Connection of the type ethernet-CON-name Connection name ifname "*"

Note that even if you do not want to set a specific interface, you must also use ifname parameters. Use wildcards to specify the configuration file can be used with any compatible device.
To configure the file is locked to a specific MAC address, use the following command in the format:
nmcli the Add Connection of the type ethernet CON-name "Connection-name" ifname "
" mac 00: 00: 5E: 00: 53: 00

Add WIFI connection
to create a Wi-Fi connection profile static IP configuration, but allows automatically assign DNS addresses, issue the command as follows:
~] $ nmcli CON the Add CON-name Mycafe ifname wlan0 of the type wifi ssid Mycafe \
ip4 192.168 .100.101 / 24 gw4 192.168.100.1

To set up WPA2 password, such as "caffeine", issue the following command:
~] $ nmcli CON-sec.key the Modify Mycafe wifi wpa-MGMT-PSK
~] $ nmcli the Modify Mycafe wifi CON-sec.psk Caffeine
To change Wi-Fi state, issue the command in the following format:
~] $ nmcli Radio wifi [ON | OFF]

Changes specific attributes
to check a particular attribute (e.g. MTU), issue the command as follows:
~] $ nmcli Connection ID Show 'Mycafe' | grep MTU
802-11-wireless.mtu: Auto
property to change settings, do the following way to issue commands:
~] $ nmcli the Modify the above mentioned id Connection 'Mycafe' 802-11-wireless.mtu 1350
to verify changes, issue the command as follows:
~] $ nmcli Connection Show the above mentioned id 'Mycafe' | grep MTU
802-11- wireless.mtu: 1350
Note available, NetworkManager parameters (e.g., 802-3-ethernet and 802-11-wireless) as a setting, and set as an attribute mtu. For more information about the property and its settings, see the nm-settings (5) manual page.

Use nmcli configure a static route
to an existing Ethernet connection using the command line to configure a static route, enter the following command:
~] #nmcli the Modify Connection eth0 + ipv4.routes "192.168.122.0/24 10.10.10.1"
This will 192.168.122.0 flow / 24 subnet directed to the gateway 10.10.10.1