How to setup static IP address on Red Hat Enterprise Linux 8

Setting up a static IP address on your REHL or CentOS is simple.

Prerequisite

This how-to guide requires that you have administrative access to the Linux operating system.

Steps

1. Inside the REHL Operating system, open the terminal and head to /etc/sysconfig/network-scripts

cd /etc/sysconfig/network-scripts

Using ls command, you can see the available network devices.

2. Use vi editor to edit the specific network device configuration

3. In this sample configuration, we will need to specifically change or add the following:

BOOTPROTO=none
ONBOOT=yes
IPADDR=x.x.x.x
PREFIX=n
GATEWAY=x.x.x.x
DNS1=x.x.x.x