<div dir="ltr"><div>tun interfaces cannot be put in a bridge because they do not use an Ethernet-like L2 link-layer header (or any L2 header at all, really; they're purely L3 interfaces).</div><div><br></div><div>You need to use a 'tap' interface instead.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 31, 2023 at 1:05 PM Thomas Köller <<a href="mailto:thomas@koeller.dyndns.org">thomas@koeller.dyndns.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am trying to build a VPN tunnel through a tun interface created by <br>
sshd. The tun interface is to be added to an existing bridge interface. <br>
For this purpose I created a .network file (see below). However, the <br>
operation fails, without systemd-networkd giving a useful error message <br>
beyond 'Invalid argument', not even if logging is set do debug:<br>
<br>
<br>
Jan 31 11:04:59 sarkovy systemd-networkd[1294]: Setting log level to debug.<br>
Jan 31 11:04:59 sarkovy systemd-networkd[1294]: Sent message <br>
type=method_return sender=n/a destination=:1.213 path=n/a interface=n/a <br>
member=n/a cookie=44 reply_cookie=3 signature=n/a error-name=n/a <br>
error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Saved new link: <br>
ifindex=6, iftype=NONE(65534), kind=tun<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Saved original MTU <br>
1500 (min: 68, max: 65535)<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Saved IPv6 <br>
link-local address generation mode: eui64<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Flags change: <br>
+MULTICAST +POINTOPOINT +NOARP<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=45 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: link pending udev <br>
initialization...<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: udev initialized link<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: State changed: <br>
pending -> initialized<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=46 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Found driver: tun<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Link state is <br>
up-to-date<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Unmanaging interface.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: State changed: <br>
initialized -> unmanaged<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=47 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: tun0: Interface name <br>
change detected, renamed to vpn_rpi400.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: udev <br>
initialized link<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: State <br>
changed: unmanaged -> initialized<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=48 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Link state <br>
is up-to-date<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: found <br>
matching network '/etc/systemd/network/50-vpn.network'.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Configuring <br>
with /etc/systemd/network/50-vpn.network.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: State <br>
changed: initialized -> configuring<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=49 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link is not activated.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link is not activated.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Setting <br>
'/proc/sys/net/ipv6/conf/vpn_rpi400/use_tempaddr' to '0'<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Setting <br>
'/proc/sys/net/ipv6/conf/vpn_rpi400/accept_ra' to '0'<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Setting <br>
'/proc/sys/net/ipv6/conf/vpn_rpi400/proxy_ndp' to '0'<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: No change in value '0', <br>
suppressing write<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Setting <br>
'/proc/sys/net/ipv4/conf/vpn_rpi400/promote_secondaries' to '1'<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: No change in value '1', <br>
suppressing write<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Requested to <br>
set link flags<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Requested to <br>
set IPv6LL address generation mode<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Requested to <br>
set master interface<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Requested to <br>
set bridge configurations<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Requested to <br>
activate link<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: <br>
link_check_ready(): link layer is configuring.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Setting link <br>
flags<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Setting <br>
IPv6LL address generation mode<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Setting <br>
master interface<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: link flags set.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: IPv6LL <br>
address generation mode set.<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Failed to <br>
set master interface: Invalid argument<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: Failed<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: vpn_rpi400: State <br>
changed: configuring -> failed<br>
Jan 31 11:05:12 sarkovy systemd-networkd[1294]: Sent message type=signal <br>
sender=n/a destination=n/a path=/org/freedesktop/network1/link/_36 <br>
interface=org.freedesktop.DBus.Properties member=PropertiesChanged <br>
cookie=50 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a<br>
Jan 31 11:05:26 sarkovy systemd-networkd[1294]: Got message <br>
type=method_call sender=:1.215 destination=org.freedesktop.network1 <br>
path=/org/freedesktop/network1 interface=org.freedesktop.DBus.Properties <br>
member=Get cookie=2 reply_cookie=0 signature=ss error-name=n/a <br>
error-message=n/a<br>
Jan 31 11:05:26 sarkovy systemd-networkd[1294]: Sent message <br>
type=method_return sender=n/a destination=:1.215 path=n/a interface=n/a <br>
member=n/a cookie=51 reply_cookie=2 signature=v error-name=n/a <br>
error-message=n/a<br>
Jan 31 11:06:35 sarkovy systemd-networkd[1294]: Got message <br>
type=method_call sender=:1.216 destination=org.freedesktop.network1 <br>
path=/org/freedesktop/LogControl1 <br>
interface=org.freedesktop.DBus.Properties member=Set cookie=3 <br>
reply_cookie=0 signature=ssv error-name=n/a error-message=n/a<br>
Jan 31 11:06:35 sarkovy systemd-networkd[1294]: Sent message <br>
type=method_call sender=n/a destination=org.freedesktop.DBus <br>
path=/org/freedesktop/DBus interface=org.freedesktop.DBus <br>
member=GetConnectionUnixUser cookie=52 reply_cookie=0 signature=s <br>
error-name=n/a error-message=n/a<br>
Jan 31 11:06:35 sarkovy systemd-networkd[1294]: Got message <br>
type=method_return sender=org.freedesktop.DBus destination=:1.12 <br>
path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=52 <br>
signature=u error-name=n/a error-message=n/a<br>
<br>
<br>
These are the contents of /etc/systemd/network/50-vpn.network:<br>
<br>
[Match]<br>
Name = vpn_*<br>
<br>
[Link]<br>
RequiredForOnline = no<br>
ActivationPolicy = up<br>
ARP = no<br>
<br>
[Network]<br>
Description = VPN interface<br>
DHCP = no<br>
DHCPServer = no<br>
LinkLocalAddressing = no<br>
DefaultRouteOnDevice = no<br>
LLMNR = no<br>
IPv6AcceptRA = no<br>
Bridge = br_lan<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>