BuycPanel Blog

BuycPanel Blog

Latest news and updates

Installing cPanel and WHM over NAT-Configured Network

Posted by Allura on 31 01 2019.

Introduction
It is recommend to perform these actions on new installation of cPanel & WHM and not to attempt a 1:1 NAT configuration on an existing production server. The installer will detect one’s server on a NAT-configured network after the installation of cPanel and WHM . If detected, the server will configure itself for NAT mode and attempt to naturally map the local IP addresses to public IP addresses. One can read our How to Configure Your Firewall documentation for more knowledge on cPanel Services.The Mapping Process
For completing this process, one has to perform the following actions:An outgoing connection will be sent by one’s server from each local IP address to the http://myip.cpanel.net/v1.0/ server.
The http://myip.cpanel.net/v1.0/ server will respond with the public IP address from which it had received the request.
The system thereafter will map the local IP address to this public IP address. Here, we recommend to map…

Introduction

It is recommend to perform these actions on new installation of cPanel & WHM and not to attempt a 1:1 NAT configuration on an existing production server. The installer will detect one’s server on a NAT-configured network after the installation of cPanel and WHM . If detected, the server will configure itself for NAT mode and attempt to naturally map the local IP addresses to public IP addresses. One can read our How to Configure Your Firewall documentation for more knowledge on cPanel Services.

The Mapping Process

For completing this process, one has to perform the following actions:

  1. An outgoing connection will be sent by one’s server from each local IP address to the http://myip.cpanel.net/v1.0/ server.
  2. The http://myip.cpanel.net/v1.0/ server will respond with the public IP address from which it had received the request.
  3. The system thereafter will map the local IP address to this public IP address. Here, we recommend to map more than one local IP map address to a single public IP address.

Manage IP Address

It can be managed by the following WHM interfaces:

  1. By the Add a New IP Address interface (WHM >> Home >> IP Functions >> Add a New IP Address).
  2. By the Show or Delete Current IP Address interface (WHM >> Home >> IP Functions >> Show or Delete Current IP Address).
  3. By the IP Migration Wizard interface (WHM >> Home >> IP Functions >> IP Migration Wizard).

Each of the interface will display the warning notice NAT mode enabled if it is enabled on one’s server.

Also, if multiple local IP addresses twins with the same public IP address, then the system will only map the first local IP address in the /var/cpanel/cpnat file.

The build_cpnat Script

Perform the steps in case if you desire to use a different IP address lookup service other than local IP address to public IP address.

Steps:

  1. Firstly open the /etc/cpsources.conf file with a text editor and add:

MYIP=https://ifconfig.me/ip

  1. Secondly, one has to run the /usr/local/cpanel/scripts/build_cpnat
  2. Thirdly, one has to update the cPanel accounts’ local IP addresses in WHM’s IP Migration Wizard interface (WHM >> Home >> IP Functions >> IP Migration Wizard).

To get more information on build_cpnat script, one can run the command:

/usr/local/cpanel/scripts/build_cpnat –man

Conclusion

The steps needed and procedure required for installing cPanel and WHM over NAT-Configured Network is reviewed in this article.