From 4fee74cb59daac1192d185e19013faa912d6c7f5 Mon Sep 17 00:00:00 2001 From: Pau Capdevila Date: Tue, 7 Jan 2025 21:18:35 +0100 Subject: [PATCH] Disable LLDP agent on Server VM XL710 NICs Signed-off-by: Pau Capdevila --- pkg/hhfab/vlab_butane.tmpl.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkg/hhfab/vlab_butane.tmpl.yaml b/pkg/hhfab/vlab_butane.tmpl.yaml index d3af9425b..d29e4c693 100644 --- a/pkg/hhfab/vlab_butane.tmpl.yaml +++ b/pkg/hhfab/vlab_butane.tmpl.yaml @@ -20,6 +20,20 @@ systemd: - name: locksmithd.service mask: true + - name: disable-nic-lldp-agent.service + enabled: true + contents: | + [Unit] + Description=Disable LLDP on i40e Devices + After=network.target + + [Service] + ExecStart=/var/lib/scripts/disable_nic_lldp_agent.sh + Type=oneshot + + [Install] + WantedBy=multi-user.target + storage: files: - path: /etc/flatcar/update.conf @@ -69,3 +83,14 @@ storage: DHCP=yes LLDP=yes EmitLLDP=yes + + - path: /var/lib/scripts/disable_nic_lldp_agent.sh + mode: 0755 + contents: + inline: | + #!/bin/bash + for device in /sys/kernel/debug/i40e/*; do + if [ -d "$device" ] && [ -w "$device/command" ]; then + echo 'lldp stop' > "$device/command" + fi + done