Manual:Tools/Ping

From MikroTik Wiki
Jump to: navigation, search
Version.png

Applies to RouterOS: v3, v4, v5 +

Summary

Ping uses Internet Control Message Protocol (ICMP) Echo messages to determine if a remote host is active or inactive and to determine the round-trip delay when communicating with it. Ping tool sends ICMP (type 8) message to the host and waits for the ICMP echo-reply (type 0). The interval between these events is called round trip. If the response (that is called pong) has not come until the end of the interval, we assume it has timed out. The second significant parameter reported is ttl (Time to Live). Is is decremented at each machine in which the packet is processed. The packet will reach its destination only when the ttl is greater than the number of routers between the source and the destination.

Properties

Command: /ping [address] [properties]


Ping tool can be used to ping IP address and mac address. Mac ping works only to devices that has mac ping server configured. Read more>>

Property Description
arp-ping (yes | no; Default: )
count (integer [0..4294967295]; Default: 0) Total number of packets to send (defult is to send forever until interrupted).
do-not-fragment (; Default: ) If do-not-fragment flag is set packets will not be fragmented if size exceeds interface mtu.
interface (string; Default: ) Which interface to use (required when pinging IPv6 address)
interval (time [10ms..5s]; Default: 1s) how long to wait for response. If no response is received within 1000ms, ping will show as "timed out", but if you will receive a response after 3ms, still the ping program will wait the rest of 997ms until it sends next ping.
routing-table (string; Default: main) Which routing table to use to resolve destination. Used in VRF setups.
size (integer; Default: 64) Packet size to be used in bytes (includes payload and IP header)
src-address (IPv4,IPv6; Default: ) IPv4/IPv6 address to be set as packets source. Useful if replies must be sent to specific address.
ttl (integer [1..255]; Default: ) Time to live parameter adjustment


Icon-note.png

Note: If DNS is configured, then DNS name can be used to ping destination


Examples

Ping IP address

[admin@dzeltenais_burkaans] > /ping 10.1.101.3
HOST                                    SIZE  TTL TIME  STATUS                                         
10.1.101.3                              56    64  3ms  
10.1.101.3                              56    64  10ms 
10.1.101.3                              56    64  7ms  
    sent=3 received=3 packet-loss=0% min-rtt=3ms avg-rtt=6ms max-rtt=10ms 

[admin@dzeltenais_burkaans] > /ping 10.1.101.9
HOST                                    SIZE  TTL TIME  STATUS                                         
                                                        timeout                                        
                                                        timeout                                        
                                                        timeout                                        
    sent=3 received=0 packet-loss=100% 

It is also possible to ping multicast address to discover all hosts belongign to multicast group:

[admin@dzeltenais_burkaans] > /ping ff02::1
HOST                                    SIZE  TTL TIME  STATUS                                         
fe80::20c:42ff:fe49:fceb                56    64  1ms   echo reply                                     
fe80::20c:42ff:fe72:a1b0                56    64  1ms   echo reply                                     
fe80::20c:42ff:fe28:7945                56    64  1ms   echo reply                                     
fe80::21a:4dff:fe5d:8e56                56    64  3ms   echo reply                                     
    sent=1 received=4 packet-loss=-300% min-rtt=1ms avg-rtt=1ms max-rtt=3ms 

Ping large packets:

[admin@dzeltenais_burkaans] > /ping 10.1.101.3 size=1600 do-not-fragment 
HOST                                    SIZE  TTL TIME  STATUS                                         
                                        576   64  3ms   fragmentation needed and DF set                
                                        576   64  6ms   fragmentation needed and DF set                
    sent=2 received=2 packet-loss=0% min-rtt=3ms avg-rtt=4ms max-rtt=6ms 

Ping by DNS name

[admin@dzeltenais_burkaans] > /ping www.google.lv      
HOST                                    SIZE  TTL TIME  STATUS                                         
74.125.77.99                            56    47  59ms 
74.125.77.99                            56    47  85ms 
    sent=2 received=2 packet-loss=0% min-rtt=59ms avg-rtt=72ms max-rtt=85ms 

Ping MAC address

[admin@dzeltenais_burkaans] > /ping 00:0C:42:72:A1:B0
HOST                                    SIZE  TTL TIME  STATUS                                         
00:0C:42:72:A1:B0                       56        0ms  
00:0C:42:72:A1:B0                       56        0ms  
    sent=2 received=2 packet-loss=0% min-rtt=0ms avg-rtt=0ms max-rtt=0ms 

Mac Ping

Sub-menu: /mac-server ping

This submenu allows to enable mac ping server.

When mac ping is enabled, other hosts on the same broadcast domain can use ping tool to ping mac address.

[admin@dzeltenais_burkaans] > /tool mac-server ping set enabled=yes 

[ Top | Back to Content ]