<commit_before>router id <%= node[:ipaddress] %>;

filter import_kernel {
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 20 seconds
  device routes;
  import filter import_kernel;
  export all;     # Default is export none
}

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

protocol direct {
   debug all;
   interface "-dummy0", "dummy1", "eth0";
}

# Peer with all neighbours.
<% @bgp_neighbors.each do |n| %>
protocol bgp <%= n[:fqdn] %> {
  description "Connection to BGP route reflector";
  local as 64511;
  neighbor <%= n[:ipaddress] %> as 64511;
  multihop;
  import all;
  export all;
  next hop self;    # Disable next hop processing and always advertise our
                    # local address as nexthop
  source address <%= node[:ipaddress] %>;  # The local address we use for the TCP connection
}

<% end %><commit_msg>Strip non-alphanumerics from BGP config.<commit_after>router id <%= node[:ipaddress] %>;

filter import_kernel {
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 20 seconds
  device routes;
  import filter import_kernel;
  export all;     # Default is export none
}

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

protocol direct {
   debug all;
   interface "-dummy0", "dummy1", "eth0";
}

# Peer with all neighbours.
<% @bgp_neighbors.each do |n| %>
protocol bgp <%= n[:fqdn].gsub(/[^0-9a-z]/i, '') %> {
  description "Connection to BGP route reflector";
  local as 64511;
  neighbor <%= n[:ipaddress] %> as 64511;
  multihop;
  import all;
  export all;
  next hop self;    # Disable next hop processing and always advertise our
                    # local address as nexthop
  source address <%= node[:ipaddress] %>;  # The local address we use for the TCP connection
}

<% end %>
{'fraction_non_alphanumeric': 0.10343383584589615, 'fraction_numerical': 0.020938023450586266, 'mean_word_length': 3.097770154373928, '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': '3398592', 'n_tokens_mistral': 801, 'n_tokens_neox': 717, 'n_words': 276}