Monday 25 February 2019

How to setup network after RHEL/CentOS 7 minimal installation

After installing RHEL/CentOS 7 minimal, You may not able to connect network in that machine. This will happen because Ethernet interfaces are not enabled by default.
This guide explain you to setup network on RHEL/CentOS 7.

Setup network on CentOS 7 minimal

First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:
"nmcli d" command output
“nmcli d” command output
Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).
CentOS_7 Network manager screen
CentOS_7 Network manager screen
Now choose you network interfaces and click “Edit
Edit your network interfaces
Edit your network interfaces

DHCP configuration

Choose “Automatic” in IPv4 CONFIGURATION and check Automatically connect check box and press OK and quit from Network manager.
Set ip adress using DHCP
Set ip adress using DHCP
Reset network services:
service network restart
Now your server will get IP Address from DHCP .
CentOS 7 check ip address
CentOS 7 check ip address
 
 
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.