ESDS Knowledge Base

28
May

cPanel NAT mode

cPanel NAT modeAfter installing cpanel & WHM, the installer detects for your server on a NAT-configured network. If it is a NAT-configured network, your server will configure itself for NAT mode and attempt to automatically map local IP addresses to public IP addresses’

Enable NAT in cpanel server.

File acting as a NAT mode are /var/cpanel/cpnat. In case installer misguidedly detects a NAT-configured network, /var/cpanel/cpnat file can be deleted to disable NAT mode. Cpnat can be rebuilt if needed, to enable it, you can run the following command:

 /scripts/build_cpnat script

cPanel tries to attempt to map all non-loopback IP addresses bound to any network interface on the server to a public IP address.

cPanel server then sends an outgoing connection from each local IP address to the http://myip.cpanel.net/v1.0/ server.

The build_cpnat script uses http://myip.cpanel.net/v1.0/ to map local IP addresses to public IP addresses.

Following options can be managed for local and remote IP addresses in WHM:

  • Add a New IP Address
  • Show or Delete Current IP Address
  • If multiple local IP addresses match the same public IP address which is NOT recommended, only the first local IP address listed in /var/cpanel/cpnat will be mapped.
  • If you wish to use a different IP address lookup service, open the /etc/cpsources.conf file with your desired editor and add the following link: MYIP=http://whatismyip.tv/ip_only

Refer with cpanel documentation https://documentation.cpanel.net/display/ALD/1%3A1+NAT Manage IP Addresses and Check CPNAT main page for further information.

Image credit: cpanel.net.

Leave a Reply