MAC Trace
Overview
MAC Trace function shows L2 path trace based on MAC address, which is similar to the IP layer Traceroute. It is used to detect the Ethernet link connection fault, providing an effective method for Ethernet fault detection and location.
The device determines the path by using the MAC address tables of the switches in the path.
The packets are based on CFM (IEEE802.1ag), CFM is a connection checking mechanism that uses its own Ethernet frames (its Ethernet type is 0x8902 and has its own MAC address) to verify the operational status of the service instance.
The TTL (time to live) value is 64, which specifies the lifetime of the packet and sets the maximum number of hops that the packet will go through.
NOTEs:
- To make MAC trace function work, you need to enable MAC trace function on both ends of the link under test and the intermediate devices; only after this, the devices can reply to the received MAC trace messages.
- MAC trace function supports only unicast destination MAC addresses.
Configuring MAC Trace
Step 1Â Â Â Â Â Enable MAC trace function.
Enable MAC trace function on both ends of the link under test and on intermediate devices.
set tracemac disable <true | false>
By default, the MAC Trace function is disabled.
Only when the MAC Trace function is enabled, MAC Trace operation can be performed on the device; the device can reply to the received MAC Trace messages.
Step 2Â Â Â Â Â Commit the configuration.
commit
Step 3Â Â Â Â Â Perform MAC Trace detection.
Perform MAC Trace on any end of the link under test to locate the connectivity failures between the device and the destination device.
run tracemac destination <mac-address> vlan <vlan-id>
Configuration Example
Networking Requirements
Figure 1. MAC Trace Configuration Example
As shown in Figure 1, Department A (belonging to VLAN 100, 200, 300) and Department B (belonging to VLAN 100) of a company are connected by multiple switches. This example uses command run tracemac destination <mac-address> vlan <vlan-id> to check the connectivity between the current device and the destination device, which is called a MAC Trace.
Procedure
Switch A
Step 1Â Â Â Â Â Configure VLAN and port mode.
admin@SwitchA# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 100 admin@SwitchA# set interface gigabit-ethernet te-1/1/1 family ethernet-switching port-mode trunk admin@SwitchA# set interface gigabit-ethernet te-1/1/1 family ethernet-switching vlan members 200, 300 admin@SwitchA# set interface gigabit-ethernet te-1/1/3 family ethernet-switching native-vlan-id 100 admin@SwitchA# set interface gigabit-ethernet te-1/1/3 family ethernet-switching port-mode trunk admin@SwitchA# set interface gigabit-ethernet te-1/1/3 family ethernet-switching vlan members 200, 300
Step 2     Enable MAC trace function.   Â
admin@SwitchA# set tracemac disable false
Step 3Â Â Â Â Â Commit the configurations.
admin@SwitchA# commit
Switch B
Step 1Â Â Â Â Â Configure VLAN and port mode.
admin@SwitchB# set interface gigabit-ethernet te-1/1/5 family ethernet-switching native-vlan-id 100 admin@SwitchB# set interface gigabit-ethernet te-1/1/5 family ethernet-switching port-mode trunk admin@SwitchB# set interface gigabit-ethernet te-1/1/5 family ethernet-switching vlan members 200, 300 admin@SwitchB# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching native-vlan-id 100 admin@SwitchB# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching port-mode trunk admin@SwitchB# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching vlan members 200, 300
Step 2     Enable MAC trace function.        Â
admin@SwitchB# set tracemac disable false
Step 3Â Â Â Â Â Commit the configurations.
admin@SwitchB# commit
Switch C
Step 1Â Â Â Â Â Configure VLAN and port mode.
admin@SwitchC# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching native-vlan-id 100 admin@SwitchC# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching port-mode trunk admin@SwitchC# set interface gigabit-ethernet xe-1/1/1 family ethernet-switching vlan members 200, 300 admin@SwitchC# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 100
Step 2     Enable MAC trace function.        Â
admin@SwitchC# set tracemac disable false
Step 3Â Â Â Â Â Commit the configurations.
admin@SwitchC# commit
Verification
- Run command run show mac-address table to check the MAC address table.
- On Switch A:
Â
- On Switch B:
- On Switch C:
- On Switch C, trace MAC destination device with MAC address 20:11:11:11:11:11:11 and belonging to VLAN 100.
admin@SwitchC# run tracemac destination 22:11:11:11:11:11 vlan 100 Hop  Hostname   Ingress port  Ingress mac      Egress port  Egress mac ---- ----------- --------------  ------------       ------------  ------------ 1    SwitchB      xe-1/1/1      70:72:cf:b7:65:45 te-1/1/5   70:72:cf:b7:65:45 2    SwitchA      te-1/1/3      04:f8:f8:20:6c:7b te-1/1/1   04:f8:f8:20:6c:7b
Copyright © 2024 Pica8 Inc. All Rights Reserved.