{"id":2010,"date":"2012-03-20T08:37:52","date_gmt":"2012-03-20T13:37:52","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2010"},"modified":"2012-03-20T08:37:52","modified_gmt":"2012-03-20T13:37:52","slug":"open-ports-by-interface","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/03\/20\/open-ports-by-interface\/","title":{"rendered":"Open ports by interface"},"content":{"rendered":"<p>I often use what is below to get a listing of currently open ports by interface.  If you find you can&#8217;t &#8220;see&#8221; a port from another computer, and&#8230;<\/p>\n<p>it is open on the IP to which you are trying to connect<\/p>\n<p>-or-<\/p>\n<p>it is open on 0.0.0.0 (all interfaces)<\/p>\n<p>&#8230;then check the server firewall (iptables), or check with the network team.<\/p>\n<pre lang=\"text\">\r\nfor ip in $(netstat -an | awk '$NF == \"LISTEN\" {split($4,s,\":\");print s[1]}' | sort -u); do\r\n  echo $ip\r\n  echo \"------------------------\"\r\n  netstat -an | awk -v ip=$ip '$NF == \"LISTEN\" && $4 ~ ip\":\" {split($4,s,\":\"); print s[2]}' | sort -n\r\n  echo \"------------------------\"\r\ndone\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I often use what is below to get a listing of currently open ports by interface. If you find you can&#8217;t &#8220;see&#8221; a port from another computer, and&#8230; it is open on the IP to which you are trying to&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/03\/20\/open-ports-by-interface\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[28,27],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2010"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2010"}],"version-history":[{"count":4,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2010\/revisions"}],"predecessor-version":[{"id":2022,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2010\/revisions\/2022"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2010"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}