doc/examples: remove unnecessary route for IPv6 on-link gateways#312
Conversation
When the on-link flag is enabled, the additional route has no effect. This extra route is only required when the on-link flag is *not* set. Indeed, for netorkd, when "on-link" is true, the resulting systemd-networkd config file contains "GatewayOnLink=true", which translates to "flags: onlink" in its logs. The resulting route appears with this "onlink" flag in the output of "ip route". Similarly, for NetworkManager, "route1_options=onlink=true" gets added by https://github.com/canonical/netplan/blob/e5ff9f6dbeb20a8a3e6abc712efcf1b0008afa75/src/nm.c#L228-L230
|
Hello and thank you for your PR. That sounds correct. We also should mention in the docs that Line 204 in e5ff9f6 |
|
Tagging @slyon for further thoughts. |
slyon
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Yes, I agree with the understanding that an additional scope: link route is not needed for IPv6. Checking the origin of this example doesn't give any special reason for it to be included, neither: canonical/netplan.io@ed72e3a
And checking the relevant systemd-networkd docs for Scope= states the following:
For IPv4 route, defaults to "host" if Type= is "local" or "nat", and "link" if Type= is "broadcast", "multicast", "anycast", or "unicast". In other cases, defaults to "global". The value is not used for IPv6.
LGTM!
Also, I agree with @daniloegea's assessment that we should add a comment about scope being effective only for IPv4. I'll add such comment before merging.
Description
Hi,
When the on-link flag is enabled, the additional route has no effect. This extra route is only required when the on-link flag is not set.
Indeed, for netorkd, when "on-link" is true, the resulting systemd-networkd config file contains "GatewayOnLink=true", which translates to "flags: onlink" in its logs. The resulting route appears with this "onlink" flag in the output of "ip route".
Similarly, for NetworkManager, "route1_options=onlink=true" gets added by
netplan/src/nm.c
Lines 228 to 230 in e5ff9f6
Checklist
make checksuccessfully → except fortest_with_empty_configwhich also fails on themainbranch on my Ubuntu 22.10 test server, so I'm assuming this is entirely unrelated.make check-coverage).