From 9b7f499ff145b54d42ad8b32cf2ab27cf23cb401 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 4 Mar 2023 14:33:10 +0900 Subject: [PATCH 1/2] man: sync the default .link file in example --- man/systemd.link.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/man/systemd.link.xml b/man/systemd.link.xml index aad3736c36..1aa93fb05e 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -1111,12 +1111,15 @@ /usr/lib/systemd/network/99-default.link - The link file 99-default.link that is - shipped with systemd defines the default naming policy for - links. + The link file 99-default.link that is shipped with systemd defines the + default policies for the interface name, alternative names, and MAC address of links. - [Link] -NamePolicy=kernel database on-board slot path + [Match] +OriginalName=* + +[Link] +NamePolicy=keep kernel database onboard slot path +AlternativeNamesPolicy=database onboard slot path MACAddressPolicy=persistent @@ -1134,7 +1137,7 @@ Name=dmz0 NamePolicy= is not set, so Name= takes effect. We use the 10- prefix to order this file early in the list. Note that it needs to be before - 99-link, i.e. it needs a numerical prefix, to have any effect at all. + 99-default.link, i.e. it needs a numerical prefix, to have any effect at all. From 181d719542fb00ec4cc25d7f857cf82dae8e961f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 4 Mar 2023 14:57:10 +0900 Subject: [PATCH 2/2] man: add an example to (re-)apply new settings to a network interface Closes #26601. --- man/systemd.link.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/man/systemd.link.xml b/man/systemd.link.xml index 1aa93fb05e..546a6a006b 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -1140,6 +1140,23 @@ Name=dmz0 99-default.link, i.e. it needs a numerical prefix, to have any effect at all. + + (Re-)applying a .link file to an interface + + After a new .link file has been created, or an exisiting .link file modified, the new settings + may be applied to the matching interface with the following commands: + + $ sudo udevadm control --reload +$ sudo ip link set eth0 down +$ sudo udevadm trigger --verbose --settle --action add /sys/class/net/eth0 + + You may also need to stop the service that manages the network interface, e.g. + systemd-networkd.service or NetworkManager.service before + the above operation, and then restart the service after that. For more details about + udevadm command, see + udevadm8. + + Debugging <varname>NamePolicy=</varname> assignments