
router id @MY_IP_ADDRESS@;

# We are only going to export routes from Calico interfaces.
# Currently, 'tap*' is used by the OpenStack implementation
# and 'cali*' is used by the docker implementation.
# dummy1 is the interface that bare metal "service" addresses
# should be bound to if they should be exported.
# This will need to be updated as we add new interface names.
#
# Also filter out default, just in case.
#
# We should automate the build of this out of variables when
# we have time.

filter export_bgp {
  if ( (ifname ~ "tap*") || (ifname ~ "cali*") || (ifname ~ "dummy1") ) then {
    if  net != 0.0.0.0/0 then accept;
  }
  reject;
}

# Configure synchronization between BIRD's routing tables and the
# kernel.
protocol kernel {
  learn;          # Learn all alien routes from the kernel
  persist;        # Don't remove routes on bird shutdown
  scan time 2;    # Scan kernel routing table every 2 seconds
  import all;
  graceful restart;
  export all;     # Default is export none
  merge paths on; # Allow export multipath routes (ECMP)
}

# Watch interface up/down events.
protocol device {
  scan time 2;    # Scan interfaces every 2 seconds
}

protocol direct {
   debug all;
   interface "-dummy0", "dummy1", "eth*", "em*", "en*", "br-mgmt";
}
