fastd.conf.j2 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # This file is managed by ansible, don't make changes here - they will be overwritten.
  2. # Bind to a fixed address and port, IPv4 and IPv6
  3. bind {{ansible_eth0.ipv4.address}}:{{fastd.port}} interface "eth0";
  4. {% for v6 in ansible_eth0.ipv6 %}
  5. {% if v6.scope == 'global' %}
  6. bind [{{v6.address}}]:{{fastd.port}} interface "eth0";
  7. {% endif %}
  8. {% endfor %}
  9. # Set the user, fastd will work as
  10. user "nobody";
  11. # Set the interface name
  12. interface "mesh-vpn";
  13. # Set the mode, the interface will work as
  14. mode tap;
  15. # Set the mtu of the interface (salsa2012 with ipv6 will need 1406)
  16. mtu 1406;
  17. # Set the methods (aes128-gcm preferred, salsa2012+umac preferred for nodes)
  18. method "aes128-gcm";
  19. method "salsa2012+umac";
  20. method "salsa2012+gmac";
  21. # Secret key generated by `fastd --generate-key`
  22. include "secret.key";
  23. # Log everything to syslog
  24. log to syslog level debug;
  25. # Include peers from our git-repos
  26. include peers from "/etc/fastd/vpn/peers/";
  27. # Status Socket
  28. status socket "/tmp/fastd-status";
  29. # Configure a shell command that is run on connection attempts by unknown peers (true means, all attempts are accepted)
  30. # on verify "true";
  31. on verify "
  32. /bin/bash /var/gateway-ffms/fastd/verify.sh $PEER_KEY
  33. ";
  34. # Configure a shell command that is run when fastd comes up
  35. on up "
  36. chmod ugo+rw /tmp/fastd-status
  37. ip link set dev $INTERFACE address de:ad:be:ef:43:{{server_id}}
  38. ip link set dev $INTERFACE up
  39. batctl if add $INTERFACE
  40. {% if fastd.ip_rule_42 %}
  41. ip rule add from {{ffrl_nat_ip}} lookup 42
  42. ip -6 rule add from {{ff_network.v6_network}} lookup 42
  43. {% endif %}
  44. ";