Skip to content

Instantly share code, notes, and snippets.

@jsarenik jsarenik/
Last active Jun 28, 2017

What would you like to do?
Find MTU on Linux as root.
#!/bin/sh -x
myping() {
ping -c1 -w1 -W1 -nM do -s$1 >/dev/null 2>&1
until myping $PL; do PL=$(($PL-10)); done
while PL=$((PL+2)); myping $PL; do : ; done
echo The maximum payload in one packet is $PL
# 28 for IP, 8 for ICMP
echo MTU is $(($PL+28))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.