| name | GetPathMTU - Path MTU Discovery Sample Script | ||
|---|---|---|---|
| description | Sample script to test maximum MTU between source and destination. | ||
| languages |
|
||
| products |
|
||
| page_type | sample | ||
| urlFragment | GetPathMTU |
GetPathMTU is a bash script that provides the user a way to test the maximum supported MTU between the source where code is executed and the destination provided.
Clone the repository or download GetPathMTU.sh directly, then run the script.
-
Clone the Repository
git clone https://github.com/Azure-Samples/GetPathMTU.git -
Navigate into the folder containing the script
cd GetPathMTU -
Run the script
./GetPathMTU.sh <Destination IP>
Destination IPv4-Address : This is mandatory parameter, we can either use the parameter with a flat -s or without a flag Initial Buffer size : This optional parameter, the default value is 1200 bytes Interface Name : This optional parameter, not using the inteface parameter will use the default interface for communication
./GetPathMtu.sh 10.1.0.4
./GetPathMtu.sh -r 10.1.0.4 -l 2100 -i eth0
./GetPathMtu.sh -r 10.1.0.4 -l 1000
./GetPathMtu.sh -r <destination-ip> -l <initial-packet-size> -i <interface-name>
./GetPathMtu.sh -r 10.1.0.4 -l 1200 -i eth0Sample results:
$ ./GetPathMtu.sh 10.1.0.4
destination: 10.1.0.4
startSendBufferSize: 1200
interfaceName: Default interface
Test started .....................................
1492In this instance 1492 is the maximum MTU size (IP Header + Payload) allowable from the source running the script to the destination.
The Powershell Test-Connection command provides similiar capability with -MtuSize parameter.