#display devices
[root@localhost ~]# nmcli d
#set ipv4 address
[root@localhost ~]# nmcli c modify eth0 ipv4.address 192.168.100/24
#ip default gateway
[root@localhost ~]# nmcli c modify eth0 ipv4.gateway 192.168.1.1
#set static for static setting (it‘s "auto" for DHCP)
[root@localhost ~]# nmcli c modify eth0 ipv4.method manual
#restart the interface and reload the setting
[root@localhost ~]# nmcli c down enp0s3; nmcli c up enp0s3
#show setting
[root@localhost ~]# nmcli d show enp0s3
#show status
[root@localhost ~]# ip add show
原文:https://www.cnblogs.com/cnxiaol/p/11222971.html