Setting up a Static IP Address on CentOS / RHEL | Zimbra

Alert! This article is written for Zimbra OSE users. As of December 2023, Synacor will no longer be providing support for Zimbra OSE. You might want to consider trying out Carbonio Community Edition – Zextras’s free and open-source email and collaboration platform.

For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.
This guide will show you different ways to set up a static IP address on your CentOS/RHEL Linux server.

Before you start

First of all we need to get the network interface information:

ip addr

We will have a result similar to this:

We could find “eth0” instead of “enp0s3

1. How to Configure Static IP Using Network Scripts Manually

The first way to configure a static IP is by editing the network interface using this command line:

nano /etc/sysconfig/network-scripts/ifcfg-(interface-name)

For example, in our case:

nano /etc/sysconfig/network-scripts/ifcfg-enp0s3

Then edit the file in the following way:


Be sure to enter your data in ip address, netmask and gateway. For example “ip address:, netmask, gateway” Then restart the NetworkManager with:

sudo systemctl restart NetworkManager

To check the new IP address use the following command:

ip a show enp0s3

The result will be something like the screen above.

2. How to Configure Static IP Using Nmtui Tool

Another way to set a static IP is to use NMTUI Tool, which is more “user friendly” with a text based graphic interface. To open it just type:


After launching the program an interface will appear:

We are going to edit our connection:

After selecting the right connection, an edit panel will appear:

Here we can set our configuration. For example we set IP address to, and the Gateway to

To save the changes scroll down to the end of the page and select OK.

Now we firstly need to deactivate the active connection

And then, to reload the interface with the new settings, choose <Activate> after selecting it:

Then select <Back> to return to the main menu and then select “Quit” to exit.

Quit Network Manager

Now we can easily verify that the new IP address settings have been applied with the following command:

ip a show enp0s3

3. How to Configure Static IP Using Nmcli Tool

NMCLI is a command we can use to obtain information or configure a network interface.

To set a static IP address, here is how to proceed.

Set the IP address for interface “enp0s3”:

sudo nmcli con mod enp0s3 ipv4.addresses < ip-address >

for example:

Set the gateway on RHEL 8:

sudo nmcli con mod enp0s3 ipv4.gateway < gateway >

for example:

Then we need to inform the interface that it is using manual configuration (not dhcp):

sudo nmcli con mod enp0s3 ipv4.method manual

Now it’s time to configure DNS:

sudo nmcli con mod enp0s3 ipv4.dns ""

At the end we reload the interface configuration:

sudo nmcli con up enp0s3

All the changes will be saved in /etc/sysconfig/network-scripts/ifcfg-<name>

Here is an example:

cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
Download Zextras Suite for Zimbra OSE


[…] Different ways to set a Static IP Address on CentOS / RHEL […]

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SELinux | Zimbra
Installing DNS Server on CentOS/RHEL using dnsmasq | Zimbra