Set hostname.
[root@localhost ~]# hostnamectl set-hostname futurelinux.org
or
[root@localhost ~]# echo "futurelinux.org" > /etc/hostname
Both hostname settings will take effect the next time you log in.
Basic:
You can configure the network using the nmcli command.
It can also be used by shortening the parameters of the command.
For example: To get the list of network devices:
[root@localhost ~]# nmcli device
or
[root@localhost ~]# nmcli dev
or
[root@localhost ~]# nmcli d
they all produce the same output.
Set a static IP address: (Replace [enp3s0] with your interface name)
[1] Display devices.
[root@localhost ~]# nmcli dev
DEVICE TYPE STATE CONNECTION
enp3s0 ethernet connected enp3s0
lo loopback unmanaged --
[2] Set IPv4 address.
[root@localhost ~]# nmcli connection modify enp3s0 ipv4.addresses 10.0.0.2/24
[3] Set gateway.
[root@localhost ~]# nmcli con mod enp3s0 ipv4.gateway 10.0.0.1
[4] Set DNS.
[root@localhost ~]# nmcli con mod enp3s0 ipv4.dns 10.0.0.1
[5] Restart the interface and reload the settings.
[root@localhost ~]# nmcli con down enp3s0
Connection 'enp3s0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
[root@localhost ~]# nmcli con up enp3s0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
or
[root@localhost ~]# nmcli con reload
[6] Show settings.
[root@localhost ~]# nmcli con show enp3s0
connection.id: enp3s0
connection.uuid: 28b2a914-bcc5-460b-a606-1810bcce3787
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: enp3s0
connection.autoconnect: yes
...
ipv4.dns: 10.0.0.1
...
ipv4.addresses: 10.0.0.2/24
ipv4.gateway: 10.0.0.1
...