for this first go to this location
cd /etc/sysconfig/network-scripts/
then use this command
ifconfig
you can see 2 flags one of them should be IO you should see what is the other flag name is. for example if it was eth0, in this location type
nano ifcfg-eth0
then paste this into this file remember change your IP, subnet mask and your gateway
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=e6dd2f58-fc77-497f-a7ce-28e35ac4ba52
DEVICE=ens33
ONBOOT=yes
IPADDR= "YOUR IP"
PREFIX="SUBMASK"
GATEWAY="GATEWAY"
DNS1=8.8.8.8
then restart your centos and you should have internet.