2014年4月18日 星期五

NAT環境下從 Linux console取得外部IP位址

一隻小 shell script,一行指令

#! /bin/bash
 echo `curl -s ifconfig.me` | mutt -s ' real IP of my host ' someone@gmail.com


其中curl -s ifconfig.me 是用curl去連結回報真實IP服務的網站,類似的網站還有
curl ident.me
curl tnx.nl/ip
curl icanhazip.com
curl ipecho.net/plain
curl ip.appspot.com



沒有留言: