linux下如何查看自己的外网IP
由于局域网的服务器是通过ADSL路由器连接外网的,但ADSL是从ISP运营商那儿通过动态获得IP的,那么我怎么知道自己的外网地址是多少呢?
现在介绍两个方法:
1、直接在命令行敲如下命令:
1
curl -s http://whatismyip.org
2、敲命令:
1
wget http://whatismyip.org
然后再敲命令:
1
cat index.html
以上两种方法均通过实践验证,确实有效.