diff --git a/TODO b/TODO index 1d90eefbbb3..ca2c33c72c0 100644 --- a/TODO +++ b/TODO @@ -133,16 +133,11 @@ Deprecations and removals: Features: -* hwdb: add a new field that can be used to mark network devices where only - ipv4ll/ipv6ll makes sense, i.e. which should not expect to be connected to - the internet, i.e. for direct host-to-host connection. Set it for thunderbolt - networking, and for "laplink"-style network cables. Then make netword match - against that prop in a .network file we ship by default. Would be - particularly useful in storage target mode (i.e. NVME-TCP) modes. i.e. do - what https://christian.kellner.me/2018/05/24/thunderbolt-networking-on-linux/ - and - https://github.com/NetworkManager/NetworkManager/blob/main/data/90-nm-thunderbolt.rules#L11 - do for NM, but generically. +* networkd: controlled by build-time options install some of the + *.network.example files we install currently as regular files *.network. For + many cases it's what you want: just configure the damn network. Hopefully + this can be enabled on Fedora even, though into a separate sub-RPM, so that + we don't conflict with NM. * add support for activating nvme-oF devices at boot automatically via kernel cmdline, and maybe even support a syntax such as diff --git a/hwdb.d/82-net-auto-link-local.hwdb b/hwdb.d/82-net-auto-link-local.hwdb new file mode 100644 index 00000000000..4057378f4f2 --- /dev/null +++ b/hwdb.d/82-net-auto-link-local.hwdb @@ -0,0 +1,12 @@ +# This file is part of systemd. + +# Network interfaces for which only Link-Local communication (i.e. IPv4LL, …) +# makes sense, because they almost certainy will point to another host, not an +# internet router. + +# (Note: matches against drivers go into 82-net-auto-link-local.rules instead) + +# Prolific USB-to-USB links (https://www.prolific.com.tw/US/ShowProduct.aspx?pcid=43) +usb:v067Bp25A1* +usb:v067Bp27A1* + ID_NET_AUTO_LINK_LOCAL_ONLY=1 diff --git a/network/80-auto-link-local.network.example b/network/80-auto-link-local.network.example new file mode 100644 index 00000000000..7f6a14ac419 --- /dev/null +++ b/network/80-auto-link-local.network.example @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 +# +# This example config file is installed as part of systemd. +# It may be freely copied and edited (following the MIT No Attribution license). +# +# To use the file, one of the following methods may be used: +# 1. add a symlink from /etc/systemd/network to the current location of this file, +# 2. copy the file into /etc/systemd/network or one of the other paths checked +# by systemd-networkd and edit it there. +# This file should not be edited in place, because it'll be overwritten on upgrades. + +# Enable IPv4LL + IPv6LL (but no DHCP/IPv6RA) for local links +[Match] +Type=ether +Property=ID_NET_AUTO_LINK_LOCAL_ONLY=1 + +[Network] +LinkLocalAddressing=yes +DHCP=no +IPv6AcceptRA=no +MulticastDNS=yes diff --git a/rules.d/82-net-auto-link-local.rules b/rules.d/82-net-auto-link-local.rules new file mode 100644 index 00000000000..88ac7bc1be0 --- /dev/null +++ b/rules.d/82-net-auto-link-local.rules @@ -0,0 +1,15 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="net_link_local_end" +SUBSYSTEM!="net", GOTO="net_link_local_end" + +# Network interfaces for which only Link-Local communication (i.e. IPv4LL, …) +# makes sense, because they almost certainy will point to another host, not an +# internet router. + +# (Note: matches against VID/PID go into 82-net-auto-link-local.hwdb instead) + +# Thunderbolt host-to-host connections +DRIVERS=="thunderbolt-net", ENV{ID_NET_AUTO_LINK_LOCAL_ONLY}="1" + +LABEL="net_link_local_end"