Before we convert our server to a static IP we need to backup resolv.conf under the etc folder.
cp /etc/resolv.conf /etc/resolv.conf.backup
Now we are going to edit the following file:
sudo nano /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPADDR=10.1.1.200 IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=enp0s3 UUID=75a170ba-6bfa-4553-8070-e658eb8ffb1e ONBOOT=yes
save and exit:
Next we need to set the hostname and gateway
sudo nano /etc/sysconfig/network
and we modify to our network:
NETWORKING=yes HOSTNAME=unixmen-centos7 GATEWAY=10.1.1.253
Save and exit.
Restart your network or reboot
Now we need to restore the resolv.conf backup file.