bird.conf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # IPv4 Bird configuration (Salt managed)
  3. #
  4. {%- set node_config = salt['pillar.get']('nodes:' ~ grains['id'], {}) %}
  5. define AS_OWN = 65132;
  6. define LO_IP = {{ salt['ffho_net.get_loopback_ip'](node_config, grains['id'], 'v4') }};
  7. router id {{ salt['ffho_net.get_router_id'](node_config, grains['id']) }};
  8. # this pseudo-protocol watches all interface up/down events
  9. protocol device {
  10. scan time 10;
  11. };
  12. # This pseudo-protocol performs synchronization between BIRD's routing
  13. # tables and the kernel. If your kernel supports multiple routing tables
  14. # (as Linux 2.2.x does), you can run multiple instances of the kernel
  15. # protocol and synchronize different kernel tables with different BIRD tables.
  16. protocol kernel {
  17. scan time 20; # Scan kernel routing table every 20 seconds
  18. {% if 'vpn' in node_config.get ('roles') %}
  19. # Learn host routes set up by VPN server(s) on this machine.
  20. # As there are two VPN hosts it's important to learn an redistribute
  21. # these internally to maintain full reachability.
  22. learn;
  23. import filter {
  24. if net ~ [
  25. 10.132.249.0/24+, # OPS
  26. 10.132.250.0/24+, # User-srv
  27. 10.132.251.0/24+, # Infra-srv
  28. 80.70.181.56/29+ # Vega-IPs
  29. ] then {
  30. # Bump perference of learned kernel routes from 10(!) to very high,
  31. # so they "win" in routed election and there's no clash with any
  32. # backup route via OSPF.
  33. preference = 12345;
  34. accept;
  35. }
  36. reject;
  37. };
  38. {% else %}
  39. import none;
  40. {%- endif %}
  41. export all;
  42. }
  43. #
  44. # Load additiional configuration (IGP, FFRL, ICVPN, 'n stuff)
  45. include "/etc/bird/ff-policy.conf";
  46. include "/etc/bird/bird.d/*.conf";