<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">As far as I remember, if you set the interface in a filter, than the gw is undefined automatically.</div><div dir="auto"><br></div><div dir="auto">Yep, checked the documentation, and here it is:</div><div dir="auto"><br></div><div dir="auto"><a href="https://bird.network.cz/?get_doc&v=20&f=bird-5.html#ss5.5">https://bird.network.cz/?get_doc&v=20&f=bird-5.html#ss5.5</a><br></div><div dir="auto"><br></div><div dir="auto"><div dir="auto"> string ifname</div><div dir="auto"><br></div><div dir="auto"> Name of the outgoing interface. Sink routes (like blackhole, unreachable or prohibit) and multipath routes have no interface associated with them, so ifname returns an empty string for such routes. **Setting it would also change route to a direct one (remove gateway).**</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Alexander</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 10, 2024, 17:44 Eugene M. Zheganin <<a href="mailto:emz@norma.perm.ru">emz@norma.perm.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
youm this question was asked like a gazillion times, but so far I faled <br>
to google the answer. So, I have a network softrouter on Linux which was <br>
clearly written by some ignorant folks; it operates the p2p tunX <br>
interface that doesn't have the remote IP set, only a local one. So bird <br>
does complain about "strange next-hop" when walking through the kernel <br>
routing table and seeing the local/self address as a gateway. Still, <br>
this is partially valid setup, because the hosts this softrouter injects <br>
into the kernel RT are reachable via p2p interface directly. I can <br>
declare these as a static routes reachable via tunX, but this setup <br>
lacks the automation (I will had to refresh thhe routes manually).<br>
<br>
So, my though is like this: is it possible to convert these from <br>
"strange next-hop" routes to this<br>
<br>
===Cut===<br>
<br>
<a href="http://10.24.123.0/21" rel="noreferrer noreferrer" target="_blank">10.24.123.0/21</a> unicast [direct1 2023-12-07] * (200)<br>
dev tun0<br>
<br>
===Cut===<br>
<br>
via the export filter ? I tried the following approach but it seems like <br>
I'm missing something:<br>
<br>
===Cut===<br>
<br>
filter exportkernelv4 {<br>
if ifname = "tun0" then {<br>
print "attempting to change route attributes: ifname ", <br>
ifname, ", gw: ", gw, ", dest: ", dest;<br>
onlink = true;<br>
#unset(gw);<br>
}<br>
accept;<br>
};<br>
<br>
protocol kernel {<br>
learn;<br>
persist;<br>
scan time 20;<br>
ipv4 {<br>
import all;<br>
export filter exportkernelv4;<br>
};<br>
}<br>
<br>
===Cut===<br>
<br>
<br>
What am I missing ? Seems like for some reason I just cannot merey <br>
unsert the gw attribute.<br>
<br>
<br>
Thanks.<br>
<br>
Eugene.<br>
<br>
<br>
</blockquote></div>