Verified and Tested 08/31/2015

Introduction

In this how-to we will go over configuring your CentOS 7 server to work with a private IP address. For our Cloud, the private IP address range is available via the Cloud Portal and contains the full list of private IPs assigned to your account.

Prerequisites

-A CentOS 7.X Cloud server

-A private IP address chosen for use

Determine your private range

Login to your cloud control panel and click on “Private IP’s” to see what private range has been allocated to you.

Assigned Private range.

Cloud control panel Private IP range.

Getting Started

Assigning a Private IP on CentOS 7.X is as easy as has it has been on previous versions of CentOS. You simply edit the configuration and restart networking. In our Cloud example below, the private interface is known as eth1. So we run:

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

Once inside, we add the below configuration to the bottom of the file.

IPADDR=x.x.x.x
NETMASK=255.255.255.0

Where IPADDR= your private IP address and the NETMASK= is the range’s netmask for your IP. In our Cloud this would be a /24 private IP range so the netmask is 255.255.255.0.

Once this is complete, simply restart networking with the below command and the IP will be active for use.

service network restart

And that’s it. Configure another server on the private IP range and you will be able to communicate between the two.