首页 > 技术文章 > llinux 查看自己的公网ip

wz0314 2015-04-23 17:57 原文

如何在LINUX服务器下查看公网IP地址,可以使用下面的方法:

[root@web ~]#curl http://members.3322.org/dyndns/getip


[root@web ~]# curl ifconfig.me

[root@proxy ~]# curl icanhazip.com

-bash-4.1# yum install links -y #安装命令模式浏览器
-bash-4.1# links icanhazip.com #通过网页查询自己的公网IP ,最后按“q”退出

[root@mini ~]# curl ip.cn|awk -F: '{print $2}'|awk '{print $1}' >ip.txt # 这样也可以查看自己的公网ip



推荐阅读