<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Hi,The function i wrote correctly returns net.</div><div dir="ltr"><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">bird> show route 2602:feda:ab2::/48 where bgp_export_all() </span><br>Table master6:
<br>2602:feda:ab2::/48 unicast [LL_IX 02:19:31.236] * (100) [i]
<br> via 2602:feda:ab2::1 on ll-ix</span></div><div><font size="4"><span style="font-family:monospace"><br></span></font></div><div><font size="4">But it could be export.</font></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">bird> show route export TOHU_IX for 2602:feda:ab2::/48 </span><br>bird> <br>
<font size="4"><br></font></span></div><div><font size="4">I think that should be accept</font></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(212,212,212)"> export filter {</span></div><div><span style="color:rgb(212,212,212)"> if bgp_export_all() then accept</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(106,153,85)"># if (roa_check(r6, net, bgp_path.last_nonaggregated) ~ [ROA_INVALID, ROA_UNKNOWN]) then reject;</span></div><div><span style="color:rgb(106,153,85)"># if is_bogon_asn() then reject;</span></div><div><span style="color:rgb(106,153,85)"># if is_bogon_prefix() then reject; </span></div><div><span style="color:rgb(106,153,85)"># accept;</span></div><div><span style="color:rgb(212,212,212)"> }</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)">}</span></div></div></div><div><font size="4">Why is it not exported?</font></div><div><font size="4">The full configuration is.</font></div><div><font size="4"><br></font></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(212,212,212)">protocol bgp TOHU_IX {</span></div><div><span style="color:rgb(212,212,212)"> local as LOCAL_ASN</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> description </span><span style="color:rgb(206,145,120)">"tohu ix IX-VPS BGP"</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> direct</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> source address 2602:feda:ab5::1</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> neighbor 2602:feda:ab6::1%</span><span style="color:rgb(206,145,120)">'tuhu-ix'</span><span style="color:rgb(212,212,212)"> as 141011</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> ipv6 {</span></div><div><span style="color:rgb(212,212,212)"> next hop self</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> import filter {</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_asn() then reject</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_prefix() then reject</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if (roa_check(r6, net, bgp_path.last_nonaggregated) = ROA_VALID) then reject</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> accept</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> export filter {</span></div><div><span style="color:rgb(212,212,212)"> if bgp_export_all() then accept</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(106,153,85)"># if (roa_check(r6, net, bgp_path.last_nonaggregated) ~ [ROA_INVALID, ROA_UNKNOWN]) then reject;</span></div><div><span style="color:rgb(106,153,85)"># if is_bogon_asn() then reject;</span></div><div><span style="color:rgb(106,153,85)"># if is_bogon_prefix() then reject; </span></div><div><span style="color:rgb(106,153,85)"># accept;</span></div><div><span style="color:rgb(212,212,212)"> }</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)">}</span></div><div><span style="color:rgb(212,212,212)"><br></span></div></div></div><div><font size="4"><br></font></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(212,212,212)">function bgp_export() {</span></div><div><span style="color:rgb(212,212,212)"> if net !~ OUR_PREFIXES then return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_asn() then return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_prefix() then return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> </span></div><div><span style="color:rgb(212,212,212)"> if net_len_too_long() then {</span></div><div><span style="color:rgb(106,153,85)"># print "net ", net, " prefix too long";</span></div><div><span style="color:rgb(212,212,212)"> return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> if </span><span style="color:rgb(86,156,214)">proto</span><span style="color:rgb(212,212,212)"> = </span><span style="color:rgb(206,145,120)">"BGP_Prefix"</span><span style="color:rgb(212,212,212)"> then return true</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if </span><span style="color:rgb(86,156,214)">proto</span><span style="color:rgb(212,212,212)"> = </span><span style="color:rgb(206,145,120)">"LL_IX"</span><span style="color:rgb(212,212,212)"> then{</span></div><div><span style="color:rgb(212,212,212)"> if </span><span style="color:rgb(86,156,214)">bgp_path.len</span><span style="color:rgb(212,212,212)"> = 0 then{</span></div><div><span style="color:rgb(212,212,212)"> return true</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> if </span><span style="color:rgb(86,156,214)">proto</span><span style="color:rgb(212,212,212)"> = </span><span style="color:rgb(206,145,120)">"TOHU_IX"</span><span style="color:rgb(212,212,212)"> then{</span></div><div><span style="color:rgb(212,212,212)"> if </span><span style="color:rgb(86,156,214)">bgp_path.len</span><span style="color:rgb(212,212,212)"> = 0 then{</span></div><div><span style="color:rgb(212,212,212)"> return true</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> } </span></div><div><span style="color:rgb(212,212,212)"> return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)">}</span></div><br><br><div><span style="color:rgb(212,212,212)">function bgp_export_all() {</span></div><div><span style="color:rgb(212,212,212)"> if bgp_export() then {</span></div><div><span style="color:rgb(212,212,212)"> return true</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><br><div><span style="color:rgb(212,212,212)"> if source != RTS_BGP then{</span></div><div><span style="color:rgb(212,212,212)"> return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> }</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_asn() then return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> if is_bogon_prefix() then return false</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)"> return true</span><span style="color:rgb(106,153,85)">;</span></div><div><span style="color:rgb(212,212,212)">}</span></div><br></div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><br></div></div><div><font size="4"><br></font></div><div><font size="4"><br></font></div><div><font size="4"><br><br></font></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"></div><span style="font-family:monospace"></span></div></div>
</div></div>