<commit_before>
router id <%= @ipaddress_trp1 %>;

<% if @debug %>debug protocols all;
<% end -%>
# We are only going to export routes from Calico interfaces.
# Currently, 'tap*' is used by the OpenStack implimentation
# and 'cali*' is used by the docker implimentation.
# 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*") 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
  device routes;  # protect kernel device routes from being overwritten or removed by IGP routes
  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
}

protocol bfd {
  neighbor <%= scope().call_function('hiera',['netcfg_trp_gateway']) %>;
}

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

protocol direct {<commit_msg>do not export default route to kernel<commit_after>
router id <%= @ipaddress_trp1 %>;

<% if @debug %>debug protocols all;
<% end -%>

filter export_bgp {
  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
  device routes;  # protect kernel device routes from being overwritten or removed by IGP routes
  persist;        # Don't remove routes on bird shutdown
  scan time 2;    # Scan kernel routing table every 2 seconds
  import all;
  graceful restart;
  export filter export_bgp;
}

protocol bfd {
<% scope().call_function('hiera',['netcfg_trp_rr']).each do |name| %><%if name[1]['peer_ipv4'] %>  neighbor <%= name[1]['peer_ipv4'] %>;
<% end %><% end %>}

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

protocol direct {
{'fraction_non_alphanumeric': 0.09725250763192324, 'fraction_numerical': 0.010902747492368076, 'mean_word_length': 3.5788423153692617, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5513205', 'n_tokens_mistral': 734, 'n_tokens_neox': 684, 'n_words': 287}