0

I have two virtual servers hosted in Hetzner Cloud. The first server (let's call it Access Server) has a Public IP assigned and has internet access. The second server does not has a public IP assigned and cannot access the internet. Both server are part of the same private network with private IPs like 10.0.0.2 and 10.0.0.3. I need to configure the first server (Access Server) to act as an internet gateway for the second server. In the Access Server I have set net.ipv4.ip_forward = 1 in the /etc/sysctl.conf file and masquerading is also enabled using firewall-cmd --permanent --zone=public --add-masquerade.

But here's a few problems:

  1. When no public IP is assigned, the VM created by the Hetzner Cloud does not show any network interface. For example if you run the nmtui there will be no network interface listed and no file is there in the network-scripts directory. The ip link command show two interfaces one is lo and the other one is enp7s0.
  2. When I run the ip route add default via 10.0.0.2 it shows invalid Gateway. I'm not sure if this is even the correct way to add a route.

The problem that I have is that I don't know how to create a Network Interface (for example what type of network, mac, etc.) whose Gateway I can set to the Access Server in the second server and I don't know what other things I should do in the Access Server to allow it to act as an internet gateway.

I cannot go with other solution such as creating a proxy server on Access Server as later this will cause a lot of problems (pods in k8s) and I guess installing a VPN like OpenVPN would be inefficient.

I would really really appreciate if someone provides me with some guidelines on how to do this as I could not find any usable resource over the internet. (ChatGPT could not answer it either)

0 Answers0