Skip to content

Instantly share code, notes, and snippets.

@shaneholloman
Forked from ThinGuy/mtr.sh
Last active February 24, 2024 01:11
Show Gist options
  • Save shaneholloman/26b18c867f35e98cb844993b241ab63c to your computer and use it in GitHub Desktop.
Save shaneholloman/26b18c867f35e98cb844993b241ab63c to your computer and use it in GitHub Desktop.
Test all nics using mtr (my traceroute)
#!/bin/bash
mtrv4() {
[[ -z ${1} || ${1} =~ -h ]] && {
printf "Usage: %s <hostname|IP>\n" "${FUNCNAME[0]}" 1>&2
return 2
}
for i in $(ip -o -4 a | awk '{if ($2 != "lo") print $2}' | paste -sd' '); do mtr -4 -rw -c 5 -I "${i}" "${1}"; done
}
export -f mtrv4
mtrv6() {
[[ -z "$1" || "$1" =~ -h ]] && {
printf "Usage: %s <hostname|IP>\n" "${FUNCNAME[0]}" 1>&2
return 2
}
for i in $(ip -o -6 a | awk '{if ($2 != "lo") print $2}' | paste -sd' '); do mtr -6 -rw -c 5 -I "${i}" "${1}"; done
}
export -f mtrv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment