Network Configuration Type
  1. Static Temporary
  2. DHCP Temporary
  3. Static Permanently
  4. DHCP Permanently
Static Temporary

ip address add [ipaddress/netmask-prefix] dev [iface-name]
ip address add 192.168.89.2/24 dev enp0s8
ip link set dev enp0s8 up

ip route add default via [gw-address] dev [iface-name]
ip route add default via 192.168.89.1 dev enp0s8

DHCP Temporary

dhclient [iface-name]
dhclient enp0s8

Static Permanently

vim /etc/sysconfig/network-scripts/ifcfg-[iface-name]

BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED= yes

IPADDR=172.16.10.2
NETMASK=255.255.255.0
GATEWAY=172.16.10.1

systemctl restart network
systemctl enable network

DHCP Permanently

vim /etc/sysconfig/network-scripts/ifcfg-[iface-name]

BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED= no

systemctl restart network
systemctl enable network