The trace mac command locates faults in the links between a source device and a destination device. This mechanism is called GMAC trace.
trace mac mac-address vlan vlan-id [ interface { interface-name | interface-type interface-number } | -t timeout | -h ] *
trace mac mac-address { vsi vsi-name | l2vc l2vc-id { raw | tagged } } [ interface { interface-name | interface-type interface-number } | { [ pe-vid pe-vid ce-vid ce-vid ] | [ dot1q-vlan vlan-id ] } | -t timeout | -h ] *
Parameter | Description | Value |
---|---|---|
mac-address |
Specifies the bridge MAC address of a destination device. |
The value is a 12-digit hexadecimal number, in the format of H-H-H. Each H is 4 digits. If an H contains fewer than 4 digits, the left-most digits are padded with zeros. For example, e0 is displayed as 00e0. It cannot be a broadcast or multicast MAC address. |
vlan vlan-id |
Specifies a VLAN ID. |
The value is an integer that ranges from 1 to 4094 . |
interface interface-name |
Specifies the interface name of an outbound interface for sending a ping message. |
- |
interface-type |
Specifies the interface type of an outbound interface for sending a ping message. |
- |
interface-number |
Specifies the interface number of an outbound interface for sending a ping message. |
- |
-t timeout |
Specifies the timeout period during which the device waits for a reply. |
The value is an integer ranging from 1 to 65535, in milliseconds. The default value is 2000 ms. |
-h |
Specifies to display the host name and IP address of each hop. |
- |
vsi vsi-name |
Specifies the name of a virtual switch instance (VSI). |
The value is a string of 1 to 31 characters. |
l2vc l2vc-id |
Specifies the ID of a Layer 2 virtual circuit. |
The value is an integer ranging from 1 to 4294967295. |
raw |
Specifies that the VLAN tag is stripped. |
- |
tagged |
Specifies that the VLAN tag is attached. |
- |
pe-vid pe-vid |
Specifies the ID of the VLAN to which the PE belongs. This is the value of the outer VLAN tag. |
The value is an integer that ranges from 1 to 4094 . |
ce-vid ce-vid |
Specifies the ID of the VLAN to which the CE belongs. This is the value of the inner VLAN tag. |
The value is an integer that ranges from 1 to 4094 . |
dot1q-vlan vlan-id |
Specifies the VLAN ID carried by the packet. |
The value is an integer that ranges from 1 to 4094 . |
Usage Scenario
On a network with GMAC trace enabled, the source device does not need to be a MEP, and the intermediate or destination device does not need to be a MEP or MIP. In other words, GMAC trace can be implemented without the need to configure an MD, MA, or a MEP on the source, intermediate, or destination device. The only requirement is to enable all intermediate devices to reply with LTRs.
If devices between PEs are interconnected through a L2VPN,Prerequisites
The GMAC ping function has been enabled using the trace mac enable command.
Precautions
The two devices must be enabled with 802.1ag of the same version.
<HUAWEI> system-view [~HUAWEI] trace mac enable [*HUAWEI] commit [~HUAWEI] trace mac 00e0-fc12-3458 l2vc 1 raw Tracing the route to 00e0-fc12-3458 over a maximum of 255 hops: Hops Host Name (IP Address) Mac Ingress Ingress Action Relay Action Forwarded Egress Egress Action 1 HUAWEIA (10.10.10.16) 00e0-fc22-3459 GigabitEthernet0/1/9 IngOK RlyFDB Forwarded GigabitEthernet0/1/1.1 EgrOK 2 HUAWEIB (10.10.10.13) 00e0-fc12-3458 GigabitEthernet0/1/17 IngOK RlyHit Not Forwarded Info: Succeeded in tracing the destination address 00e0-fc12-3458.
<HUAWEI> system-view [~HUAWEI] trace mac enable [*HUAWEI] commit [~HUAWEI] trace mac 00e0-fc12-3458 vsi vsi1 -h Tracing the route to 00e0-fc12-3458 over a maximum of 255 hops: Hops Host Name (IP Address) Mac Ingress Ingress Action Relay Action Forwarded Egress Egress Action 1 HUAWEIA (10.10.10.16) 00e0-fc22-3459 GigabitEthernet0/1/9 IngOK RlyFDB Forwarded GigabitEthernet0/1/1.1 EgrOK 2 HUAWEIB (10.10.10.13) 00e0-fc12-3458 GigabitEthernet0/1/17 IngOK RlyHit Not Forwarded Info: Succeeded in tracing the destination address 00e0-fc12-3458.
<HUAWEI> system-view [~HUAWEI] trace mac enable [*HUAWEI] commit [~HUAWEI] trace mac 00e0-fc23-3459 vlan 2 Tracing the route to 00e0-fc23-3459 over a maximum of 255 hops: ------------------------------------------------------------------------------- Hops Mac Ingress Ingress Action Relay Action Forwarded Egress Egress Action -------------------------------------------------------------------------------- 1 00e0-fc12-3459 GigabitEthernet0/1/9 IngOK RlyFDB Forwarded GigabitEthernet0/1/1 EgrOK 2 00e0-fc12-3457 GigabitEthernet0/1/1 IngOK RlyFDB Forwarded GigabitEthernet0/1/0 EgrOk 3 00e0-fc23-3459 GigabitEthernet0/1/0 IngOK RlyHit Not Forwarded Info: Succeed in tracing the destination address 00e0-fc23-3459.
Item | Description |
---|---|
Hops | Number of hops. |
Mac | Bridge MAC address of the device on which the intermediate node or destination node resides. |
Ingress | Name of an inbound interface for receiving the trace message on the intermediate node or destination node. In an L2VPN scenario, when the destination of GMAC trace is the MAC address of the device, Ingress Port is the name of the interface where the PW resides and Ingress Mac is the MAC address of the device. |
Ingress Action | Whether the trace message is forwarded by the inbound interface successfully.
|
Relay Action | Local device's response to a trace message:
|
Forwarded | Whether the trace message can be forwarded to a next-hop device:
On a link that traverses devices A, B, and C in sequence, if device A sends a trace message to device C, the egress on device B will be displayed and Forwarded will be displayed as the value of this parameter. |
Egress | Name of an outbound interface for forwarding the trace message on an intermediate node. |
Egress Action | Whether the trace message is forwarded by the outbound interface successfully:
|