bird.conf 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. # Add unreachable routes for RFC1918, RFC 6598, APIPA so we don't route
  44. # anything private into the internet + null route some bogons.
  45. protocol static bogon_unreach {
  46. route 0.0.0.0/8 unreachable; # Host-Subnet
  47. route 10.0.0.0/8 unreachable; # RFC 1918
  48. route 100.64.0.0/10 unreachable; # RFC 6598
  49. route 169.254.0.0/16 unreachable; # APIPA
  50. route 172.16.0.0/12 unreachable; # RFC 1918
  51. route 192.0.0.0/24 unreachable; # IANA RESERVED
  52. route 192.0.2.0/24 unreachable; # TEST-NET-1
  53. route 192.168.0.0/16 unreachable; # RFC 1918
  54. route 198.18.0.0/15 unreachable; # BENCHMARK
  55. route 198.51.100.0/24 unreachable; # TEST-NET-2
  56. route 203.0.113.0/24 unreachable; # TEST-NET-3
  57. route 224.0.0.0/3 unreachable; # MCast + Class E
  58. }
  59. #
  60. # Load additiional configuration (IGP, FFRL, ICVPN, 'n stuff)
  61. include "/etc/bird/ff-policy.conf";
  62. include "/etc/bird/bird.d/*.conf";