瀏覽器方式
用瀏覽器訪問 http://www.whatsmyip.net/
Unix機(jī)器
curl http://www.whatsmyip.net/
返回信息中:
...
Your <acronym title="Internet Protocol">IP</acronym> Address is
<br class="ip-responsive-break" />
<input type="text" value="120.35.18.214" />
...
或者把返回信息保存為 res.htm, 在瀏覽器中打開即可看到
Unix機(jī)器需要代理
curl -x <[protocol://][user:password@]proxyhost[:port]> url
既:
curl -x http://myproxy.xx:80 http://www.whatsmyip.net/
查看本機(jī)IP
Unix : ifconfig -a
Windows: ipconfig /all