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 + 4 months ago
group_vars + 4 months ago
roles/hwservers-vlan + 4 months ago
.gitignore + 4 months ago
README.md + 4 months ago
ansible.cfg + 4 months ago
inventory.ini + 4 months ago
playbook-vlan.yml + 4 months ago

README.md

Private network for Hetzher hardware servers

vSwitch

  • 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

Install

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
  address 10.0.50.11
  netmask 255.255.255.0
  vlan-raw-device enp4s0
  mtu 1400