As shown in Figure 1, SwitchA and SwitchB are connected through an Eth-Trunk; the NMS has reachable routes to SwitchA and SwitchB; SNMP is configured on devices and NMS.
A network administrator wants to obtain Layer 2 information about SwitchA and SwitchB to know details about network topology and configuration conflicts. The LLDP function can meet the network administrator's requirement.
# Configure SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 [SwitchA] interface eth-trunk 1 [SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/1 [SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/2 [SwitchA-Eth-Trunk1] trunkport gigabitethernet 0/0/3 [SwitchA-Eth-Trunk1] port link-type trunk [SwitchA-Eth-Trunk1] port trunk allow-pass vlan 100 [SwitchA-Eth-Trunk1] quit
# Configure SwitchB.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 [SwitchB] interface eth-trunk 1 [SwitchB-Eth-Trunk1] trunkport gigabitethernet 0/0/1 [SwitchB-Eth-Trunk1] trunkport gigabitethernet 0/0/2 [SwitchB-Eth-Trunk1] trunkport gigabitethernet 0/0/3 [SwitchB-Eth-Trunk1] port link-type trunk [SwitchB-Eth-Trunk1] port trunk allow-pass vlan 100 [SwitchB-Eth-Trunk1] quit
[SwitchA] lldp enable
[SwitchB] lldp enable
Check the SwitchA configuration.
# Check whether the physical interfaces have been added to Eth-Trunk1.
[SwitchA] display eth-trunk 1 Eth-Trunk1's state information is: WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8 Operate status: up Number Of Up Port In Trunk: 3 -------------------------------------------------------------------------------- PortName Status Weight GigabitEthernet0/0/1 Up 1 GigabitEthernet0/0/2 Up 1 GigabitEthernet0/0/3 Up 1
# Check neighbor information for SwitchA.
[SwitchA] display lldp neighbor brief Local Intf Neighbor Dev Neighbor Intf Exptime(s) GE0/0/1 SwitchB GE0/0/1 115 GE0/0/2 SwitchB GE0/0/2 115 GE0/0/3 SwitchB GE0/0/3 115
Check the SwitchB configuration.
Refer to the steps for checking SwitchA.
SwitchA configuration file
# sysname SwitchA # vlan batch 100 # lldp enable # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/1 eth-trunk 1 # interface GigabitEthernet0/0/2 eth-trunk 1 # interface GigabitEthernet0/0/3 eth-trunk 1 # return
SwitchB configuration file
# sysname SwitchB # vlan batch 100 # lldp enable # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/1 eth-trunk 1 # interface GigabitEthernet0/0/2 eth-trunk 1 # interface GigabitEthernet0/0/3 eth-trunk 1 # return