Linux服务器查看外网IP地址的命令

十年热恋 提交于 2021-01-28 15:52:03

Linux服务器查看外网IP地址的命令

Curl 纯文本格式输出:
1、curl cip.cc
2、curl icanhazip.com
3、curl ident.me
4、curl ipecho.net/plain
5、curl whatismyip.akamai.com
6、curl tnx.nl/ip
7、curl myip.dnsomatic.com
8、curl ifconfig.me
9、curl ip.appspot.com
10、curl curlmyip.com
11、curl www.trackip.net/i
12、curl ipinfo.io/ip
13、curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'


bash 脚本示例:

#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
echo $PUBLIC_IP

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!