Hetzner Server not Working After Cpanel Setup

In this article, We will discuss about the most commonly issues that occur in Hetzner & OVH server when we use Centos 8/AlmaLinux 8 with cPanel. After cPanel installation everything goes normal. When we reboot the server, it did not come online. Server refused to connection with ssh.

What type of issues Occur in Hetzner Server?

There are some command errors that users are facing. We have collected these issues from different forums and articles.

After cPanel installation and reboot, I have no more access to ssh. It seems like the server is dead.
After cPanel installation everything is normal but when I restart my dedicated server the server simply does not come back online. I believe what is happening is this kernel change on the server and so it doesn't come back online with the cPanel whm panel. I tested it in two datacenters at OVH and Hetzner and got the same error.

I have reported the issue both to cpanel and to Hetzner a few months ago. They confirmed that their Almalinux distribution is not working with cpanel after the first reboot. They (Hetzner) are still trying to fix it.

Why this issues occur?

Hetzner server comes with preinstalled OS like Almalinux, cloudlinux, centos, fedora, ubuntu etc. Most commonly using OS for cPanel server is Centos & Alamalinux. There are two version available in CentOS 8.x/AlmaLinux 8.x . We have seen that mostly issue comes with Almalinux 8.x where Hetzner Said:

We have reproduced the issue on our test servers and will analyze the cause of the issue.
We will reply to this ticket as soon as we have more information.

cPanel Support Said:

During out testing though, we have noticed that this only seems to happen on images from certain hosting providers. One of one our Level 3 analysts tested and confirmed that this seems to highly effect servers using certain imaged from Hetzner.

What the reason behind it?

The problem is with the network configuration. Cpanel uses networkd for network settings, some servers of ovh and hetzner take ip distribution via dhcp. There are some incompatibilities between DHCP and networkd service. NetworkManager is required for it to work smoothly with DHCP. When the server operating system is installed, it comes with NetworkManager, when you install cpanel, the cpanel setup agent closes NetworkManager and activates networkd. When you restart the server, the server cannot get ip over dhcp and there is an access problem.

When installing cPanel it seems to disable NetworkManager completely, whereas in the past I am sure it only disabled it i.e it should start back up after reboot, but it doesn’t.

On systems that run the AlmaLinux OS 8 or Rocky Linux™ 8 operating systems, the cPanel & WHM installer will automatically disable the Network Manager service and enable the network.service service.

You can see on AlmaLinux 8 cPanel did disable NetworkManager and instead enabled the network.service

# service network status
Output:

WARN : [network] You are using 'network' service provided by 'network-scripts', which are now deprecated.
WARN : [network] 'network-scripts' will be removed in one of the next major releases of RHEL.
WARN : [network] It is advised to switch to 'NetworkManager' instead for network management.
Configured devices:
lo enp7s0
Currently active devices:
lo enp7s0
# service NetworkManager status
Output:

Redirecting to /bin/systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2022-03-18 14:09:35 CET; 35min ago
Docs: man:NetworkManager(8)
Main PID: 1326 (code=exited, status=0/SUCCESS)

Mar 18 14:08:30 <snipped> NetworkManager[1326]: <info> [1647608910.8936] hostname: hostname changed from "<snipped>" to "<snipped>>
Mar 18 14:08:30 <snipped> NetworkManager[1326]: <info> [1647608910.8937] policy: set-hostname: current hostname was changed outside Netw>
Mar 18 14:09:35 <snipped> NetworkManager[1326]: <info> [1647608975.2391] audit: op="connections-reload" pid=42944 uid=0 result="success"
Mar 18 14:09:35 <snipped> NetworkManager[1326]: <info> [1647608975.3108] audit: op="connections-load" args="/etc/sysconfig/network-scrip>
Mar 18 14:09:35 <snipped> systemd[1]: Stopping Network Manager...
Mar 18 14:09:35 <snipped> NetworkManager[1326]: <info> [1647608975.3890] caught SIGTERM, shutting down normally.
Mar 18 14:09:35 <snipped> NetworkManager[1326]: <info> [1647608975.3896] manager: NetworkManager state is now CONNECTED_SITE
Mar 18 14:09:35 <snipped> NetworkManager[1326]: <info> [1647608975.3900] exiting (success)
Mar 18 14:09:35 <snipped> systemd[1]: NetworkManager.service: Succeeded.
Mar 18 14:09:35 <snipped> systemd[1]: Stopped Network Manager.
lines 1-16/16 (END)

But in that state, the server does not come back online after a reboot. When enabled NetworkManager the server boots up fine.

Solutions :

There are multiple ways to fix the issue temporary and permanent. This issues is with cpanel network manager as it did not enable automatically while rebooting the server, We have to configure the network file to made these changes that are required to solve this issue.

After installing cPanel, Run these commands before rebooting the hetzner & OVH server.

# systemctl enable NetworkManager.service
# systemctl disable network.service

Note: Remove the hash(#) and run these command one by one.

After running these commands, you can reboot your server. it will live and ping again but if you again restart the server without running these commands your server will never live again. After that you should have to boot your server in Rescue mode and run these command again then restart the server. Facing issue to run these commands? Want a Service to fix this issue Permanently. Contact us

Network configuration CentOS/Almalinux

Dedicated root servers for IPV4

The main IP address of a dedicated root server usually comes from a /26 or /27 subnet. In order to prevent (accidental) adoption of foreign IP addresses, communication is only possible via the gateway address.

In order to communicate with servers in the same network segment, a point-to-point setup is configured within the default installation, which directs all packets to the gateway.

If you are doing your configuration via DHCP, this particular configuration cannot be transmitted, meaning a normal configuration (without a /32 subnet) is applied. This is not a problem, unless you need to reach IPs from the same subnet. In order to reach any server in the same subnet, you need to use a /32 subnet in the network configuration:

Open the file and enter these lines as below with your own entries:

# /etc/sysconfig/network-scripts/ifcfg-ens97s

DEVICE=eth0
HWADDR=<MAC Address>
ONBOOT=yes
BOOTPROTO=static
IPADDR=<IP Address>
NETMASK=255.255.255.255
SCOPE="peer <Gateway IP>"
# potential additional IPv6 entries

Create the default route:

# /etc/sysconfig/network-scripts/route-ens97s
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=<Gateway IP>
  1. Replace ens97s with your own interface’s name
  2. You can find your gateway at robot.your-server.de > Servers > IP tab by hovering over your IP address.
  3. Do not re-activate NetworkManager, since cPanel disables it for a reason.
  4. Make sure to use the 255.255.255.255 netmask -it’s not a typo- and don’t forget the SCOPE line.

Did not resolve the issues? Want a instant service? Contact Us. Our Server Expert will solve your issues in a short time.

Possible sources of errors

If it is not possible to reach the server after configuring the above network settings, you need to check whether the variable “GATEWAYDEV” has been set in the file /etc/sysconfig/network. This may be one reason for non-availability and is indicated by the error message RTNETLINK answers: file exists which appears after you reload the network settings.

Dedicated root servers for IPV6

Each server receives a /64 IPv6 subnet. Unlike the IPv4 configuration, a point-to-point setup is not necessary.

Example:

  • Address block: 2a01:4f8:61:20e1::1 to 2a01:4f8:61:20e1:ffff:ffff:ffff:ffff
  • Of which we use the first IP: 2a01:4f8:61:20e1::2
  • Gateway: fe80::1

To enable IPv6 on your server, add the following lines to the file /etc/sysconfig/network-scripts/ifcfg-eth0:

IPV6INIT=yes
IPV6ADDR=<IPv6 Address>/<Prefix>
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

CENTOS

It is only possible to do a permanent configuration by default via alias interfaces (eth0:1eth0:2 etc.). You need to create a file for each IP address:

/etc/sysconfig/network-scripts/ifcfg-eth0:1
/etc/sysconfig/network-scripts/ifcfg-eth0:2

These files must include the following information:

DEVICE=eth0:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=<IP Address>
NETMASK=255.255.255.255

Finally, you need to initiate a service network restart or you need to restart the server (reboot).

Please note: You need a different configuration so you can use IP addresses in virtual machines!

Still Not fixed?

After Implementing all these settings, Still facing issue issue in hetzner servers that goes dead after installation the cpanel and rebooting the server. Hire Us using our Server Management Team will fix the issue permanently.

Leave a Comment