Posts

Showing posts with the label RHEL

Useful tcpdump commands and examples

Packet sniffing/capturing is a troubleshooting tool that many system and network engineers use for troubleshooting. If you're like me who uses Linux a lot, tcpdump is a useful tool that you can use. In this tutorial, I'm listing a couple of frequently used tcpdump commands  that I use. I'll keep adding additional interesting commands that I stumble upon over time. Installing tcpdump CentOS/RHEL # yum install tcpdump Ubuntu/Debian # apt-get install tcpdump Examples tcpdump requires root privileges. Please use a privileged user, or use sudo  where applicable. Running tcpdump and listening on all network interfaces # tcpdump Listening on a specific network interface # tcpdump -i eth0 All my examples have  ' -i eth0' parameter because I'm used to it. You could choose not to use this parameter depending on your use case, for example if you have only one NIC in the server. Write packet capture to Wireshark compatible...

How to analyze Squid logs with SARG log analyzer on CentOS

Image
This article was originally written for xmodulo . Squid provides many useful proxy features such as caching, access control, anti-virus, load balancing, authentication, rate-limiting, and so on. However, analyzing a raw Squid log file is not straightforward. For example, how could you analyze the time stamps and the number of hits in the following Squid log? 1404788984.429 1162 172.17.1.23 TCP_MISS/302 436 GET http://facebook.com/ - DIRECT/173.252.110.27 text/html 1404788985.046 12416 172.17.1.23 TCP_MISS/200 4169 CONNECT stats.pusher.com:443 - DIRECT/173.255.223.127 - 1404788986.124 174 172.17.1.23 TCP_MISS/200 955 POST http://ocsp.digicert.com/ - DIRECT/117.18.237.29 application/ocsp-response 1404788989.738 342 172.17.1.23 TCP_MISS/200 3890 CONNECT www.google.com:443 - DIRECT/74.125.200.106 - 1404788989.757 226 172.17.1.23 TCP_MISS/200 942 POST http://clients1.google.com/ocsp - DIRECT/74.125.200.113 application/ocsp-response 1404788990.839 3939 172.17.1.23 TCP_M...