<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d11356004\x26blogName\x3dxception\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://openrent.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://openrent.blogspot.com/\x26vt\x3d-2179510228592399674', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Useful netstat commands

View what IP's are generating the most connections to your web server, from least to most connections:

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

The result will look like this:

117 0.0.0.0
158 172.27.10.75
354 172.27.10.140


If you want to see how many connections are in a certain state of the TCP/IP handshake, use this command:
$ netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c

The result will look like this:

282 CLOSE_WAIT
230 ESTABLISHED
2 FIN_WAIT2
1 LAST_ACK
1 LISTEN
330 TIME_WAIT