Hetzner + Virtualization + OPNsense

Hello,

We are currently expanding our Hetzner-based servers and have installed TrueNAS for both additional storage of our cloud servers and replication of our on-site TrueNAS instance.

Currently we have TrueNAS installed and setup on a vSwitch connected to the cloud network and this is all working great, the TrueNAS is only available/reachable through our private cloud network on Hetzner.

However, there are a few cloud servers we have on Hetzner that we would like to virtualize ourselves to cut down on costs and simplify our setup a bit, but we’re stuck on how to get the additional IP to function as a bridge on TrueNAS. We’d like to get OPNsense running as a VM so we can have subsequent VMs route through the OPNsense VM.

According to the documentation: [Cannot link it, but hetzner + additional ip + virtualization in google will get you the result)

We must add an interface to our server that routes the additional IP (as required by Hetzner due to one unique MAC Address requirement per IP) as a bridge interface we can then use. However, we’re stuck on how to get this to work. We have a vswitch interface in /etc/network/interfaces.d/vswitch and this one is working great.

Their documetation for the additional IP does not appear to work for TrueNAS though, we can see the interface show up in the TrueNAS network UI, but it doesn’t have internet and when using it for OPNsense it doesn’t seem to work.
Our current interface file as suggested by hetzner (switching brctl to ip commands as brctl is not available):

auto virbr1
iface virbr1 inet static
   address [MainIP]
   netmask 255.255.255.255
   bridge_ports none
   bridge_stp off
   bridge_fd 0
   pre-up ip link add dev virbr1 type bridge
   up ip route add [AdditionalIP]/32 dev virbr1
   down ip route del [AdditionalIP]/32 dev virbr1
   post-down ip link del dev virbr1

iface virbr1 inet6 static
   address 2a01:4f8:[xxxx]:[xxxx]::1
   netmask 64

We’re not sure what the next steps are, we’ve looked at the forums and seen people with somewhat of the same issue but never truly a solution was found.

We have considered running proxmox instead and virtualize TrueNAS, however we have read that this setup is finicky and you need to pass the drives to TrueNAS for full control, and we’re looking at running TrueNAS as stable as possible so virtualization of TrueNAS to us feels less stable.

We’ve also read that you’re not supposed to write your own interface files in /etc/network/interfaces.d/ in some post, but we couldn’t find any official statement behind this, if there is please do let us know!

Worst comes to worst, we will just not use any VMs on our truenas server, though it is our end-goal to have that working.

If anyone has any ideas regarding this or sees an error in our setup, please let us know, we’d appreciate the help!

Kind regards,
Goldish