Weird behavior of link local gateway assignments
Hi, I encountered some issues when trying to set the gateway to a link-local IPv6 address in a filter and am wondering if there is a trick I am missing: When assigning a link-local address (say fe80::4242%eno1) to `gw` in a filter using e.g. gw = fe80::4242%eno1; the config file parser complains about a unexpected "%". Of course, it doesn't work without the `%eno1` either ("Invalid gw address"), so is there other way to pass the intended interface? It seems that the interface doesn't get passed even if assigning from an existing address with correctly set interface, since invoking in a filter gw = gw; fails with "Invalid gw address" too if `gw` has a link local value. Is this intended? Is there some other way to set the gw in a filter to a link local value? Best regards, Marcel
On Mon, Mar 15, 2021 at 06:56:24AM +0100, Marcel Krüger wrote:
Hi,
I encountered some issues when trying to set the gateway to a link-local IPv6 address in a filter and am wondering if there is a trick I am missing:
When assigning a link-local address (say fe80::4242%eno1) to `gw` in a filter using e.g.
gw = fe80::4242%eno1;
the config file parser complains about a unexpected "%". Of course, it doesn't work without the `%eno1` either ("Invalid gw address"), so is there other way to pass the intended interface?
Hi Unfortunately this does not work and i do not see any workarounds in existing code. Our IP address data type does not keep 'iface' in it, so link-local IPv6 addresses are a bit of problem. Also, setting gw (regular) in reality sets both gw and iface for a nexthop (gw is resolved and appropriate iface is found). It makes sense to add workaround for link-local addresses so that setting link-local gw is resolved in existing iface, so at least things like: ifname = "eno1"; gw = fe80::4242; or gw = gw; would work. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Mon, Mar 15, 2021 at 04:43:19PM +0100, Ondrej Zajicek wrote:
It makes sense to add workaround for link-local addresses so that setting link-local gw is resolved in existing iface, so at least things like:
ifname = "eno1"; gw = fe80::4242;
or
gw = gw;
would work.
This patch should fix it: https://gitlab.nic.cz/labs/bird/-/commit/94abefc00bb22b93493831798391d5d5b21... -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Marcel Krüger -
Ondrej Zajicek