Got it

how to query Information About a VLAN and Interfaces in the VLAN

Latest reply: Jul 22, 2018 11:35:38 731 3 0 1

hwL2VlanMIBTable describes created VLAN information on the device, including the VLAN description and information about interfaces in VLANs.

You can query information about all interfaces added to a VLAN in tagged and untagged modes through hwL2VlanPortList, excluding the Eth-Trunk.

Table 1 Description of MIB objects

Object

Description

OID

hwL2VlanPortList

This object indicates information about the interfaces that join VLANs in tagged and untagged modes.

1.3.6.1.4.1.2011.5.25.42.3.1.1.1.1.3

To query information about the interfaces that join a VLAN, perform the following steps:

  1. As shown in Figure 1, select hwL2VlanPortList and perform the Walk operation to query information about all created VLANs and interfaces that join the VLANs.

    The query result in red box is used as an example:
    Figure 1 Querying information about interfaces in the VLAN 
    fig_dc_mib_vlan_example_000501.png
  • In the first column, the value 2 in hwL2VlanPortList.2 (octet string) indicates information about all interfaces in VLAN 2.

  • In the second column, 00.00.C0 is a set of indexes of interfaces in VLAN 2, which is displayed in hexadecimal notation. The value is converted into 00000000 00000000 11000000 in binary notation. he index starts from 0 in ascending order. The value 1 indicates that the corresponding interface joins VLAN 2. The query result indicates that interfaces 16 and 17 join VLAN 2.

    Query the mapping between interface names and interface indexes.

    hwL2IfTable describes information about Layer 2 interfaces. You can query the mapping between interface names and interface indexes through hwL2IfPortName.
    Table 2 Description of MIB objects

    Object

    Description

    OID

    hwL2IfPortName

    This object indicates the interface name corresponding to the Layer 2 interface index.

    1.3.6.1.4.1.2011.5.25.42.1.1.1.3.1.19

    As shown in Figure 2, select hwL2IfPortName and perform the Walk operation to query the interface names corresponding to all Layer 2 interface indexes on the device.

    The query result in red box is used as an example:

    hwL2IfPortName.16 (octet string) GigabitEthernet0/0/14 indicates that interface with index 16 corresponds to GigabitEthernet0/0/14, that is, GigabitEthernet0/0/14 joins VLAN 2.

    hwL2IfPortName.17 (octet string) GigabitEthernet0/0/15 indicates that interface with index 17 corresponds to GigabitEthernet0/0/15, that is, GigabitEthernet0/0/15 joins VLAN 2.

    Figure 2 Querying interface names 
    fig_dc_mib_vlan_example_000502xs.png

    This is what I want to talk about/share with you today, thank you!
  • x
  • convention:

TTTony
Created Jul 15, 2018 15:10:57 Helpful(0) Helpful(0)

how to check port index and ifindex?
View more
  • x
  • convention:

StarOfWest
Created Jul 16, 2018 06:48:36 Helpful(0) Helpful(0)

Hey Tony, check this KB1000442120.
View more
  • x
  • convention:

“We only get answers to the questions that we ask.” physicist Werner Heisenberg
FigoLiu
Created Jul 22, 2018 11:35:38 Helpful(0) Helpful(0)

[HUAWEI-diagnose] display ifnet ifnet gigabitethernet 4/0/6
Interface GigabitEthernet1/4/0/6, Address 0x108e6868, sizeof ifnet 972, Non-zer o value:
Interface index: 0x125
Interface top index: 0x125
Interface network index: 0x125
Interface trunk id: 0xffffffff
Interface L2/L3 flag: 0x1
Interface L2 port index: 0x84
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."

My Followers

Login and enjoy all the member benefits

Login

Huawei Enterprise Support Community
Huawei Enterprise Support Community
Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.