�&ǐk�@'bJ�h�ۊL'}T� :��'2�Z#$��n�a��� �>a��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �% \$man_page, ); Cpanel::Usage::wrap_options( \@ARGV, \&usage, \%opts ); return man() if $man_page; my $failures; my $cp_nat = Cpanel::NAT::Discovery->new(); eval { $failures = $cp_nat->discover(); validate_wwwacct_conf(); }; if ($@) { die $@; } Cpanel::NAT::Build::update(); if ( keys %$failures ) { return 1; } return 0; } sub usage { my $prog = $0; $prog =~ s{^.+/(.+)$}{$1}; print <{'ADDR'}; return unless $primary_ip; my $local_ip = Cpanel::NAT::get_local_ip($primary_ip); return if ( $primary_ip eq $local_ip ); # wwwacct.conf had to be fixed. Cpanel::Debug::log_info("Updating /etc/wwwacct.conf primary IP (ADDR) from $primary_ip to $local_ip. Local IPs, not public should be stored in most configuration files."); $wwwacct->{'ADDR'} = $local_ip; Cpanel::Config::SaveWwwAcctConf::savewwwacctconf($wwwacct); return; } sub man { { exec( "perldoc", $0 ); } exit 0; } 1; __END__ =head1 NAME build_cpnat - enables 1-to-1 NAT in cPanel/WHM. =head1 SYNOPSIS build_cpnat [options] Options: --help print help message =head1 DESCRIPTION 1:1 NAT mapping When /usr/local/cpanel/scripts/build_cpnat is executed, all non-loopback IPs bound to any network interface on the system will be used to make a connection to a remote cPanel webserver. The remote cPanel webserver will return one public IP for each non-loopback IP that is sent. The list of the public IPs that are associated with the internal IPs will be written to the I file one mapping per line: local_ip remote_ip =over =item * Lines in I with only one IP will be ignored by cPanel/WHM because they are determined to not be publically accessible. =item * If multipe internal IPs match the same public IP, the first internal IP listed in the I file will be used. =back By default, this script will use the L URL to detect the public IP addresses that correspond to your local IP addresses. If you wish to override this URL, you can add an entry to the I file corresponding to the 'MYIP' key (example below): MYIP=http://myip.cpanel.net/v1.0/ NOTE: This URL must return B the IP address of the client connection. =cut