Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX/QFX] Example - Retrieve MAC address with interface name for a specific VLAN using SNMP MIB in ELS

0

0

Article ID: KB32532 KB Last Updated: 30 Mar 2018Version: 1.0
Summary:

This article provides an example list of commands to retrieve the MAC address with interface name for a specific VLAN using SNMP MIB in ELS.

Solution:

Use the following list of commands:

Get the VLAN name:

root@qfxsw2# run show ethernet-switching table
 MAC flags (S - static MAC, D - dynamic MAC, L - locally learned, P - Persistent static, C - Control MAC
           SE - statistics enabled, NM - non configured MAC, R - remote PE MAC, O - ovsdb MAC)
 
Ethernet switching table : 1 entries, 1 learned
Routing instance : default-switch
    Vlan                MAC                 MAC         Age    Logical                NH        RTR
    name                address             flags              interface              Index     ID
    vlan10              88:e0:f3:72:37:01   D             -   ge-1/0/0.0             0         0

Note the internal index number of the VLAN:

{master:0}[edit]
root@qfxsw2# run show vlans vlan10 extensive
 Routing instance: default-switch
VLAN Name: vlan10                         State: Active
Tag: 10
Internal index: 4, Generation Index: 4, Origin: Static
MAC aging time: 300 seconds
Layer 3 interface: irb.10
VXLAN Enabled : No
Interfaces:
    ge-0/0/49.0*,untagged,access
    ge-1/0/0.0*,tagged,trunk
Number of interfaces: Tagged 1    , Untagged 1
Total MAC count: 1

Confirm the VLAN and index in jnxL2aldVlanTable:

root@qfxsw2# run show snmp mib walk jnxL2aldVlanTable
jnxL2aldVlanName.3 = default
jnxL2aldVlanName.4 = vlan10
jnxL2aldVlanName.5 = vlan20
jnxL2aldVlanTag.3 = 1
jnxL2aldVlanTag.4 = 10
jnxL2aldVlanTag.5 = 20
jnxL2aldVlanType.3 = 1
jnxL2aldVlanType.4 = 1
jnxL2aldVlanType.5 = 1
jnxL2aldVlanFdbId.3 = 196608
jnxL2aldVlanFdbId.4 = 262144
jnxL2aldVlanFdbId.5 = 327680

 Get the filtering database for index 4:

{master:0}[edit]
root@qfxsw2# run show snmp mib walk jnxL2aldVlanFdbId
jnxL2aldVlanFdbId.3 = 196608
jnxL2aldVlanFdbId.4 = 262144
jnxL2aldVlanFdbId.5 = 327680

 Get the MAC addresses for the filtering database:

{master:0}[edit]
root@qfxsw2#  run show snmp mib walk dot1qTpFdbPort.262144
dot1qTpFdbPort.262144.136.224.243.114.55.1 = 1011

=> The address 136.224.243.114.55.1 (decimal) is equal to 88:E0:F3:72:37:01 (hex).

 
Find the interface index:

{master:0}[edit]
root@qfxsw2# run show snmp mib walk dot1dBasePortIfIndex | match "1011"
dot1dBasePortIfIndex.1011 = 530

Get the interface name:

{master:0}[edit]
root@qfxsw2# run show snmp mib walk ifDescr | grep "530"
ifDescr.530   = ge-1/0/0
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search