How to unset "gw" attribute when exporting

Bernd Naumann bena at spreadshirt.net
Tue Dec 3 14:56:51 CET 2019


On 03.12.19 13:22, Yousong Zhou wrote:
> Hi list,
> 
> I just tried running BGP over WireGuard link and noticed that routes
> were exported to kernel with "via x.x.x.x" attributes.  It's a L3
> point-to-point link.  While routing works with or without this
> attribute, I am wondering if there is a way to eliminate it.
> 
>    10.168.222.0/24 via 169.254.169.1 dev wg1 proto bird metric 32
> 
> vs.
> 
>    10.168.222.0/24 wg1 scope link
> 
> I tried setting "gw = 0.0.0.0" using an export filter, but bird will
> complain "Invalid gw address" because 0.0.0.0 is considered as
> IADDR_INVALID.
> 
> I am relatively new with routing daemons and protocols at the moment,
> so any comments are welcome.  Thanks in advance.
> 
> Regards,
>                  yousong
> 

Hi Yousong.

As you have not a flat L2 subnet on the other site with the same L3, I 
think you definitely need a Gateway Address for your route.

On a typical LAN you can just use `${network} dev ${dev}` when all 
devices on that L2 are using the same L3. But if you want to route, you 
need `via ${gateway}`. Maybe there are exception I'm not aware of, but 
"normally" you will need it.

Maybe not an issue but keep an eye on your bgo config regarding 'next 
hop self'

Best,
Bernd


More information about the Bird-users mailing list