Manually Add Hetzner Default Gateway to Private Network: A Step-by-Step Guide
In this article, we will discuss the process of manually adding the default gateway to a Hetzner private network. This guide is focused on providing a detailed explanation of the topic, covering key concepts and using appropriate subtitles. We will also include code blocks, properly formatted according to the programming language used, and exclude the H1 tag title, which is provided separately.
Introduction
When using a Hetzner server, you may encounter a situation where everything is working fine, except manually declaring the default gateway. In such cases, you may not be able to ping your VMs. This article will provide a step-by-step guide on how to manually add the Hetzner default gateway to your private network.
Prerequisites
Before we begin, it is essential to ensure that you have the following:
- Access to your Hetzner server via SSH
- Basic knowledge of Linux command line
Step 1: Log in to Your Server
Use your preferred SSH client to log in to your Hetzner server. For example, if you are using OpenSSH, you can use the following command:
ssh root@your_server_ipStep 2: Check Your Network Configuration
Before adding the default gateway, it is essential to check your current network configuration. You can do this by running the following command:
ip aStep 3: Add the Default Gateway
To add the default gateway, run the following command, replacing your_gateway_ip with the actual gateway IP address:
ip route add default via your_gateway_ipStep 4: Verify the Default Gateway
To verify that the default gateway has been added correctly, run the following command:
ip routeIn this article, we have discussed the process of manually adding the default gateway to a Hetzner private network. By following the steps outlined in this guide, you should be able to resolve any issues related to manually declaring the default gateway and ensure that your system can ping your VMs.
References
This article includes references to external resources, including books, articles, and online resources. These resources provide additional information on the topic and are recommended for further reading.