<div dir="auto"><div>Kernel and systemd changes aside, I kind of want to say that you need to specify an interface for the link-local endpoint to be bound to – just as with regular sockets. If the tunnel were device-bound and not independent, that would happen by default.</div><div dir="auto"><br></div><div dir="auto">It also seems weird that the tunnel has endpoints with different scopes; I think I've seen routers reject such packets with a "Scope Mismatch" error.</div><div dir="auto"><br></div><div dir="auto">I would try building systemd from Git source; if I remember correctly, systemd-networkd could be run directly from the build directory, making it possible to `git bisect` down to the change that fixed this.<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, Nov 27, 2023, 19:38 Danilo Egea Gondolfo <<a href="mailto:danilo.egea.gondolfo@gmail.com">danilo.egea.gondolfo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<p>Hello,</p>
<p>I'm looking for help to understand an issue we are observing on
Ubuntu 22.04.</p>
<p>networkd is failing with "netdev could not be created: Invalid
argument" when I try to create either an ip6gre or vti6 device.</p>
<p>We believe this problem started when we pulled this change [1] in
to the kernel 5.15. The problem also happens with the most recent
upstream kernel so it's not an issue introduced by Ubuntu.<br>
</p>
<p>The problem doesn't happen on recent versions of systemd but we'd
like to fix it on systemd 249 (used by Ubuntu 22.04).<br>
</p>
<p>How to reproduce the problem (tested on Ubuntu 22.04 (jammy) with
systemd 249.11-0ubuntu3.11 and kernel 5.15.0-89-generic):<br>
</p>
<p>--- /etc/systemd/network/tun0.netdev ---<br>
[NetDev]<br>
Name=tun0<br>
Kind=ip6gre<br>
<br>
[Tunnel]<br>
Independent=true<br>
Local=fe80::1<br>
Remote=2001:dead:beef::2<br>
------</p>
<p>--- /etc/systemd/network/tun0.network ---<br>
[Match]<br>
Name=tun0<br>
<br>
[Network]<br>
LinkLocalAddressing=ipv6<br>
ConfigureWithoutCarrier=yes<br>
------</p>
<p>After restarting networkd I see this in the logs<br>
</p>
<span id="m_7462829616255168264line-number-88">tun0: netdev could not be created: Invalid
argument<br>
</span><span id="m_7462829616255168264line-number-89">tun0: netdev removed</span>
<p><span id="m_7462829616255168264line-number-89">If we boot a kernel that doesn't have
[1], the interface tun0 is created.<br>
</span></p>
<p><span id="m_7462829616255168264line-number-89">Here is the full log with debug enabled
<a href="https://paste.ubuntu.com/p/dPbPxgRThW/" target="_blank" rel="noreferrer">https://paste.ubuntu.com/p/dPbPxgRThW/</a></span></p>
<p><span id="m_7462829616255168264line-number-89">As I said, the problem seems to be
fixed already in systemd, but I'm looking for help to understand
what changes fixed it.<br>
The theory is that the netlink attributes used to configure the
tunnel local/remote IPs might be wrong.<br>
</span></p>
<p></p>
<p>This problem is documented here
<a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2037667" target="_blank" rel="noreferrer">https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2037667</a></p>
<p>Thanks in advance.<br>
</p>
<p>[1] -
<a href="https://github.com/torvalds/linux/commit/b0ad3c179059089d809b477a1d445c1183a7b8fe" target="_blank" rel="noreferrer">https://github.com/torvalds/linux/commit/b0ad3c179059089d809b477a1d445c1183a7b8fe</a><br>
</p>
</div>
</blockquote></div></div></div>