From 5e5e8404587d03eabc886505a1601a2be81df5da Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 5 Nov 2026 21:21:58 +0100 Subject: [PATCH] fix(openwrt-vm): leave the NIC untagged on a bridge without a port (#18473) Advanced mode prefills the LAN VLAN with 999. On a bridge with no physical port that is not VLAN-aware (an internal vmbr1, the usual LAN choice) pve-bridge cannot tag the tap, and qm start failed with "no physical interface on bridge 'vmbr1'". The tag is dropped there with a warning, for LAN and WAN alike. The scripts base still pointed at DevScripts, where this script was removed on 10-09, so every run was reported as a DevScripts run. --- vm/openwrt-vm.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vm/openwrt-vm.sh b/vm/openwrt-vm.sh index 07742d348..cd7ca06cb 100644 --- a/vm/openwrt-vm.sh +++ b/vm/openwrt-vm.sh @@ -4,7 +4,7 @@ # License: MIT # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -COMMUNITY_SCRIPTS_URL="${COMMUNITY_SCRIPTS_URL:-https://raw.githubusercontent.com/community-scripts/DevScripts/main}" +COMMUNITY_SCRIPTS_URL="${COMMUNITY_SCRIPTS_URL:-https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main}" source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/pve/vm-core.func") load_functions @@ -341,6 +341,18 @@ if [[ "$VM_STATE" != *stopped* ]]; then fi msg_ok "OpenWrt has shut down" +# pve-bridge tags a NIC on a port of the bridge; a bridge without one only takes tags when VLAN-aware +if [[ -n "$LAN_VLAN" && -d "/sys/class/net/${LAN_BRG}/bridge" && "$(cat "/sys/class/net/${LAN_BRG}/bridge/vlan_filtering" 2>/dev/null)" != "1" ]] && + ! ls "/sys/class/net/${LAN_BRG}/brif" 2>/dev/null | grep -qE '^((eth|bond)[0-9]+|en[^.]+)(\.[0-9]+)?$'; then + msg_warn "LAN bridge ${LAN_BRG} has no physical port and is not VLAN-aware; the LAN NIC stays untagged" + LAN_VLAN="" +fi +if [[ -n "$VLAN" && -d "/sys/class/net/${BRG}/bridge" && "$(cat "/sys/class/net/${BRG}/bridge/vlan_filtering" 2>/dev/null)" != "1" ]] && + ! ls "/sys/class/net/${BRG}/brif" 2>/dev/null | grep -qE '^((eth|bond)[0-9]+|en[^.]+)(\.[0-9]+)?$'; then + msg_warn "WAN bridge ${BRG} has no physical port and is not VLAN-aware; the WAN NIC stays untagged" + VLAN="" +fi + msg_info "Adding bridge interfaces on Proxmox side" qm set $VMID \ -net0 virtio,bridge=${LAN_BRG},macaddr=${LAN_MAC}${LAN_VLAN}${MTU} \