bird.conf 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. # Do NOT export local unreachable routes for TE purposes
  42. export where proto != "ffho_te";
  43. }
  44. #
  45. # Load additiional configuration (IGP, FFRL, ICVPN, 'n stuff)
  46. include "/etc/bird/ff-policy.conf";
  47. include "/etc/bird/bird.d/*.conf";