<div dir="ltr">Thanks for the prompt response Maria. <div><br></div><div>I actually had import all and that did not work either. I've added accept to the kernel protocol with the same results. </div><div>I also don't have any log line about a filter rejecting or accepting.</div><div><br></div><div>// logs after restarting the bgp session </div><div><br></div><div>2019-12-10 22:41:40.989 <INFO> Restarting protocol pe1<br>2019-12-10 22:41:40.989 <TRACE> pe1: Shutting down<br>2019-12-10 22:41:40.989 <TRACE> pe1: Shutdown requested<br>2019-12-10 22:41:40.989 <TRACE> pe1: State changed to stop<br>2019-12-10 22:41:40.989 <TRACE> pe1: BGP session closed<br>2019-12-10 22:41:40.990 <TRACE> pe1 > removed [sole] <a href="http://10.2.34.0/24">10.2.34.0/24</a> unicast<br>2019-12-10 22:41:40.990 <TRACE> pe1 > removed [sole] <a href="http://10.1.12.0/24">10.1.12.0/24</a> unicast<br>2019-12-10 22:41:40.990 <TRACE> pe1: Sending NOTIFICATION(code=6.4)<br>2019-12-10 22:41:40.990 <TRACE> pe1: Down<br>2019-12-10 22:41:40.990 <TRACE> pe1: State changed to flush<br>2019-12-10 22:41:40.990 <TRACE> pe1: State changed to down<br>2019-12-10 22:41:40.990 <TRACE> pe1: Starting<br>2019-12-10 22:41:40.990 <TRACE> pe1: State changed to start<br>2019-12-10 22:41:40.990 <TRACE> pe1: Started<br>2019-12-10 22:41:40.990 <TRACE> pe1: Connect delayed by 5 seconds<br>2019-12-10 22:41:44.994 <TRACE> pe1: Connecting to 192.168.254.1 from local address 192.168.254.0<br>2019-12-10 22:41:45.275 <TRACE> pe1: Connected<br>2019-12-10 22:41:45.275 <TRACE> pe1: Sending OPEN(ver=4,as=65099,hold=90,id=ac100165)<br>2019-12-10 22:41:45.363 <TRACE> pe1: Got OPEN(as=65001,hold=90,id=172.16.0.11)<br>2019-12-10 22:41:45.363 <TRACE> pe1: Sending KEEPALIVE<br>2019-12-10 22:41:45.576 <TRACE> pe1: Got KEEPALIVE<br>2019-12-10 22:41:45.576 <TRACE> pe1: BGP session established<br>2019-12-10 22:41:45.576 <TRACE> pe1: State changed to up<br>2019-12-10 22:41:45.576 <TRACE> pe1: Got UPDATE<br>2019-12-10 22:41:45.576 <TRACE> pe1 > <b>added [best] <a href="http://10.2.34.0/24">10.2.34.0/24</a> unicast</b><br>2019-12-10 22:41:45.576 <TRACE> pe1 < <b>rejected by protocol <a href="http://10.2.34.0/24">10.2.34.0/24</a> unicast</b><br>2019-12-10 22:41:45.576 <TRACE> pe1: Got UPDATE<br>2019-12-10 22:41:45.576 <TRACE> pe1 > <b>added [best] <a href="http://10.1.12.0/24">10.1.12.0/24</a> unicast</b><br>2019-12-10 22:41:45.576 <TRACE> pe1 < <b>rejected by protocol <a href="http://10.1.12.0/24">10.1.12.0/24</a> unicast</b><br>2019-12-10 22:41:45.576 <TRACE> pe1: Got UPDATE<br>2019-12-10 22:41:45.576 <TRACE> pe1: Got END-OF-RIB<br>2019-12-10 22:41:45.576 <TRACE> pe1 < rejected by protocol <a href="http://10.2.34.0/24">10.2.34.0/24</a> unicast<br>2019-12-10 22:41:45.576 <TRACE> pe1 < rejected by protocol <a href="http://10.1.12.0/24">10.1.12.0/24</a> unicast<br>2019-12-10 22:41:45.576 <TRACE> pe1: Sending END-OF-RIB<br></div><div><br></div><div>// kernel protocol</div><div><br></div><div>protocol kernel {<br>        scan time 10;<br>        learn;<br>        persist;<br>        ipv4 {<br>                #import filter {<br>                #       if net ~ [<a href="http://0.0.0.0/0">0.0.0.0/0</a>, <a href="http://192.168.255.0/24">192.168.255.0/24</a>] then reject;<br>                #       accept;<br>                #};</div><div>                # export all;<br>                import all;       <br>        };<br>}<br></div><div><br></div><div>thx</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 10:25 PM Maria Matějka <<a href="mailto:maria.matejka@nic.cz">maria.matejka@nic.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>The kernel protocol import filter is missing the accept; statement after you selectively filter some prefices out. BIRD doesn't know whether you want to accept or reject these routes. It also shall warn you in log. Do you have any log line saying something about filter not rejecting nor accepting? <br>Maria<br><br><div class="gmail_quote">On December 10, 2019 10:09:06 PM GMT+01:00, wax xitau <<a href="mailto:waxitau@gmail.com" target="_blank">waxitau@gmail.com</a>> wrote:<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Hi, <div><br></div><div>Prefixes sent over a eBGP session are getting rejected "by protocol" as can be seen in the logs below. </div><div>The prefixes are "added" and then get "rejected" by protocol. This means that they are visible using the "show route protocol <protocol>"  but not "show route all" (and therefore impossible to push them to the kernel routing table). </div><div><br></div><div><br></div><div>// logs</div><div><br></div>2019-12-10 21:15:00.774 <TRACE> pe1: BGP session established<br>2019-12-10 21:15:00.774 <TRACE> pe1: State changed to up<br>2019-12-10 21:15:00.774 <TRACE> pe1: Sending END-OF-RIB<br>2019-12-10 21:15:00.984 <TRACE> pe1: Got UPDATE<br>2019-12-10 21:15:00.984 <TRACE> pe1 > <b>added [best] <a href="http://10.2.34.0/24" target="_blank">10.2.34.0/24</a> unicast</b><br>2019-12-10 21:15:00.984 <TRACE> pe1 < <b>rejected by protocol <a href="http://10.2.34.0/24" target="_blank">10.2.34.0/24</a> unicast</b><br>2019-12-10 21:15:00.984 <TRACE> pe1: Got UPDATE<br>2019-12-10 21:15:00.984 <TRACE> pe1 > <b>added [best] <a href="http://10.1.12.0/24" target="_blank">10.1.12.0/24</a> unicast</b><br>2019-12-10 21:15:00.984 <TRACE> pe1 < <b>rejected by protocol <a href="http://10.1.12.0/24" target="_blank">10.1.12.0/24</a> unicast</b><br>2019-12-10 21:15:00.984 <TRACE> pe1: Got UPDATE<br><div>2019-12-10 21:15:00.984 <TRACE> pe1: Got END-OF-RIB </div><div><br></div><div>Tcp dump of the corresponding update message(s): </div><div><br></div><div>// tcpdump</div><div><br></div><div>21:18:59.652705 IP (tos 0xc0, ttl 1, id 7035, offset 0, flags [none], proto TCP (6), length 177)<br>    <b>192.168.254.1</b>.bgp > 192.168.254.0.41073: Flags [P.], cksum 0x4356 (correct), seq 83:208, ack 73, win 16384, options [nop,nop,TS val 2249949122 ecr 1355158152], length 125: BGP<br>     Update Message (2), length: 51<br>          Origin (1), length: 1, Flags [T]: IGP<br>          0x0000:  00<br>      AS Path (2), length: 10, Flags [T]: 65001 65500<br>        0x0000:  0202 0000 fde9 0000 ffdc<br>        Next Hop (3), length: 4, Flags [T]: 192.168.254.1<br>      0x0000:  c0a8 fe01<br>       Updated routes:<br>        <a href="http://10.1.12.0/24" target="_blank">10.1.12.0/24</a><br>  Update Message (2), length: 51<br>          Origin (1), length: 1, Flags [T]: Incomplete<br>           0x0000:  02<br>      AS Path (2), length: 10, Flags [T]: 65001 65500<br>        0x0000:  0202 0000 fde9 0000 ffdc<br>        Next Hop (3), length: 4, Flags [T]: <b>192.168.254.1</b><br>           0x0000:  c0a8 fe01<br>       Updated routes:<br>        <a href="http://10.2.34.0/24" target="_blank">10.2.34.0/24</a><br>  Update Message (2), length: 23<br>          End-of-Rib Marker (empty NLRI)<br></div><div><br></div><div>The bgp session is over directly connected interfaces and the NLRI prefix next hops are therefore directly connected. </div><div><br></div><div>// Configuration: </div><div><br></div><div>protocol bgp pe1 {<br>        debug all;<br>        description "ebgp";<br>        hold time 90;<br>        local 192.168.254.0 as my_asn;<br>        neighbor 192.168.254.1 as peer_asn;<br>        direct;<br>        interpret communities off;<br>        ipv4 {<br>                table t_pe1;<br>                import all;<br>                export none;<br>                gateway direct;<br>        };<br>}<br></div><div><br></div><div>protocol device {<br>        scan time 10;<br>};<br><br>protocol direct {<br>        ipv4;<br>};<br><br>protocol kernel {<br>        scan time 10;<br>        learn;<br>        persist;<br>        ipv4 {<br>                import filter {<br>                        if net ~ [<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>, <a href="http://192.168.255.0/24" target="_blank">192.168.255.0/24</a>] then reject;<br>                };<br>        };<br>}<br></div><div><br></div><div>// relevant show results</div><div><br></div><div>bird> <b>show route protocol pe1</b><br>Table t_pe1:<br><b><a href="http://10.2.34.0/24" target="_blank">10.2.34.0/24</a></b>         unicast [pe1 21:46:13.530] * (100) [AS65500?]<br>    via 192.168.254.1 on ens5<br><b><a href="http://10.1.12.0/24" target="_blank">10.1.12.0/24</a></b>         unicast [pe1 21:46:13.530] * (100) [AS65500i]<br>        via 192.168.254.1 on ens5<br>bird><br></div><div><br></div><div>bird> <b>show route all</b><br>Table master4:<br><a href="http://172.16.0.11/32" target="_blank">172.16.0.11/32</a>       unicast [rt_nh 20:25:25.379] * (200)<br>     via 192.168.254.1 on ens5<br>     Type: static univ<br><a href="http://192.168.254.2/31" target="_blank">192.168.254.2/31</a>     unicast [direct1 20:56:03.498] * (240)<br>        dev ens6<br>      Type: device univ<br><a href="http://192.168.254.0/31" target="_blank">192.168.254.0/31</a>     unicast [direct1 20:56:03.498] * (240)<br>        dev ens5<br>      Type: device univ<br><a href="http://192.168.255.0/24" target="_blank">192.168.255.0/24</a>     unicast [direct1 20:56:03.498] * (240)<br>        dev ens4<br>      Type: device univ<br><a href="http://172.16.0.33/32" target="_blank">172.16.0.33/32</a>       unicast [rt_nh 20:25:25.379] * (200)<br>   via 192.168.254.3 on ens6<br>     Type: static univ<br></div><div><br></div><div>Thanks,</div><div><br></div><div><br></div><div><br></div></div>
</blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></blockquote></div>