pve-vlan-trunk-troubleshooting
/pve-vlan-trunk-troubleshooting
Pomaga znaleźć przyczynę braku łączności VM w Proxmox VE, gdy problem dotyczy VLAN i trunków.
- Autor
- yg-codes ↗
- Repozytorium
- srepowers ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 09.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 09.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga znaleźć przyczynę braku łączności VM w Proxmox VE, gdy problem dotyczy VLAN i trunków.
Oryginalny opis (EN)
Use when a VM on Proxmox VE cannot reach the network despite correct PVE bridge/VLAN config, when ping or ARP fails for a specific VLAN from the hypervisor host, or when VLAN connectivity works on one PVE node but not another
Jak działa
- Overview
- When to Use
- Interactive Session Setup
- The Four-Phase Method
- Decision Matrix
- Quick Verification After Fix
- Mitigation — Urgent Workaround
- Common Mistakes
- Evidence to Collect (for escalation)
Podgląd SKILL.md
--- name: pve-vlan-trunk-troubleshooting description: Use when a VM on Proxmox VE cannot reach the network despite correct PVE bridge/VLAN config, when ping or ARP fails for a specific VLAN from the hypervisor host, or when VLAN connectivity works on one PVE node but not another --- # PVE VLAN Trunk Troubleshooting ## Overview VLAN connectivity failures on PVE are almost never VM configuration problems. The bridge and tap config is usually correct. The real causes are: missing trunk on the upstream switch port, or subtle bridge-vlan-aware differences between nodes. **Core principle:** Test VLAN reachability from the PVE host itself before blaming the VM. If the gateway ARP fails from the hypervisor, the VM is a victim — not the cause. ## When to Use - VM on VLAN X cannot ping anything; other VMs on same VLAN on other nodes work - New VM created — no connectivity despite correct bridge/tag config - `qm config` shows correct `bridge=vmbr1,tag=227` but VM is unreachable - Migration — VM worked on node A, broken on node B **Do NOT use for:** - All VLANs broken on a node (likely physical link down — check bond status first) - VM cannot reach internet but can reach local subnet (routing/firewall issue) ## Interactive Session Setup **ALWAYS start by collecting these inputs from the user before running any checks.** Ask the user: ``` 1. Target PVE node FQDN (e.g. pve-node01.example.com)? 2. VLAN tag to check (e.g. 227)? 3. VMID to check (optional — skip Phase 1 if not provided)? 4. Reference node where this VLAN works (optional — used for comparison)? 5. Is SSHPASS set in your shell? (required for remote commands) ``` Do not proceed until you have at least **node FQDN** and **VLAN tag**. If the user already provided them in their message, confirm and proceed without re-asking. Store as session variables for all subsequent commands: - `NODE` = target PVE node FQDN - `VLANID` = VLAN tag number - `VMID` = VM ID (if provided) - `REF_NODE` = reference node FQDN (if provided) ## The Four-Phase Method Complete phases in order. Stop when root cause is found. ### Phase 1 — VM Config (5 min) **Goal:** Confirm VM NIC matches working reference VM. ```bash # Affected VM qm config <VMID> | grep -E "net|bridge|tag|firewall" # Reference VM (working, same VLAN, different node) qm config <REF_VMID> | grep -E "net|bridge|tag|firewall" ``` Expected: `net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr1,tag=<VLANID>` Check PVE firewall — if enabled, verify ICMP is not blocked: ```bash cat /etc/pve/firewall/<VMID>.fw 2>/dev/null || echo "No VM firewall" pvesh get /nodes/<node>/firewall/options ``` **If config differs → fix and stop. If identical → Phase 2.** ### Phase 2 — PVE Bridge Config (5 min) **Goal:** Confirm `bridge-vlan-aware yes` and VLAN present in bridge table. ```bash # Check bridge-vlan-aware on affected node vs reference node grep -A10 "vmbr1" /etc/network/interfaces # Full bridge VLAN table — VLAN must appear on vmbr1, bond1, and tap bridge vlan show # Tap interface specifically bridge vlan show dev tap<VMID>i0 ``` Expected tap output: `<VLANID> PVID Egress Untagged` If `bridge-vlan-aware yes` is missing or VLAN not in table → bridge config is the cause. **If bridge config matches reference → Phase 3.** ### Phase 3 — Host-Level Reachability Test (2 min) **This is the decisive test.** > **WARNING:** `ping -I vmbr1.<VLANID> <GW>` is **unreliable** when the PVE host has no IP assigned in the VLAN subnet (common). The source IP falls back to the management IP, which is outside the subnet — the gateway correctly drops the reply. This gives a false "100% loss" even when VLAN is fully trunked. Use tcpdump instead. ```bash # RELIABLE: Watch for VLAN-tagged frames on bond1 uplink (10s) # If switch is trunking VLAN, you will see STP/HSRP/ARP frames immediately timeout 10 tcpdump -i bond1 -n -e vlan <VLANID> -c 10 2>&1 # Cross-check: arping from bridge subinterface to gateway # arping uses L2 directly — not affected by IP subnet mismatch arping -I vmbr1.<VLANID> -c 3 <GATEWAY_IP> 2>&1 ``` **Interpret results:** | Result | Meaning | |--------|---------| | tcpdump sees STP/HSRP/ARP frames tagged with VLANID | Switch IS trunking VLAN — go to Phase 4 (guest OS) | | tcpdump: 0 packets captured | Switch NOT trunking VLAN on this uplink → **Phase 3b** | | arping gets reply | L2 reachable — issue is guest OS | | arping no reply + tcpdump empty | Switch not trunking VLAN → **Phase 3b** | ### Phase 3b — Switch Uplink Verification (lldpcli) **lldpcli is available on PVE nodes** — use it to identify exact switch ports and compare against working node. ```bash # Affected node — note the switch name and port for bond1's active slave lldpcli show neighbors detail # Reference node (working VLAN) # Run same command on reference node lldpcli show neighbors detail ``` Look in the output for the `bond1` primary slave interface (check `/proc/net/bonding/bond1` for active slave). Note: - **Switch hostname** (e.g., `typhlsw02a`) - **Port ID** (e.g., `Ethernet1/30`) Compare with the reference node's port. If ports differ, the switch ports may have different trunk configs. **Provide to network team:** ``` Affected node: <switch> port <port> ← needs VLAN <ID> added to trunk Reference node: <switch> port <port> ← VLAN <ID> already trunked (working) ``` Verify bond1 active slave: ```bash cat /proc/net/bonding/bond1 | grep -E "Active Slave|Slave Interface|MII Status" ``` Capture pcap proof for network team escalation: ```bash # Zero captured = VLAN not trunked on uplink timeout 30 tcpdump -i bond1 -w /tmp/vlan<ID>-bond1.pcap vlan <VLANID> # Frames here = VM is transmitting; frames absent on bond1 = bridge or switch issue timeout 30 tcpdump -i tap<VMID>i0 -w /tmp/vlan<ID>-tap.pcap ``` ### Phase 4 — Guest OS (if Phase 3 ping works) Only reach here if host-level VLAN reachability is confirmed. ```bash # Guest agent network info qm guest cmd <VMID> network-get-interfaces # ARP probe from bridge arping -I vmbr1.<VLANID> -c 5 <VM_IP> ``` - ARP response but ping fails → guest firewall blocking ICMP - No ARP response → wrong IP in guest or NIC down Check guest via console if agent unavailable. ## Decision Matrix | Finding | Root Cause | Action | |---------|-----------|--------| | VM NIC has wrong bridge or no tag | PVE VM config | `qm set <VMID> -net0 virtio,bridge=vmbr1,tag=<ID>` | | `bridge-vlan-aware` missing | PVE bridge config | Add to `/etc/network/interfaces`, `ifreload -a` | | Tap not in bridge vlan table | Bridge not updated | Restart VM | | Host-level ping/ARP fails | Switch not trunking VLAN | Network team: add VLAN to trunk on uplink port (from lldpcli) | | ARP works, ping fails | Guest firewall | Disable ICMP block in guest | | Duplicate IP | IP conflict | Assign unique IP | ## Quick Verification After Fix ```bash # Confirm VLAN frames flowing on uplink (reliable — works without host IP in subnet) timeout 5 tcpdump -i bond1 -n vlan <VLANID> -c 5 2>&1 # Confirm VM reachable (from another node or external host) ping -c 3 <VM_IP> ``` ## Mitigation — Urgent Workaround If VM is needed before root cause is resolved, migrate to a working node: ```bash qm migrate <VMID> <working-node> --online ``` ## Common Mistakes | Mistake | Reality | |---------|---------| | Checking only VM config | Bridge and switch are more likely causes | | Skipping Phase 3 host-level test | This is the decisive test — do it early | | Blaming the VM when tap traffic exists | If tap has traffic but bond1 has none, the bridge or switch is the cause | | Asking network team without port IDs | Always run `lldpcli show neighbors detail` first — it gives exact switch/port | | Forgetting to check reference node | Always compare with a working node on same VLAN | | Using `ping -I vmbr1.<VLAN>` as the reachability test | PVE hosts rarely have an IP in the VLAN subnet — ping source falls back to mgmt IP, gateway drops reply, giving false "100% loss". Use tcpdump on bond1 instead. | ## Evidence to Collect (for escalation) ```bash # All read-only — safe to run on production lldpcli show neighbors detail > /tmp/lldp-<node>.log bridge vlan show > /tmp/bridge-vlan-<node>.log qm config <VMID> > /tmp/vm-config-<VMID>.log timeout 10 tcpdump -i bond1 -n -e vlan <VLANID> -c 10 > /tmp/tcpdump-bond1-vlan<VLANID>.log 2>&1 arping -I vmbr1.<VLANID> -c 3 <GW> > /tmp/arping-gw.log 2>&1 ip neigh show > /tmp/arp.log timeout 30 tcpdump -i bond1 -w /tmp/bond1-vlan<ID>.pcap vlan <VLANID> timeout 30 tcpdump -i tap<VMID>i0 -w /tmp/tap-<VMID>.pcap ```
Pliki w paczce (2)
- README.md 2 KB
- SKILL.md 8 KB
Wersje
W bazie nie ma innych skilli o nazwie pve-vlan-trunk-troubleshooting.
Migawka bazy z 13.11.2026 · wersja paczki 7f35f976eb0c (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 2 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 95pve-admin
Administruje Proxmox VE i Proxmox Backup Server: klastry, maszyny i kontenery, pamięć ZFS, sieć, HA, kopie zapasowe i stan zdrowia. - 100proxmox
Obsługuje środowisko Proxmox VE: dostęp tokenem API do maszyn, storage i cyklu życia, SSH roota do operacji hosta, budowę golden image przez API, aktualizacje PVE 8 do 9 oraz usługi PDM i PBS. - 100troubleshoot-connectivity
Izoluje błąd łączności sieciowej warstwa po warstwie, od łącza po DNS, i wskazuje najbardziej prawdopodobną przyczynę. - 100devops-proxmox
Instaluje, obsługuje i automatyzuje Proxmox VE 9.x: klastry, HA, magazyny, sieci, kopie zapasowe i aktualizację z wersji 8 do 9. - 90github-ops
Obsługuje repozytoria GitHub przy ustaleniach sieciowych: zgłoszenia, pull requesty ze zmianami konfiguracji i wyszukiwanie adresów IP oraz VLAN. - 90proxmox
Administruje Proxmox VE: maszyny wirtualne, kontenery LXC i OCI, pamięć masową, sieć SDN, klastry, HA, kopie zapasowe i passthrough PCIe.