LLDP neighbor and port VLAN over SNMP: lldpRemTable and dot1qPvid

· Vladimir Chemeris, the developer of SNMP Inspector

Before you move a cable, you want two answers about the port: what sits at the far end, and which VLAN the port gives untagged traffic. LLDP-MIB holds the first and Q-BRIDGE-MIB the second. Each MIB numbers ports its own way, so each answer takes one more lookup to reach a port name.

The developer recorded the output on 2026-11-22 with net-snmp 5.6.2.1 from /usr/bin on a Mac. The LLDP examples come from a MikroTik CHR on RouterOS 7.25.1 with one neighbor (192.0.2.104) and from a Proxmox VE host where net-snmp snmpd serves lldpd data on four neighbors (192.0.2.12). The VLAN examples come from a MikroTik RB4011 router on RouterOS 7.25.1 (192.0.2.1).

This net-snmp has no LLDP-MIB or Q-BRIDGE-MIB files and prints those objects as numbers; the tables below name the columns. In the output, addresses read 192.0.2.x, MAC addresses 00:00:5E:00:53:xx, host names are stand-ins, and <community> hides the community string. The compatibility page lists what SNMP Inspector read from these devices.

lldpRemTable: the neighbor on a port

The CHR heard one neighbor. A walk of lldpRemTable returns its row:

$ snmpwalk -v2c -c <community> 192.0.2.104 1.0.8802.1.1.2.1.4.1
iso.0.8802.1.1.2.1.4.1.1.4.0.1.2 = INTEGER: 4
iso.0.8802.1.1.2.1.4.1.1.5.0.1.2 = STRING: "00:00:5E:00:53:01"
iso.0.8802.1.1.2.1.4.1.1.6.0.1.2 = INTEGER: 3
iso.0.8802.1.1.2.1.4.1.1.7.0.1.2 = STRING: "00:00:5E:00:53:02"
iso.0.8802.1.1.2.1.4.1.1.8.0.1.2 = STRING: "tap101i0"
iso.0.8802.1.1.2.1.4.1.1.9.0.1.2 = STRING: "pve-lab"
iso.0.8802.1.1.2.1.4.1.1.10.0.1.2 = STRING: "Debian GNU/Linux 13 (trixie) Linux 7.0.14-30-pve #1 SMP PREEMPT_DYNAMIC PMX 7.0.14-30 (2026-11-16T21:55Z) x86_64"
iso.0.8802.1.1.2.1.4.1.1.11.0.1.2 = STRING: "9"
iso.0.8802.1.1.2.1.4.1.1.12.0.1.2 = STRING: "0"

The number after 1.4.1.1. names the column, and the last three numbers form the row index: lldpRemTimeMark 0, lldpRemLocalPortNum 1 and lldpRemIndex 2.

Column Object Value on the CHR
4 lldpRemChassisIdSubtype 4, macAddress
5 lldpRemChassisId the neighbor’s chassis MAC
6 lldpRemPortIdSubtype 3, macAddress
7 lldpRemPortId the MAC of the neighbor’s port
8 lldpRemPortDesc tap101i0
9 lldpRemSysName pve-lab
10 lldpRemSysDesc the neighbor’s OS and kernel
11, 12 lldpRemSysCapSupported, lldpRemSysCapEnabled capability bit maps

The CHR runs as a VM on that host, behind the host’s tap101i0. lldpd sends a MAC as the port ID (subtype 3) and the interface name as the description, so read the name from column 8.

RouterOS 7.25.1 returns a MAC-type ID as 17 characters of text; LLDP-MIB encodes it as 6 bytes, which lldpd returns as a Hex-STRING. Write your parser for both. Columns 11 and 12 hold bit maps, which net-snmp printed as text: “9” and “0” are the bytes 0x39 and 0x30. Add -Ox for hex.

lldpRemManAddr sits in the index

$ snmpwalk -v2c -c <community> 192.0.2.104 1.0.8802.1.1.2.1.4.2
iso.0.8802.1.1.2.1.4.2.1.3.0.1.2.1.4.192.0.2.12 = INTEGER: 2
iso.0.8802.1.1.2.1.4.2.1.4.0.1.2.1.4.192.0.2.12 = INTEGER: 6
iso.0.8802.1.1.2.1.4.2.1.5.0.1.2.1.4.192.0.2.12 = OID: SNMPv2-SMI::zeroDotZero

No column returns the address. LLDP-MIB marks lldpRemManAddr not-accessible and puts it in the row index after the neighbor row 0.1.2: 1 for IPv4, 4 for the length, then 192.0.2.12. Column 3, lldpRemManAddrIfSubtype, reads 2 for ifIndex, and column 4, lldpRemManAddrIfId, reads 6: the neighbor holds the address on its interface 6, vmbr0 on the Proxmox host. An IPv6 address adds a row with type 2 and length 16.

lldpRemLocalPortNum to ifIndex through lldpLocPortTable

The neighbor row names local port 1. Look it up in lldpLocPortTable:

$ snmpwalk -v2c -c <community> 192.0.2.104 1.0.8802.1.1.2.1.3.7
iso.0.8802.1.1.2.1.3.7.1.2.1 = INTEGER: 5
iso.0.8802.1.1.2.1.3.7.1.3.1 = STRING: "ether1"
iso.0.8802.1.1.2.1.3.7.1.4.1 = STRING: "ether1"

$ snmpget -v2c -c <community> 192.0.2.104 ifName.1 ifOperStatus.1
IF-MIB::ifName.1 = STRING: ether1
IF-MIB::ifOperStatus.1 = INTEGER: up(1)

Row 1 has lldpLocPortIdSubtype 5, interfaceName, and lldpLocPortId ether1, the same as ifName.1. The CHR’s ether1 faces tap101i0 on pve-lab.

On the CHR the LLDP port number equals the ifIndex. Don’t count on it: LLDP-MIB sets no fixed link between the two and expects a bridge to use its dot1dBasePort numbers. RouterOS 7.25.1 on the RB4011, a bridge, numbers LLDP ports by ifIndex:

$ snmpwalk -v2c -c <community> 192.0.2.1 1.0.8802.1.1.2.1.3.7.1.3
iso.0.8802.1.1.2.1.3.7.1.3.4 = STRING: "ether4"
iso.0.8802.1.1.2.1.3.7.1.3.7 = STRING: "ether7"
iso.0.8802.1.1.2.1.3.7.1.3.10 = STRING: "ether10"
iso.0.8802.1.1.2.1.3.7.1.3.11 = STRING: "sfp-sfpplus1"

LLDP port 7 is ether7, ifIndex 7, and BRIDGE-MIB lists the same port as bridge port 6 (see the bridge port section). Match the port ID by its subtype: an interface name against ifName, an alias against ifAlias, a MAC against ifPhysAddress. The RB4011’s lldpRemTable is empty:

$ snmpwalk -v2c -c <community> 192.0.2.1 1.0.8802.1.1.2.1.4.1
iso.0.8802.1.1.2.1.4.1 = No Such Object available on this agent at this OID

snmpwalk prints this line for an empty table and for a missing one. lldpLocPortTable answered on the same router, so the agent supports LLDP-MIB and heard no neighbor.

Four neighbors on a Proxmox host

On the Proxmox host, net-snmp serves the tables that lldpd fills:

$ snmpwalk -v2c -c <community> 192.0.2.12 1.0.8802.1.1.2.1.4.1.1.9
iso.0.8802.1.1.2.1.4.1.1.9.1100.9.1 = STRING: "pve-lab"
iso.0.8802.1.1.2.1.4.1.1.9.1100.10.1 = STRING: "pve-lab"
iso.0.8802.1.1.2.1.4.1.1.9.2700.12.2 = STRING: "chr-lab"
iso.0.8802.1.1.2.1.4.1.1.9.3400.15.3 = STRING: "chr-lab-2"

$ snmpwalk -v2c -c <community> 192.0.2.12 1.0.8802.1.1.2.1.4.1.1.7
iso.0.8802.1.1.2.1.4.1.1.7.1100.9.1 = Hex-STRING: 00 00 5E 00 53 04 
iso.0.8802.1.1.2.1.4.1.1.7.1100.10.1 = Hex-STRING: 00 00 5E 00 53 05 
iso.0.8802.1.1.2.1.4.1.1.7.2700.12.2 = STRING: "ether1"
iso.0.8802.1.1.2.1.4.1.1.7.3400.15.3 = STRING: "ether1"

$ snmpget -v2c -c <community> 192.0.2.12 1.0.8802.1.1.2.1.3.7.1.2.12 1.0.8802.1.1.2.1.3.7.1.4.12 1.0.8802.1.1.2.1.3.7.1.4.15 ifName.12 ifName.15
iso.0.8802.1.1.2.1.3.7.1.2.12 = INTEGER: 3
iso.0.8802.1.1.2.1.3.7.1.4.12 = STRING: "tap101i0"
iso.0.8802.1.1.2.1.3.7.1.4.15 = STRING: "tap105i0"
IF-MIB::ifName.12 = STRING: tap101i0
IF-MIB::ifName.15 = STRING: tap105i0

The first index number, lldpRemTimeMark, differs per row: 1100, 2700, 3400. It follows the TimeFilter convention from RMON2-MIB and carries no port information, so walk the columns instead of building a row OID by hand. lldpd sends a MAC as the local port ID (subtype 3), so match lldpLocPortDesc against ifName.

Local port Port name lldpRemSysName lldpRemPortId
12 tap101i0 chr-lab ether1
15 tap105i0 chr-lab-2 ether1
9 fwpr108p0 pve-lab a MAC
10 fwln108i0 pve-lab a MAC

chr-lab is the CHR from the first section. The last two rows show the host as its own neighbor: Proxmox joins fwpr108p0 and fwln108i0 as a veth pair when a VM has the firewall on, and lldpd hears itself across the pair. Drop rows whose lldpRemChassisId matches the agent’s own lldpLocChassisId.

dot1qPvid: the VLAN of untagged frames

The RB4011 serves 10 rows of dot1qPvid from dot1qPortVlanTable in Q-BRIDGE-MIB:

$ snmpwalk -v2c -c <community> 192.0.2.1 1.3.6.1.2.1.17.7.1.4.5.1.1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.3 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.4 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.5 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.6 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.7 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.8 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.9 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.10 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.12 = Gauge32: 1
SNMPv2-SMI::mib-2.17.7.1.4.5.1.1.13 = Gauge32: 1

RFC 4363 defines dot1qPvid as “the VLAN-ID assigned to untagged frames or Priority-Tagged frames received on this port”. All ten rows read 1: an untagged frame that enters any of these ports joins VLAN 1.

The table entry says “This is indexed by dot1dBasePort”, so the numbers 3 to 13 at the end of each line count bridge ports.

dot1dBasePortIfIndex: bridge port to ifIndex

BRIDGE-MIB maps bridge ports to ifIndex. net-snmp 5.6.2.1 on the Mac has the BRIDGE-MIB file and doesn’t load it by default, hence -m +BRIDGE-MIB:

$ snmpwalk -m +BRIDGE-MIB -v2c -c <community> 192.0.2.1 dot1dBasePortIfIndex
BRIDGE-MIB::dot1dBasePortIfIndex.3 = INTEGER: 4
BRIDGE-MIB::dot1dBasePortIfIndex.4 = INTEGER: 5
BRIDGE-MIB::dot1dBasePortIfIndex.5 = INTEGER: 6
BRIDGE-MIB::dot1dBasePortIfIndex.6 = INTEGER: 7
BRIDGE-MIB::dot1dBasePortIfIndex.7 = INTEGER: 8
BRIDGE-MIB::dot1dBasePortIfIndex.8 = INTEGER: 9
BRIDGE-MIB::dot1dBasePortIfIndex.9 = INTEGER: 10
BRIDGE-MIB::dot1dBasePortIfIndex.10 = INTEGER: 11
BRIDGE-MIB::dot1dBasePortIfIndex.12 = INTEGER: 15
BRIDGE-MIB::dot1dBasePortIfIndex.13 = INTEGER: 23

$ snmpget -v2c -c <community> 192.0.2.1 ifName.7 ifName.11 ifName.15
IF-MIB::ifName.7 = STRING: ether7
IF-MIB::ifName.11 = STRING: sfp-sfpplus1
IF-MIB::ifName.15 = STRING: bonding1

Bridge port 6 is ifIndex 7, ether7, so the PVID of ether7 sits on the dot1qPvid line ending in 6. Bridge port 12 is the bond, ifIndex 15. A script that reads the bridge port as an ifIndex puts each VLAN one port off. The CHR and the Proxmox host answered No Such Object for both tables.

Tagged VLANs: dot1qVlanStaticTable and dot1qVlanCurrentTable

Tagged membership lives in two more Q-BRIDGE-MIB tables, and RouterOS 7.25.1 on the RB4011 serves neither:

$ snmpwalk -v2c -c <community> 192.0.2.1 1.3.6.1.2.1.17.7.1.4.2
SNMPv2-SMI::mib-2.17.7.1.4.2 = No Such Object available on this agent at this OID

$ snmpwalk -v2c -c <community> 192.0.2.1 1.3.6.1.2.1.17.7.1.4.3
SNMPv2-SMI::mib-2.17.7.1.4.3 = No Such Object available on this agent at this OID

On this router the tagged VLANs of a port stay unknown over SNMP. RFC 4363 describes the two tables:

  • dot1qVlanStaticTable, indexed by VLAN ID: the configured VLANs, with dot1qVlanStaticEgressPorts and dot1qVlanStaticUntaggedPorts.
  • dot1qVlanCurrentTable, indexed by dot1qVlanTimeMark and VLAN ID: the VLANs in effect now, GVRP ones included, with dot1qVlanCurrentEgressPorts and dot1qVlanCurrentUntaggedPorts.

Both port sets use the PortList type, one bit per bridge port. The most significant bit of the first octet stands for port 1, so an egress list that starts with 0x60, binary 0110 0000, holds bridge ports 2 and 3. A port in the egress set and outside the untagged set carries the VLAN tagged.

PoE: pethPsePortTable

POWER-ETHERNET-MIB (RFC 3621) keeps per-port PoE state in pethPsePortTable, 1.3.6.1.2.1.105.1.1, indexed by a group number and a port number that RFC 3621 doesn’t tie to ifIndex. The lab has no PoE switch, and this post didn’t check the table on any device.

Checklist: neighbor and VLAN of one port

  1. Walk lldpRemTable. Walk 1.0.8802.1.1.2.1.4.1. Column 9 is lldpRemSysName, column 7 lldpRemPortId, column 8 lldpRemPortDesc. The second number of the row index is lldpRemLocalPortNum.
  2. Map the local port. Walk lldpLocPortTable, 1.0.8802.1.1.2.1.3.7, and find the row with that number. Match its lldpLocPortId or lldpLocPortDesc to ifName to get the ifIndex.
  3. Read the management address. Walk lldpRemManAddrTable, 1.0.8802.1.1.2.1.4.2, and read the address from the end of the row index.
  4. Read the PVID. Walk dot1qPvid, 1.3.6.1.2.1.17.7.1.4.5.1.1. The last number of each line is a bridge port.
  5. Map the bridge port. Walk dot1dBasePortIfIndex, 1.3.6.1.2.1.17.1.4.1.2, to turn the bridge port into an ifIndex, then GET ifName for that index.

OID and command table

In the commands, $A stands for -v2c -c <community> 192.0.2.1.

You want Object and OID Command
Neighbor rows lldpRemTable 1.0.8802.1.1.2.1.4.1 snmpwalk $A 1.0.8802.1.1.2.1.4.1
Neighbor name lldpRemSysName, column 9 snmpwalk $A 1.0.8802.1.1.2.1.4.1.1.9
Neighbor port lldpRemPortId and lldpRemPortDesc, columns 7 and 8 snmpwalk $A 1.0.8802.1.1.2.1.4.1.1.7
Neighbor address lldpRemManAddrTable 1.0.8802.1.1.2.1.4.2 snmpwalk $A 1.0.8802.1.1.2.1.4.2
Local LLDP ports lldpLocPortTable 1.0.8802.1.1.2.1.3.7 snmpwalk $A 1.0.8802.1.1.2.1.3.7
Port VLAN dot1qPvid 1.3.6.1.2.1.17.7.1.4.5.1.1 snmpwalk $A 1.3.6.1.2.1.17.7.1.4.5.1.1
Bridge port to ifIndex dot1dBasePortIfIndex 1.3.6.1.2.1.17.1.4.1.2 snmpwalk -m +BRIDGE-MIB $A dot1dBasePortIfIndex
Configured VLANs dot1qVlanStaticTable 1.3.6.1.2.1.17.7.1.4.3 snmpwalk $A 1.3.6.1.2.1.17.7.1.4.3
VLANs in effect dot1qVlanCurrentTable 1.3.6.1.2.1.17.7.1.4.2 snmpwalk $A 1.3.6.1.2.1.17.7.1.4.2
PoE per port, not checked here pethPsePortTable 1.3.6.1.2.1.105.1.1 snmpwalk $A 1.3.6.1.2.1.105.1.1

Neighbor and VLAN in SNMP Inspector

SNMP Inspector reads these tables and does the mapping when you open a port on iPhone or iPad. The port card shows the VLAN in the “PVID” and “Untagged · tagged” rows, the LLDP neighbor under “Neighbor and power” or “No neighbor reported”, and the learned MAC addresses under “Connected devices”. The app maps an LLDP local port by its port ID type and doesn’t assume the number equals the ifIndex. If the agent has no Q-BRIDGE-MIB, the card says “Unknown: no Q-BRIDGE-MIB” in place of a VLAN.

Find MAC/IP lists each step from the bridge port or the LLDP local port to the ifIndex and the port name. For the same lookup by hand, see find which switch port a device is connected to. The app has no SET operation and never writes to the device.

Questions

How do I find the LLDP neighbor of a switch port with SNMP?

Walk lldpRemTable, 1.0.8802.1.1.2.1.4.1. Column 9 holds lldpRemSysName, column 7 lldpRemPortId and column 8 lldpRemPortDesc. The second number of the row index is lldpRemLocalPortNum, your port's row in lldpLocPortTable.

Is lldpRemLocalPortNum the same as ifIndex?

LLDP-MIB sets no fixed link between its port numbers and ifIndex, and on a bridge it expects the dot1dBasePort number. RouterOS 7.25.1 and lldpd used the ifIndex in this test. Match the port ID in lldpLocPortTable to ifName and don't rely on the number.

Where is lldpRemManAddr in the snmpwalk output?

In the row index. LLDP-MIB marks lldpRemManAddr not-accessible, so no column returns it. In lldpRemManAddrTable the index ends with the address type, its length and the address: 1.4.192.0.2.12 means IPv4, 4 bytes, 192.0.2.12.

How do I get the VLAN of a switch port with SNMP?

Walk dot1qPvid, 1.3.6.1.2.1.17.7.1.4.5.1.1, for the VLAN of untagged frames on each port. Its index is a bridge port, so map it with dot1dBasePortIfIndex. Tagged membership sits in dot1qVlanStaticTable and dot1qVlanCurrentTable, if the agent serves them.

Why is lldpRemTable empty?

Either the agent heard no LLDP frames, or it doesn't serve LLDP-MIB. snmpwalk prints No Such Object in both cases. If lldpLocPortTable answers, the agent supports LLDP-MIB and saw no neighbor on its ports.