Hi, in IPv6, it is extremely common that a gateway is offered on a link local IP address, very often fe80::1. To manually configure this (for example on a router that does by definition not learn IP addresses / routes / prefixes via SLAAC), one would need to write Gateway=fe80::1%eth0 in /etc/systemd/network/foo.network. That syntax is not accepted, leads to a rather misleading "rtnl: received address message without valid ifindex, ignoring" in the log and no route. To add gold plating, maybe a macro like $IFNAME would be automatically set to that Gateway=fe80::1%$IFNAME would become possible. This is a rather bad omission since it makes an extremely common configuration pattern in IPv6 networks impossible. Greetings Marc
The $IFNAME thing sounds unnecessary. networkd could simply implicitly set the scope to the specific ifindex if it detects a link-local address being set.
It is still the common way to write things in IPv6. I can imagine, also, a situation where would want to specify a route on a different interface as the one that is being configured in that file. I do not have any strong emotions about that though.
For comparison, "ip route" also doesn't use the scope ID when setting link-local routes -- it is also inferred from the "dev ethX" part. Also, Windows doesn't use the scope ID when programming link-local addresses into an interface's gateway. So Lennart is right in comment #1 -- the scope ID is unnecessary.
Please try the following. Gateway=fe80::1 GatewayOnLink=yes
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.