BuycPanel Blog

BuycPanel Blog

Latest news and updates

What is the 1:1 NAT in WHM?

Posted by Allura on 23 10 2019.

Introduction
During the installation of cPanel and WHM, the installer checks whether your server exists on a NAT-configured network. If you make use of a NAT environment, your server must exist in a NAT configuration that is 1:1. If the installer spots a NAT-configured network, your server undergoes a configuration for the NAT mode. It makes attempts to map local IP addresses to public IP addresses automatically.The Process of Mapping
The system aims to map all IP addresses that are non-loopback and ties to any of the network interfaces present on the server to an IP address that is public. The following steps are followed to perform the process.Your server will send a connection outgoing from every local IP address to http://myip.cpanel.net/v1.0/
The http://myip.cpanel.net/v1.0/ server acts in response to the public IP address from where the request was generated.
The mapping of the local IP address to this public IP address…

Introduction

During the installation of cPanel and WHM, the installer checks whether your server exists on a NAT-configured network. If you make use of a NAT environment, your server must exist in a NAT configuration that is 1:1. If the installer spots a NAT-configured network, your server undergoes a configuration for the NAT mode. It makes attempts to map local IP addresses to public IP addresses automatically.

The Process of Mapping

The system aims to map all IP addresses that are non-loopback and ties to any of the network interfaces present on the server to an IP address that is public. The following steps are followed to perform the process.

  1. Your server will send a connection outgoing from every local IP address to http://myip.cpanel.net/v1.0/
  2. The http://myip.cpanel.net/v1.0/ server acts in response to the public IP address from where the request was generated.
  3. The mapping of the local IP address to this public IP address is done by the system.

However, it is recommended that you refrain from mapping one local IP address to another one of the public IP address.

Management of IP Addresses

Using the mentioned WHM interfaces, you can easily manage the maps for the remote and local IP addresses. While utilizing any of the given paths, the system will display a message or a warning saying NAT mode enabled if NAT is running on your server.

  • The IP Migration Wizard

(WHM >> Home >> IP Functions >> IP Migration Wizard)

  • The Show or Delete Current IP Address

(WHM >> Home >> IP Functions >> Show or Delete IP Address)

  • The Add a New IP Address

(WHM >> Home >> IP Functions >> Add a New IP Address)

If there are a number of local IP addresses that tally with the same public IP address, the system detects and maps only the first local IP address in the /var/cpanel/cpnat path file.

The build_cpnat script

The script at the path /usr/local/cpanel/scripts/build_cpnat makes use of the http://myip.cpanel.net/v1.0/ server for the mapping of local IP address to public IP addresses.

If you are looking to use another IP address, follow the given steps.

  1. Open the /etc/cpsources.conf file using the Text Editor and an make addition as:

MYIP=https://ifconfig.me/ip

  1. The script /usr/local/cpanel/scripts/build_cpnat is to be run.
  2. Make updates to the local IP addresses of the cPanel account in WHM’s IP Migration Wizard

(WHM >> Home >> IP Functions >> IP Migration Wizard)

Conclusion

Following this document, you can easily map IP addresses and manage them on a NAT-configured server system.