Skip to content

Instantly share code, notes, and snippets.

@tolsadus
Last active July 8, 2016 09:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolsadus/6f5afc747ae0dc94d70f24e1f8ad580c to your computer and use it in GitHub Desktop.
Save tolsadus/6f5afc747ae0dc94d70f24e1f8ad580c to your computer and use it in GitHub Desktop.
Networking
  1. if you’re on (most modern distributions of) linux, forget that route(1) even exists (and throw ifconfig out in the same go) because it’s just absolutely frustrating. for probably 98% of what you need, ip(1) is the cool you care about

generally speaking, these will cover you: ip route, ip address, ip link

  1. when dealing with routing problems (​even if just two hosts next to each other​), mtr > traceroute > ping is an order that’s useful for a lot of what you need

mtr is nice because you can just let it keep running. press d in its display to get a running history breakdown of packets. fantastic for intermittent issues!

traceroute is generally known already, but depending on the complexity of your networks in question you may want traceroute-nanog or similar other ones. some of these are ASN-aware, which is useful.

in the same breath as traceroute, something else that’s useful to know about is tracepath

it’s a little bit nicer on finding asymm paths

lastly, pingis​ still useful in this, but if you need to start forcing specific kind of pings (pinning a specific source address, forcing a specific source interface, etc), sometimes fping can be slightly easier, so do be aware of it as well

oh and re tcpdump, a small gotcha to also be aware of: if you do something like tcpdump -nvi any -s 0 ….[filters here]…, you can get weird MAC stuff because of it capturing in promiscuous mode.

@imsickofmaps
Copy link

the wisdom of @froztbyte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment