You just finished an install of CentOS 7 and need it to be networked with a static address
Verify if there is an IP address (from DHCP) using the following command
Check the permissions on the interface config file (interface will vary ifcfg-ens101 in my case)
ls -l /etc/sysconfig/network-scripts/ifcfg-ens101
If its read only update the permissions as required
sudo chmod 777 /etc/sysconfig/network-scripts/ifcfg-ens101
Edit the interface
Edit/add the following fields
If you had updated the permissions previously, lower as per your requirements e.g.
sudo chmod 766 /etc/sysconfig/network-scripts/ifcfg-ens101
Now let’s configure the default gateway
Add the following or edit as required
While we are at it let’s update the DNS entries
Use the nameserver command to add dns servers to look up e.g.
nameserver 192.168.0.2 – assuming that .2 is your internal dns
One more command, restart the network interfaces
Test by reviewing the interface settings
And by issuing a ping command e.g.