interfaces.j2 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 supernode_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. ## Supernode / Node Mesh
  24. # Dummy-Interface als MainIF mit manueller MAC fuer batman-adv
  25. auto meshdummy0
  26. iface meshdummy0 inet manual
  27. pre-up ip link add $IFACE type dummy
  28. pre-up ip link set address {{supernode_mesh_mac}} dev $IFACE
  29. pre-up ip link set up dev $IFACE
  30. post-down ip link set down dev $IFACE
  31. up batctl if add $IFACE
  32. # batman-adv Mesh Interface, wird von meshdummy0 per Hotplug aktiviert
  33. allow-hotplug bat0
  34. iface bat0 inet static
  35. address {{supernode_mesh_ipv4}}
  36. netmask {{supernode_mesh_netmask_ipv4}}
  37. hwaddress {{supernode_bat_macaddress}}
  38. pre-up ip rule add from {{supernode_mesh_net_cidr}} table 42
  39. pre-up ip rule add to {{supernode_mesh_net_cidr}} table 42
  40. pre-up batctl it 5000
  41. pre-up batctl bl 0
  42. pre-up batctl gw server 48mbit/48mbit
  43. pre-up echo 120 > /sys/class/net/$IFACE/mesh/hop_penalty
  44. # Paralleles Macvlan-Interface mit fixer MTU fuer Alfred
  45. up ip link add link $IFACE alfred0 type macvlan
  46. up ip link set dev alfred0 mtu 1280
  47. up ip link set up dev alfred0
  48. iface bat0 inet6 static
  49. address {{supernode_mesh_ipv6}}
  50. pre-up ip -6 rule add from {{supernode_mesh_net_ipv6}} table 42
  51. pre-up ip -6 rule add to {{supernode_mesh_net_ipv6}} table 42
  52. #pre-up ebtables -A FORWARD -p IPv6 -i $IFACE --ip6-proto ipv6-icmp --ip6-icmp-type router-advertisement -j DROP
  53. {% if supernode_mesh_backbones is defined %}
  54. {% for backbone in supernode_mesh_backbones %}
  55. {% if backbone.comment is defined %}
  56. # {{backbone.comment}}
  57. {% endif %}
  58. auto {{backbone.name}}
  59. iface {{backbone.name}} inet manual
  60. pre-up ip link add $IFACE type gretap local {{supernode_local_ip}} remote {{backbone.remote_ip}} dev eth0
  61. pre-up ip link set up dev $IFACE
  62. up batctl if add $IFACE
  63. post-down ip link set down dev $IFACE
  64. {% endfor %}
  65. {% endif %}
  66. ## Uplink-Tunnel zum FFRG/FFRL-Backbone
  67. {% if supernode_uplinks is defined %}
  68. {% for uplink in supernode_uplinks %}
  69. {% if uplink.comment is defined %}
  70. # {{uplink.comment}}
  71. {% endif %}
  72. auto {{uplink.name}}
  73. iface {{uplink.name}} inet tunnel
  74. mode gre
  75. address {{uplink.address}}
  76. dstaddr {{uplink.dstaddr}}
  77. netmask {{uplink.netmask}}
  78. local {{supernode_local_ip}}
  79. endpoint {{uplink.endpoint}}
  80. mtu 1400
  81. ttl 64
  82. iface {{uplink.name}} inet6 static
  83. address {{uplink.address_v6}}
  84. {% endfor %}
  85. {% endif %}