interfaces.j2 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).
  3. #
  4. # This file is generated by ansible
  5. #
  6. ## Host Interfaces
  7. auto lo
  8. iface lo inet loopback
  9. {%for interface in uplink_interfaces %}
  10. {% if interface.auto is defined and interface.auto %}
  11. auto {{interface.name}}
  12. {% endif %}
  13. {% if interface.hotplug is defined and interface.hotplug %}
  14. allow-hotplug {{interface.name}}
  15. {% endif %}
  16. iface {{interface.name}} {{interface.proto}} {{interface.type}}
  17. {% if interface.config is defined %}
  18. {% for config in interface.config %}
  19. {{config.key}} {{config.value}}
  20. {% endfor %}
  21. {% endif %}
  22. {% endfor %}
  23. {% if uplink_gre_tunnel is defined %}
  24. {% for tunnel in uplink_gre_tunnel %}
  25. {% if tunnel.comment is defined %}
  26. # {{tunnel.comment}}
  27. {% endif %}
  28. auto {{tunnel.name}}
  29. iface {{tunnel.name}} inet tunnel
  30. mode gre
  31. address {{tunnel.address}}
  32. dstaddr {{tunnel.dstaddr}}
  33. netmask {{tunnel.netmask}}
  34. local {{tunnel.local|ipaddr('address')}}
  35. endpoint {{tunnel.endpoint}}
  36. mtu 1400
  37. ttl 64
  38. iface {{tunnel.name}} inet6 static
  39. address {{tunnel.address_v6}}
  40. {% endfor %}
  41. {% endif %}