How to configure static ip address on CentOS 7
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:
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
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.
vi /etc/sysconfig/network
And add following line:
NETWORKING=yes HOSTNAME=centos7 GATEWAY=10.1.1.253
Configure DNS Server
vi /etc/resolv.conf
add following line:
nameserver 8.8.8.8 nameserver 8.8.4.4
Now restart your network or rebooting system
/etc/init.d/network restart
Check your network:
ip addr
1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:6c:ff:91 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.88/24 brd 192.168.0.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe6c:ff91/64 scope link
valid_lft forever preferred_lft forever
Author
Related Posts
Going back to the basics….moving out of Amazon Drive!
As of June 8, 2017, it was announced that when when users try to sign up for Amazon Drive they will not...
How to restart management agents on ESX or ESXi host
If you are not unable to connect ESXi server to vCenter, or when you cannot connect to ESXi server from VI client it...
Linux: CentOS 6 kernel panic+0xa7/0x16f fix
So ran into a view issue for a Linux Host today. Kernel Panic !!! There could be a number of reasons that...
Read out all“Host SMBus controller not enabled!â€
CentOSÂ guest instances in VMware sometimes come up with the boot error message: piix4_smbus 0000:00:007.3: Host SMBus controller not enabled! This error is...
Read out allHow to Start and Enable Firewalld on CentOS 7
It is highly recommended that you have a firewall protecting your server. Pre-Flight Check These instructions are intended specifically for enabling and...
Read out all