Bug 90831 - networkd: IPv6 Gateway cannot be link local
Summary: networkd: IPv6 Gateway cannot be link local
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Tom Gundersen
QA Contact: Tom Gundersen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 16:51 UTC by Marc Haber
Modified: 2019-08-20 14:38 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marc Haber 2015-06-03 16:51:01 UTC
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
Comment 1 Lennart Poettering 2015-06-08 20:16:04 UTC
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.
Comment 2 Marc Haber 2015-06-09 13:22:28 UTC
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.
Comment 3 Jeremy Visser 2016-12-14 04:15:17 UTC
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.
Comment 4 Yu Watanabe 2019-08-20 14:38:29 UTC
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.