<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <style>
html {
  line-height: 1.2;
  font-family: serif;
  font-size: 0.9em;
  color: black; 
  background-color: white;
}
body {
  margin: 0;
  margin-right: auto;
  max-width: 36em;
  padding: 1em;
  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
@media print {
  body {
    background-color: transparent;
    color: black;
    font-size: 11pt;
  }
  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }
  h2, h3, h4 {
    page-break-after: avoid;
  }
}
p {
  margin: 1em 0;
}
a {
  color: black;
}
a:visited {
  color: black;
}
img {
  max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.4em;
}
h5, h6 {
  font-size: 1em;
  font-style: italic;
}
h6 {
  font-weight: normal;
}
ol, ul {
  padding-left: 1.7em;
  margin-top: 1em;
}
li > ol, li > ul {
  margin-top: 0;
}
blockquote {
  margin: 0.5em;
  padding-left: 0.5em;
  border-left: 2px solid #e6e6e6;
  color: #444;
}
code {
  font-family: 'Lucida Console', monospace;
  font-size: 95%;
  margin: 0;
}
pre {
  margin: 1em 0;
  overflow: auto;
  max-width: unset;
  width: fit-content;
}
pre code {
  padding: 0;
  overflow: visible;
  overflow-wrap: normal;
  max-width: unset;
  white-space: pre-wrap;
}
pre code span {
  white-space: pre;
}
.sourceCode {
 background-color: transparent;
 overflow: visible;
}

code.diff span.kw,
code.diff span.dt {
  font-weight: bold;
}

code.diff span.va {
  background-color: rgba(192, 255, 192, 64);
  color: rgb(0, 64, 0);
}

code.diff span.st {
  background-color: rgba(255, 192, 192, 64);
  color: rgb(64, 0, 0);
}

pre.diff {
  background-color: rgb(240, 240, 240);
  padding: 0.4em;
  border: 1pt solid grey;
}

hr {
  background-color: black;
  border: none;
  height: 1px;
  margin: 1em 0;
}
table {
  margin: 1em 0;
  border-collapse: collapse;
  width: 100%;
  overflow-x: auto;
  display: block;
  font-variant-numeric: lining-nums tabular-nums;
}
table caption {
  margin-bottom: 0.75em;
}
tbody {
  margin-top: 0.5em;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}
th {
  border-top: 1px solid black;
  padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
  padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
  margin-bottom: 4em;
  text-align: center;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
q { quotes: "„" "”" "»" "«"; }
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
  </style>
</head>
<body>
<p>Hello Nico,</p>
<p>unless you have BGP TX Add-Path, you are exporting only the best
route, which is the direct one in this case, and that’s filtered
out.</p>
<p>I would suggest to drop the direct protocol preference under the
static protocol, at least for this route. Or raising the preference in
the static, you may say something like</p>
<pre><code>route 185.203.114.0/23 dev eth4 { preference = 250; };</code></pre>
<p>for just this one route and i hope that i haven’t botched our own
syntax.</p>
<p>This should make it work.</p>
<p>Maria</p>
<p>On Thu, Nov 20, 2025 at 01:59:48PM +0100, Nico Schottelius via
Bird-users wrote:</p>
<blockquote>
<p>Hello,</p>
<p>today I have a related issue with missing route export:</p>
<ul>
<li><p>In a bgp instance I use the filter
“from_our_place_to_internet”</p></li>
<li><p>If I run “show route filter from_our_place_to_internet” all
correct routes match</p></li>
<li><p>However if I check on the other eBGP end, the route is actually
<em>not</em> received (it’s not filtered, it is really not
received)</p></li>
<li><p>If I “hack” the filter as follows, bird DOES export the route: #
Hack 2025-11-20 if ( net ~ [ 185.203.114.0/23+ ] ) then { print
“Exporting 185.203.114.0 to internet”; accept; }</p></li>
<li><p>Some thoughts:</p>
<ul>
<li>The route is direct, static and babel received</li>
<li>Our filter matches RTS_STATIC</li>
<li>However bird seems to “prefer” the direct route</li>
<li>We do not export direct marked routes, but static routes</li>
<li>Is that the cause of the problem? But it is also static…</li>
</ul></li>
</ul>
<p>However it does not make sense to me, thus wondering:</p>
<ul>
<li>Why does bird show the route in the filter output?</li>
<li>Why does bird show not export it via eBGP?</li>
<li>Why does my hack then make it work in the end?</li>
</ul>
<p>Details below, any help appreciated as this is driving me nuts.</p>
<p>Best regards,</p>
<p>Nico</p>
<hr />
<ol type="a">
<li>the affected route</li>
</ol>
<p>bird> show route all 185.203.114.0/23 Table master4:
185.203.114.0/23 unicast [direct1 2025-11-07] * (240) dev eth4 Type:
device univ unicast [place6_10_v4 2025-11-07] (200) dev eth4 Type:
static univ unicast [babel1 12:47:44.565 from fe80::3eec:efff:fecb:d81b]
(130/96) [00:00:00:00:93:4e:c2:43] via 147.78.194.67 on eth1 Type: Babel
univ Babel.metric: 96 Babel.router_id: 00:00:00:00:93:4e:c2:43
bird></p>
<ol start="2" type="a">
<li>the show route output</li>
</ol>
<p>bird> show route filter from_our_place_to_internet Table master4:
185.203.114.0/23 unicast [place6_10_v4 2025-11-07] (200) dev eth4 …</p>
<ol start="3" type="a">
<li>the filter itself</li>
</ol>
<p>filter from_our_place_to_internet { if(!has_internet_length()) then
reject; if(is_default_route()) then reject;</p>
<p>if(is_from_local_asn() || is_emitted_by_one_of_our_asn_directly() ||
should_export_to_internet_from_customer() ) then accept;</p>
<p>reject;</p>
<p>}</p>
<p>… where the related functions are:</p>
<p>function has_internet_length() -> bool { if ((net.type = NET_IP6
&& net.len > 48) || (net.type = NET_IP4 && net.len
> 24)) then { return false; } return true; }</p>
<p>function is_v6_default() -> bool { if (net = ::/0) then return
true; return false; }</p>
<p>function is_v4_default() -> bool { if (net = 0.0.0.0/0) then
return true; return false; }</p>
<p>function is_default_route() -> bool { if(is_v6_default() ||
is_v4_default()) then return true; return false; }</p>
<p>function is_from_local_asn() -> bool { if(source = RTS_STATIC)
then return true; if(source = RTS_BGP && bgp_path.len = 0) then
return true;</p>
<p>return false; }</p>
<p>function emitted_from_one_of_our_asn() -> bool { if(bgp_path.last
~ our_asn) then return true; return false; }</p>
<p>function should_export_to_internet_from_customer() -> bool { # We
don’t consider non-internet networks if(!has_internet_length()) then
return false;</p>
<p>if ( (bgp_path.first ~ our_asn) && # received from one of our
asn (bgp_path.len = 2) && # one of our ASNs received it
(bgp_path.last ~ customer_asn) # one of our customers emitted it and we
accept it ) then return true;</p>
<p>if ( (bgp_path.len = 1) && # we ASNs received it directly
(bgp_path.last ~ customer_asn) # one of our customers emitted it and we
accept it ) then return true;</p>
<p>return false; }</p>
<p>– Sustainable and modern Infrastructures by ungleich.ch</p>
</blockquote>
<p>–<br />
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.</p>
</body>
</html>