hjaltiatlason

Linux Network troubleshooting commands

Jan 12th, 2021 (edited)
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.07 KB | None | 0 0
  1. #Linux Network troubleshooting commands
  2.  
  3. #TCPdump is a Packet analyzing tool - this command analyzes 10 packets on a local interfaces
  4. tcpdump -c 10
  5. #This command runs the same tcpdump comnmand on a single interface
  6. tcpdump -c 10 -i wl01
  7. #This tcpdump command analyzes packets on port 22 on a single interface
  8. tcpdump -i wl01 port 22
  9.  
  10. #Listing all ports (both TCP and UDP) using netstat -a option.
  11. netstat -a | more
  12. #Listing only TCP (Transmission Control Protocol) port connections using netstat -at.
  13. netstat -at
  14. #Listing only UDP (User Datagram Protocol ) port connections using netstat -au.
  15. netstat -au
  16. #Listing all active listening ports connections with netstat -l.
  17. netstat -l
  18. #Listing all active listening TCP ports by using option netstat -lt.
  19. netstat -lt
  20. #Listing all active listening UDP ports by using option netstat -lu.
  21. netstat -lu
  22.  
  23. #The following dig command sends the DNS query to Google’s name server(8.8.8.8) by using the @8.8.8.8 option.
  24. dig @8.8.8.8 hjalti.me
  25. #To query all the available DNS record types associated with a domain use the ANY option
  26. dig hjalti.me ANY
  27. #For example, to query get only the mail exchange – MX – answer section associated with a domain
  28. dig hjalti.me MX
  29.  
  30. #Download a Single File - The following command will get the content of the URL and display it in the STDOUT
  31. curl http://www.centos.org
  32. #To store the output in a file, you an redirect it as shown below. This will also display some additional download statistics.
  33. curl http://www.centos.org > centos-org.html
  34. #Save the cURL Output to a file - We can save the result of the curl command to a file by using -o/-O options.
  35. curl -o mygettext.html http://www.gnu.org/software/gettext/manual/gettext.html
  36. #command to troubleshoot client certificate negotiation -  The output will probably contain "Acceptable client certificate CA names" #and a list of CA certificates from the server, or possibly "No client certificate CA names sent"
  37. curl -iv https://mbl.is
  38.  
  39. #Using Iperf to measure network speed / bandwidth
  40. #client side
  41. iperf -c 192.168.144.200
  42. #Server side
  43. iperf -s
  44.  
Add Comment
Please, Sign In to add comment