gre_interbackbone.j2 1.1 KB

12345678910111213141516171819202122232425262728
  1. # This file is managed by ansible, don't make changes here - they will be overwritten.
  2. {% for host in groups['supernodes'] %}
  3. {% if host != inventory_hostname %}
  4. #auto bck-{{host}}
  5. #iface bck-{{host}} inet static
  6. {% if hostvars[host].vm_id < vm_id %}
  7. # address 192.168.{{ hostvars[host].vm_id-1 }}.{{vm_id*2+1}}
  8. {% else %}
  9. # address 192.168.{{ vm_id-1 }}.{{hostvars[host].vm_id*2}}
  10. {% endif %}
  11. # netmask 31
  12. # pre-up ip link add $IFACE type gre local {{ansible_default_ipv4.address}} remote {{hostvars[host].ansible_ssh_host}} ttl 255
  13. # pre-up ip link set $IFACE up multicast on
  14. # post-up ip rule add iif $IFACE table ffnet
  15. # pre-down ip rule del iif $IFACE table ffnet ||:
  16. #iface bck-{{host}} inet6 static
  17. {% if hostvars[host].vm_id < vm_id %}
  18. # address 2a03:2260:115:ffa1::{{hostvars[host].vm_id}}:{{vm_id}}:0
  19. {% else %}
  20. # address 2a03:2260:115:ffa1::{{vm_id}}:{{hostvars[host].vm_id}}:1
  21. {% endif %}
  22. # netmask 127
  23. # post-up ip -6 rule add iif $IFACE table ffnet
  24. # pre-down ip -6 rule del iif $IFACE table ffnet ||:
  25. # post-down ip link delete $IFACE
  26. {% endif %}
  27. {% endfor %}