CentOS set static IP address

Categories: Linux

To set a static IP address in CentOS edit the file /etc/sysconfig/network-scripts/ifcfg-$networkcard Where $networkcard is the name of the interface that you want to setup. The default is dhcp so you have to change like this, for example: TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static IPADDR= NETMASK= GATEWAY= DNS1= DNS2= DEFROUTE=yes IPV4_FAILURE_FATAL=no NAME=eth0 UUID=aabb3fe2-4eea-4096-9dbb-a674e196a821 DEVICE=enp1s0 ONBOOT=yes