Add private network for Hetzner servers connected together with vSwitch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Smagin 58708f2259 + 6 months ago
group_vars + 6 months ago
roles/hwservers-vlan + 6 months ago
.gitignore + 6 months ago + 6 months ago
ansible.cfg + 6 months ago
inventory.ini + 6 months ago
playbook-vlan.yml + 6 months ago

Private network for Hetzher hardware servers


  • Open Hetzner control panel and go to "Servers" section
  • Create vSwitch with some ID (I used default 4000), do not check "additional network" if you want use free private network
  • Add your servers to created VLAN


By default playbook creates /24 VLAN network with ID you created in control panel. Supports Ubuntu 16.04 and 18.04, but I'm sure you can modify it to your needs.

  • Add your servers to inventory.ini file, just as examples
  • In file group_vars/hwservers-vlan.yaml set vlan_id
  • Run playbook

Playbook will create file /etc/network/interfaces.d/vlan and run command to activate it

auto enp4s0.4000
iface enp4s0.4000 inet static
  vlan-raw-device enp4s0
  mtu 1400