# Configuring Hetzner Cloud Private Networking



## newbintern (Apr 20, 2021)

Hi,

my Hetzner FreeBSD VPS has two network interfaces attached to it, vtnet0 (public IP, configured through DHCP), and vtnet1 for Hetzners private network among a client's systems. This private network has an IP range of 10.0.0.0/16 with a subnet of 10.0.0.0/24, in which my FreeBSD VPS belongs together with another Linux VPS.

The automatic configured Linux VPS, which works as expected, meaning I can ping 10.0.0.1 from it, gives me the following routing table after running `netstat -nr`:

```
Kernel IP routing table
Destination  Gateway    Genmask          Flags  MSS     Window         irtt  Iface
0.0.0.0      172.31.1.1 0.0.0.0          UG     0       0              0     eth0
10.0.0.0     10.0.0.1   255.255.0.0      UG     0       0              0     ens10
10.0.0.1     0.0.0.0    255.255.255.255  UH     0       0              0     ens10
172.31.1.1   0.0.0.0    255.255.255.255  UH     0       0              0     eth0
```
In the above, eth0 is the public interface of the Linux machine, while ens10 is the one attached to the private network with the IP address 10.0.0.3 assigned to it. 172.31.1.1 is the IP address of the gateway, that all Hetzner Cloud servers use for their public interface.

The closest I could get  is the following rc.conf networking section on my FreeBSD machine:

```
ifconfig_vtnet0="DHCP"
ifconfig_vtnet1="inet 10.0.0.2 netmask 255.255.255.255 fib 1"
static_routes="fibpriv"
route_fibpriv="default 10.0.0.1 -fib 1"
```
But this does not seem to work, ping 10.0.0.1 or 10.0.0.3 does not return anything back. Am I missing something? Any suggestions?

Thank you all in advance


----------



## Switch2BSD (Apr 22, 2021)

You means you have 2 VPS (one Linux, one FBSD) with Hetzner, and all of both VPS have access to private network (10.0.0.0/16) ?


----------



## Switch2BSD (Apr 22, 2021)

From the Hetzner' instructions for manual Debian config:





						Hetzner Cloud Networks Configuration - Hetzner Docs
					






					docs.hetzner.com
				





> auto ens10
> iface ens10 inet static
> address private.address.ofThe.CloudServer
> netmask 255.255.255.255
> ...



I think I will try:

```
ifconfig_vtnet1="inet 10.0.0.2 netmask 255.255.255.255 broadcast 10.0.0.255 ptp 10.0.0.1"
static_routes="fibpriv"
route_fibpriv="-net 10.0.0.0/24 10.0.0.1 -interface vtnet1"
```


----------



## newbintern (Apr 23, 2021)

Switch2BSD said:


> From the Hetzner' instructions for manual Debian config:
> 
> 
> 
> ...




Hi Switch2BSD,

actually now both of my machines are running FreeBSD, I was keeping Linux only for testing purposes regarding private networking.

I ve tested your suggested configuration but unfortunately it did not do the trick... private networking is still not functioning. What I have noticed is that `ifconfig` output is missing a line about inet under the vtnet1 section. I would have expected to read in the output  something like the following:

`vtnet1
inet 10.0.0.2 netmask 0xffffffff broadcast 10.0.0.255`

But there is no inet line under vtnet1. Isn't this strange? or is this the expected behaviour because it is a private network? Also, `netstat -nr`  does not give me anything about vtnet1.

I really appreciate you taking the time to reply to my question ... thanks a lot


----------

