fastd.conf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #
  2. # {{ site }} / {{ network }} FASTd configuration (Salt managed)
  3. #
  4. log to syslog level info;
  5. interface "{{ site }}_{{ network }}";
  6. {%- if 'aes' in grains['cpu_flags'] %}
  7. method "aes128-ctr+umac";
  8. {%- else %}
  9. #method "aes128-ctr+umac"; # Not supported by CPU on this machine
  10. {%- endif %}
  11. method "salsa2012+umac";
  12. {%- if site == 'legacy' %}
  13. method "salsa2012+gmac";
  14. {%- endif %}
  15. {#- nodes{4,6} VPNs #}
  16. {%- if network_type == 'nodes' %}
  17. {%- set proto = network.split ('-')[-1] %}
  18. {%- set port = 10000 + site_no|int %}
  19. {%- if network == 'nodes4' %}
  20. bind 0.0.0.0:{{ port }} interface "vrf_external";
  21. {%- else %}
  22. bind [::]:{{ port }} interface "vrf_external";
  23. {%- endif %}
  24. {#- intergw VPN #}
  25. {%- else %}
  26. {%- set port = 11000 + site_no|int %}
  27. bind 0.0.0.0:{{ port }} interface "vrf_external";
  28. bind [::]:{{ port }} interface "vrf_external";
  29. {%- endif %}
  30. # Mark packets to make sure they are associated to VRF vrf_external.
  31. # Specifying the interface and setsockopt() isn't enough for fastd.
  32. packet mark 0x1023;
  33. include "secret.conf";
  34. mtu 1406;
  35. status socket "/var/run/fastd.{{ site }}_{{ network }}.sock";
  36. on up "
  37. ifconfig $INTERFACE down
  38. ip link set address {{ mac_address }} dev $INTERFACE
  39. ifconfig $INTERFACE up
  40. batctl -m {{ bat_iface }} if add $INTERFACE
  41. ";
  42. on down "
  43. batctl -m {{ bat_iface }} if del $INTERFACE
  44. ";
  45. {%- if 'nodes' in network %}
  46. #on establish async "/usr/local/bin/ff_log_vpnpeer establish";
  47. #on disestablish async "/usr/local/bin/ff_log_vpnpeer disestablish";
  48. include peers from "/etc/freifunk/peers";
  49. {%- if peer_limit %}
  50. peer limit {{ peer_limit }};
  51. {%- endif %}
  52. {%- elif 'intergw' in network %}
  53. include peers from "gateways";
  54. {%- endif %}