The ping mac command monitors connectivity of the links between a source device and a destination device. This mechanism is called GMAC ping.
ping mac mac-address vlan vlan-id [ interface { interface-name | interface-type interface-number } | -c count | -s packetsize | -t timeout | -p priority-value ] *
ping mac mac-address { vsi vsi-name | l2vc l2vc-id { raw | tagged } } [ interface { interface-name | interface-type interface-number } | { pe-vid pe-vid-value ce-vid ce-vid-value | dot1q-vlan dot1q-vlan-value } | -c count | -s packetsize | -t timeout | -p priority-value ] *
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. |
- |
-c count |
Specifies the number of times that a ping can be performed. |
The value is an integer ranging from 1 to 4294967295. The default value is 5. |
-s packetsize |
Specifies the size of a ping message to be sent. |
The value is an integer ranging from 95 to 9000, in bytes. The default value is 95 bytes. The value indicates the size of the message with the layer 2 frame header removed. |
-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. |
-p priority-value |
Specifies a priority value for ping messages. |
The value is an integer that ranges from 0 to 7 . The default value is 7. |
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-value |
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-value |
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 dot1q-vlan-value |
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 ping enabled, the source device does not need to be a MEP, and the destination device does not need to be a MEP or MIP. In other words, on the source, intermediate, or destination device, an MD, MA, or MEP is not configured to implement GMAC ping. The only requirement is to specify the VLAN on which the destination node resides.
If devices between PEs are interconnected through a L2VPN,Prerequisites
The GMAC ping function has been enabled using the ping mac enable command.
Precautions
The two devices must be enabled with 802.1ag of the same version.
<HUAWEI> system-view [~HUAWEI] ping mac enable [*HUAWEI] commit [~HUAWEI] ping mac 00e0-fc12-3456 l2vc 1 raw -c 2 -s 112 Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Packets: Sent = 2, Received = 2, loss = 0 (0.00% loss) Minimum = 1ms, Maximum = 1ms, Average = 1ms
<HUAWEI> system-view [~HUAWEI] ping mac enable [*HUAWEI] commit [~HUAWEI] ping mac 00e0-fc12-3456 vsi vsi1 -c 2 -s 112 Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Packets: Sent = 2, Received = 2, loss = 0 (0.00% loss) Minimum = 1ms, Maximum = 1ms, Average = 1ms
<HUAWEI> system-view [~HUAWEI] ping mac enable [*HUAWEI] commit [~HUAWEI] ping mac 00e0-fc12-3456 vlan 10 -c 2 -s 112 Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Reply from 00e0-fc12-3456: bytes = 112 time < 1ms Packets: Sent = 2, Received = 2, loss = 0 (0.00% loss) Minimum = 1ms, Maximum = 1ms, Average = 1ms
Item | Description |
---|---|
Reply from 00e0-fc12-3456: bytes = 112 time < 1msReply from 00e0-fc12-3456: bytes = 112 time < 1ms | Size and round trip time (RTT) of a reply message sent by the destination device. If the RTT value is less than 1 ms, "time < 1ms" is displayed. |
Packets: Sent = 2, Received = 2, loss = 0 (0.00% loss) | Number of ping request messages, number of ping response messages, number of discarded ping messages, and percentage of the discarded ping messages. |
Minimum | Minimum RTT. |
Maximum | Maximum RTT. |
Average | Average RTT. |