Hello Jamy
By default dhcp is used so you will have to disable it by following these steps:
1. Install nano or your favorite text editor
2. Make a backup of the network file, where NAME is the name of your network interface.
# sudo mv /etc/sysconfig/network-scripts/ifcfg-NAME /etc/sysconfig/network-scripts/ifcfg-NAME.bak
3. Create a new configuration file with the following command, where NAME is the name of your network interface.
# sudo nano /etc/sysconfig/network-scripts/ifcfg-NAME
4. Paste the content of the backup file and change the desired fields or paste the following, where NAME is the name of your network interface:
TYPE=Ethernet
IPADDR=YOUR_IP
NETMASK=YOUR_NETMASK
GATEWAY=YOUR_GATEWAY
NAME=NAME
DEVICE=NAME
ONBOOT=yes
BOOTPROTO=none
PEERSDNS=no
An example in my network would be:
TYPE=Ethernet
IPADDR=192.168.1.140
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
NAME=eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
PEERSDNS=no
5. Restart network service
# systemctl restart network
6. Check new IP
# ip route
# ip a
7. Restart the VM and check your IP
# ip a
Regards, Raúl