The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

IP addresses/netmask screwed up

Discussion in 'General Discussion' started by jndawson, Mar 5, 2015.

  1. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    106
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    We only had one (1) IP bound to eth0 so we wanted to add a /27 to one of our cPanel boxes and the tech typo'd the netmask and screwed things up. I got the IPs removed by removing them from /etc/ipaddrpool and /etc/ips (no help to the 'Show/Delete IP' screen since there was no way to actually remove them).

    Ran 'service network restart' and 'service ipaliases restart'.

    Now, when checking the IPs, the screen comes up blank, and when listing accounts, we get this:
    Code:
    Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
     at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
    	Cpanel::NAT::Object::load_file(Cpanel::NAT::Object=HASH(0x51483f0)) called at /usr/local/cpanel/Cpanel/NAT/Object.pm line 27
    	Cpanel::NAT::Object::new("Cpanel::NAT::Object") called at /usr/local/cpanel/Cpanel/NAT.pm line 20
    	Cpanel::NAT::cpnat() called at /usr/local/cpanel/Cpanel/NAT.pm line 29
    	Cpanel::NAT::get_public_ip("208.110.131.31") called at whostmgr/bin/whostmgr4.pl line 389
    	main::listaccts() called at whostmgr/bin/whostmgr4.pl line 163
    Obviously WHM is trying to call a file that doesn't fit with it's expected result. Rebooted and still nothing - same errors. 'Show IP Address Usage' shows nothing, 'Show/Edit Reserved IPs' shows this error:
    Code:
    undef error - Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54. 
    /etc/ipaddrpool and /etc/ips are empty since neither contained our original single IP. Something went haywire - not sure where, or what to do. Tried rebooting; no difference. Websites work, mail flows.

    Where to look? What to do?
     
    #1 jndawson, Mar 5, 2015
    Last edited: Mar 5, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Is this server setup on a NAT environment? If so, try running the following command and let us know if it helps:

    Code:
    /scripts/build_cpnat
    Thank you.
     
  3. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    106
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    No, not a NAT environment, but ran the script anyway:

    Code:
    [ root@cp1 system># /scripts/build_cpnat
    info [build_cpnat] 208.110.131.31 => 208.110.131.31
    info [build_cpnat] All publicly routeable addresses are the same as the local address. Not a NAT system.
    Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Does /var/cpanel/cpnat exist on your system? If so, and if you are not on a NAT environment, please delete this file and let us know if the issue persists.

    Thank you.
     
  5. jndawson

    jndawson Well-Known Member

    Joined:
    Aug 27, 2014
    Messages:
    106
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    That did it - thanks. I figured it would be something simple like that. Sure beats un-tarring the system backup directories to try to figure out what needs to be changed/removed. I'd suggest an easier method to roll back to previous configurations from system backups might be a good idea.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. Ayodeji Ibrahim

    Joined:
    Jan 7, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    I have the same issue, here is what I got
    Code:
    Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
    at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
        Cpanel::NAT::Object::load_file(Cpanel::NAT::Object=HASH(0x5daa510)) called at /usr/local/cpanel/Cpanel/NAT/Object.pm line 27
        Cpanel::NAT::Object::new("Cpanel::NAT::Object") called at /usr/local/cpanel/Cpanel/NAT.pm line 20
        Cpanel::NAT::cpnat() called at /usr/local/cpanel/Cpanel/NAT.pm line 29
        Cpanel::NAT::get_public_ip("188.40.77.79") called at whostmgr
    I also tried to restore from backup but I got the same error as below

    I ran the code provided above but it did not solve the issue

    I need help...
     
  8. Ayodeji Ibrahim

    Joined:
    Jan 7, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    Just a follow up, I ran /scripts/build-cpnat and this is what I got


    root@server [~]# /scripts/build_cpnat
    info [build_cpnat] 188.40.77.79 => 188.40.77.79
    info [build_cpnat] All publicly routeable addresses are the same as the local address. Not a NAT system.
    Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
    root@server [~]#[/CODE]

    And the /var/cpanel/cpnat does not exist, I am not on NAT
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Are you sure "/var/cpanel/cpnat" does not exist on this system? The error message you posted often occurs when this file exists on a system that does not utilize a NAT environment.

    Thank you.
     
  10. Ayodeji Ibrahim

    Joined:
    Jan 7, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    I am very sure, it is probably located on another path, can't find anything like it in /var/cpanel/cpnat
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page