Re: [systemd-devel] networkd 249.11 fails to create ip6gre and vti6 tunnels

2023-11-27 Thread Mantas Mikulėnas
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.

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.

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.

On Mon, Nov 27, 2023, 19:38 Danilo Egea Gondolfo <
danilo.egea.gondo...@gmail.com> wrote:

> Hello,
>
> I'm looking for help to understand an issue we are observing on Ubuntu
> 22.04.
>
> networkd is failing with "netdev could not be created: Invalid argument"
> when I try to create either an ip6gre or vti6 device.
>
> 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.
>
> 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).
>
> How to reproduce the problem (tested on Ubuntu 22.04 (jammy) with systemd
> 249.11-0ubuntu3.11 and kernel 5.15.0-89-generic):
>
> --- /etc/systemd/network/tun0.netdev ---
> [NetDev]
> Name=tun0
> Kind=ip6gre
>
> [Tunnel]
> Independent=true
> Local=fe80::1
> Remote=2001:dead:beef::2
> --
>
> --- /etc/systemd/network/tun0.network ---
> [Match]
> Name=tun0
>
> [Network]
> LinkLocalAddressing=ipv6
> ConfigureWithoutCarrier=yes
> --
>
> After restarting networkd I see this in the logs
> tun0: netdev could not be created: Invalid argument
> tun0: netdev removed
>
> If we boot a kernel that doesn't have [1], the interface tun0 is created.
>
> Here is the full log with debug enabled
> https://paste.ubuntu.com/p/dPbPxgRThW/
>
> As I said, the problem seems to be fixed already in systemd, but I'm
> looking for help to understand what changes fixed it.
> The theory is that the netlink attributes used to configure the tunnel
> local/remote IPs might be wrong.
>
> This problem is documented here
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2037667
>
> Thanks in advance.
>
> [1] -
> https://github.com/torvalds/linux/commit/b0ad3c179059089d809b477a1d445c1183a7b8fe
>


[systemd-devel] networkd 249.11 fails to create ip6gre and vti6 tunnels

2023-11-27 Thread Danilo Egea Gondolfo

Hello,

I'm looking for help to understand an issue we are observing on Ubuntu 
22.04.


networkd is failing with "netdev could not be created: Invalid argument" 
when I try to create either an ip6gre or vti6 device.


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.


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).


How to reproduce the problem (tested on Ubuntu 22.04 (jammy) with 
systemd 249.11-0ubuntu3.11 and kernel 5.15.0-89-generic):


--- /etc/systemd/network/tun0.netdev ---
[NetDev]
Name=tun0
Kind=ip6gre

[Tunnel]
Independent=true
Local=fe80::1
Remote=2001:dead:beef::2
--

--- /etc/systemd/network/tun0.network ---
[Match]
Name=tun0

[Network]
LinkLocalAddressing=ipv6
ConfigureWithoutCarrier=yes
--

After restarting networkd I see this in the logs

tun0: netdev could not be created: Invalid argument
tun0: netdev removed

If we boot a kernel that doesn't have [1], the interface tun0 is created.

Here is the full log with debug enabled 
https://paste.ubuntu.com/p/dPbPxgRThW/


As I said, the problem seems to be fixed already in systemd, but I'm 
looking for help to understand what changes fixed it.
The theory is that the netlink attributes used to configure the tunnel 
local/remote IPs might be wrong.


This problem is documented here 
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2037667


Thanks in advance.

[1] - 
https://github.com/torvalds/linux/commit/b0ad3c179059089d809b477a1d445c1183a7b8fe