首先使用下面命令獲取連接本服務到的ip列表。
netstat -anp|egrep 80|egrep "EST"|awk '{print $(NF-2)}' |cut -f 1 -d ":"
然后用python寫一個腳本實現通過IP獲取歸屬地。