From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 20EE720EC93 for ; Mon, 29 Apr 2024 09:49:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 24714928B; Mon, 29 Apr 2024 09:49:50 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Mon, 29 Apr 2024 09:49:22 +0200 Message-Id: <20240429074922.57340-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -2.562 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH docs v2] fix #5429: network: override device names: include Type=ether X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Mention that the systemd link file should contain `Type=ether` in most setup, to make sure it only applies to Ethernet devices and does not ever apply to e.g. bridges or bonds which inherit the MAC address of the Ethernet device. Mention that some setups may require other options. Reported in the forum [0] and in #5429 [1]. [0] https://forum.proxmox.com/threads/144557/post-656188 [1] https://bugzilla.proxmox.com/show_bug.cgi?id=5429 Fixes: 96c0261 ("fix #4847: network: extend section on interface naming scheme") Signed-off-by: Friedrich Weber --- Notes: Changes v1 -> v2: - link #5429 which was opened in the meantime - expand on why Type=ether is recommended - mention that some setups may require other choices (thx Thomas) v1: https://lists.proxmox.com/pipermail/pve-devel/2024-April/063659.html pve-network.adoc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pve-network.adoc b/pve-network.adoc index ef586ec..be8d63c 100644 --- a/pve-network.adoc +++ b/pve-network.adoc @@ -173,16 +173,25 @@ configured, including their naming. To assign a name to a particular network device, you need a way to uniquely and permanently identify that device in the `[Match]` section. One possibility is to match the device's MAC address using the `MACAddress` option, as it is -unlikely to change. Then, you can assign a name using the `Name` option in the -`[Link]` section. +unlikely to change. -For example, to assign the name `enwan0` to the device with MAC address -`aa:bb:cc:dd:ee:ff`, create a file `/etc/systemd/network/10-enwan0.link` with -the following contents: +The `[Match]` section should also contain a `Type` option to make sure it only +matches the expected physical interface, and not bridge/bond/VLAN interfaces +with the same MAC address. In most setups, `Type` should be set to `ether` to +match only Ethernet devices, but some setups may require other choices. See the +https://manpages.debian.org/stable/udev/systemd.link.5.en.html[systemd.link(5) +manpage] for more details. + +Then, you can assign a name using the `Name` option in the `[Link]` section. + +For example, to assign the name `enwan0` to the Ethernet device with MAC +address `aa:bb:cc:dd:ee:ff`, create a file +`/etc/systemd/network/10-enwan0.link` with the following contents: ---- [Match] MACAddress=aa:bb:cc:dd:ee:ff +Type=ether [Link] Name=enwan0 -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel