Static route IPv4 via FE80::2/64 and interface issue

Ondrej Zajicek santiago at crfreenet.org
Wed Feb 14 17:39:16 CET 2024


On Wed, Feb 14, 2024 at 10:05:59AM +0000, Saklak, Marcin via Bird-users wrote:
> Hello Bird Users,
> 
> I have an issue with adding static route and interfaces. I use two different platform one has interface names like eth-1_1_32 and second eth-1\1\64.
> First one works as I would expect.
> 
> route 192.168.1.5/32 via fe80::2 % "eth-1\1\64";
> bird> configure
> 
> Reading configuration from /mnt/storage/config/bird.conf
> 
> /mnt/storage/config/bird.conf:29:51 syntax error, unexpected TEXT
> 
> for:
> route 192.168.1.5/32 via "fe80::2%eth-1\1\64";
> no error and no entries in linux
> I did also tests with
> route 192.168.1.5/32 via "fe80::2%eth-1\\\1\\\64";
> route 192.168.1.5/32 via "fe80::2%eth-1\\1\\64";
> 
> route 192.168.1.5/32 via fe80::2 % ’eth-1\\\1\\\64’;
> route 192.168.1.5/32 via fe80::2 % ’eth-1\\1\\64’;
> 
> without any success
> 
> Is it possible to make it work on both cases or there is some other way to configure such static route?

Hi

Looking now at the lexer and grammar rules, it is:

Quoted symbols (e.g. 'abc') can contain alphanumeric, '_', '-', '.' and ':'.

Doublequoted strings (e.g. "abc") can contain everything except '"',
as there is no quoting. It would be just "eth-1\1\64"

Unfortunately, for static route with link-local IPv6 address, the grammar
requires symbol not string, so one could just write something like fe80::1%eth0.

Therefore, it is not possible to use such interface name here directly.

You could do it indirectly, by defining it as a direct route and setting
nexthop in filter:

route 2001:db8:10::/48 via "eth-1\1\64" { gw = fe80::2; };


I think that we should accept more sane syntax for static routes with
link-local next hops, like one used by 'ip' command from iproute2,
i.e.:

route 2001:db8:10::/48 via fe80::1 dev "eth0";

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
"To err is human -- to blame it on a computer is even more so."



More information about the Bird-users mailing list