In this small tutorial i will explain how to configure static ip address on CentOS 7 minimal. First, need to edit the set up for the ethernet. Let’s start with editing “/etc/sysconfig/network-scripts/ifcfg-enp0s3″ file:
1 |
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
HWADDR=08:00:27:6C:FF:91 TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPADDR=192.168.0.88 IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=enp0s3 UUID=ea68db6e-461e-427d-b9a8-bfcf6e1a4fc6 ONBOOT=yes |
Save and exit. Now, configure default getaway:
1 |
vi /etc/sysconfig/network |
And add following line:
1 2 3 |
NETWORKING=yes HOSTNAME=centos7 GATEWAY=10.1.1.253 |
Configure DNS Server
1 |
vi /etc/resolv.conf |
add following line:
1 2 |
nameserver 8.8.8.8 nameserver 8.8.4.4 |
Now restart…