Scripting How-To: op-pingsweep for troubleshooting MTU/MSS issues

By Erdem posted 08-14-2015 10:00

  

 

Overview

Send a series of pings to remote-host, useful for troubleshooting MTU/MSS issues. This applies to SLAX version 1.1 and higher.

 

Description

 

Automatically send a series of pings to the remote host. Subsequent pings send packets of increasing size so that transmission size issues are detected.

What it Does
 

This script sends a series of pings to a remote host, starting with a packet size of $min-size.The size of the packet is increased with each ping by specified $step increments until it reaches $max-size. The results are useful for troubleshooting issues related to maximum transmission unit (MTU) or maximum segment size (MSS).

Set Up

  1. Copy the op-pingsweep.slax script to the /var/db/scripts/op directory on the router.
  2. Enable the script by adding the file statement and script filename to the [edit system scripts op] hierarchy level in the configuration. Only superusers can enable scripts in the configuration.
    1 [edit system scripts op]
    2 user@host# set file op-pingsweep.slax
  3. Commit the configuration:
    1 [edit]
    2 user@host# commit and-quit
How to Run
 
  1. To run this script, issue the command op op-pingsweep from the CLI operational mode:
    1 user@host> op op-pingsweep remote-host <hostname>
    Note: The argument remote-host is mandatory. Optional arguments are min-size, max-size, and step. The default values for the optional arguments are:
    • min-size = 1400
    • max-size = 1600
    • step = 100
  2. The output will appear similar to this:
    01 user@cli> op pingsweep remote-host waffy min-size 1400 max-size 1600 step 100
    02  
    03 Executing command: ping waffy size 1400 count 1 do-not-fragment
    04 Ping Success!!!
    05  
    06 Executing command: ping waffy size 1500 count 1 do-not-frament
    07 Ping Success!!!
    08  
    09 Executing command: ping waffy size 1600 count 1 do-not-frament
    10 Ping Failed!!!
  3. To see a list of all arguments for the script, type “?” after the command op op-pingsweep:
    01 user@host> op op-pingsweep ?
    02  
    03 Possible completions:
    04 <[Enter]>         Execute this command
    05 <name>            Argument name
    06 detail            Display detailed output
    07 max-size          Maximum packet size
    08 min-size          Minimum packet size
    09 remote-host       Host name or ip-address to ping
    10 step              Packet size difference
Source Code
 

 

GitHub Links
 
Example Output
01 user@cli> op pingsweep remote-host waffy min-size 1400 max-size 1600 step 100
02  
03 Executing command: ping waffy size 1400 count 1 do-not-fragment
04 Ping Success!!!
05  
06 Executing command: ping waffy size 1500 count 1 do-not-frament