想要在Linux环境下,通过网络服务获取本地的外网IP地址,找了几个可用的记录于此:
1. http://www.cip.cc/
使用方式:
命令行查询(详细):
UNIX/Linux: #curl cip.cc
Windows: >telnet cip.cc
>ftp cip.cc
命令行查询(纯ip):
UNIX/Linux:
UNIX/Linux: #curl cip.cc
Windows: >telnet cip.cc
>ftp cip.cc
命令行查询(纯ip):
UNIX/Linux:
#curl ip.cip.cc
如果是返回详细信息,类似:
IP : X.X.X.X
地址 : 中国 XX省 XX市
运营商 : XX
数据二 : XX省XX市XX区 | XX运营商
URL : http://www.cip.cc/IP地址
地址 : 中国 XX省 XX市
运营商 : XX
数据二 : XX省XX市XX区 | XX运营商
URL : http://www.cip.cc/IP地址
2. http://ip.cn/
使用方式:
# curl ip.cn
返回信息:
当前 IP:X.X.X.X 来自:XX省XX市 XX运营商
3. http://ifconfig.me/
使用方式类似:
$ curl ifconfig.me ⇒ IP地址
$ curl ifconfig.me/ip ⇒ IP地址
$ curl ifconfig.me/host ⇒
$ curl ifconfig.me/ua ⇒ Mozilla/5.0 (Windows NT 6.2; rv:39.0) Gecko/20100101 Firefox/39.0
$ curl ifconfig.me/port ⇒ 端口
$ curl ifconfig.me/lang ⇒ en-US,en;q=0.5
$ curl ifconfig.me/keepalive ⇒
$ curl ifconfig.me/connection ⇒ keep-alive
$ curl ifconfig.me/encoding ⇒ gzip, deflate
$ curl ifconfig.me/mime ⇒ text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
$ curl ifconfig.me/charset ⇒
$ curl ifconfig.me/via ⇒
$ curl ifconfig.me/forwarded ⇒
$ curl ifconfig.me/all ⇒ 所有检测信息
$ curl ifconfig.me/all.xml ⇒ XML格式的所有检测信息
$ curl ifconfig.me/all.json ⇒ JSON格式的所有检测信息
$ curl ifconfig.me/ip ⇒ IP地址
$ curl ifconfig.me/host ⇒
$ curl ifconfig.me/ua ⇒ Mozilla/5.0 (Windows NT 6.2; rv:39.0) Gecko/20100101 Firefox/39.0
$ curl ifconfig.me/port ⇒ 端口
$ curl ifconfig.me/lang ⇒ en-US,en;q=0.5
$ curl ifconfig.me/keepalive ⇒
$ curl ifconfig.me/connection ⇒ keep-alive
$ curl ifconfig.me/encoding ⇒ gzip, deflate
$ curl ifconfig.me/mime ⇒ text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
$ curl ifconfig.me/charset ⇒
$ curl ifconfig.me/via ⇒
$ curl ifconfig.me/forwarded ⇒
$ curl ifconfig.me/all ⇒ 所有检测信息
$ curl ifconfig.me/all.xml ⇒ XML格式的所有检测信息
$ curl ifconfig.me/all.json ⇒ JSON格式的所有检测信息
4. http://ipinfo.io/
使用方式:
$ curl ipinfo.io
返回信息类似:
{
"ip": "X.X.X.X",
"hostname": "No Hostname",
"city": "XX",
"region": "XX",
"country": "XX",
"loc": "经纬度",
"org": "详细地址"
}
"ip": "X.X.X.X",
"hostname": "No Hostname",
"city": "XX",
"region": "XX",
"country": "XX",
"loc": "经纬度",
"org": "详细地址"
}
相关推荐
本文实例讲述了C#实现获取本地内网(局域网)和外网(公网)IP地址的方法。分享给大家供大家参考,具体如下: 1、获取本机的IP地址集合: /// /// 获取本机所有ip地址 /// /// <param name=netType>InterNetwork:...
取外网IP地址,在线测试宽带速度,测带宽,身份证查询,车牌归属地查询等!
利用搜狐网站获取外网IP在自己网站显示
易语言获取外网ip5种方法源码,获取外网ip5种方法
获取本地内外网IP工具,该工具是用VB写的小工具,可获得本地计算机IP地址
获取内网ip地址3种方法。 1、TIdIPWatch控件方法 2、TGStack 3、TWSADATA
getipmail.exe可以自动获取已连接internet的本机外网ip地址,无论是adsl本地连接还是路由器自动连接,程序先按adsl连接方式直接获取外网ip地址,如果不能获取有效ip,则按路由器连接方式进行网络获取,因此成功较高...
如何查看本地ip 以及 外网ip
#/usr/bin/env bash # Name: get_network_info.sh # Author: Purple_Grape # This is a script to gather network information of your Linux system. # Test under Ubuntu 10.04 ...IP=`LANG=C ifconfig $NIC | awk
1:通过WWW.IP138.COM来获得本机的外网IP地址 2:针对网上的其它实例增加实时更新IP地址功能,防止断网重连后IP地址显示不正确 3:增加一条命令,用来解决MSXML2.XMLHTTP和Microsoft.XMLHTTP老是读旧缓存导致IP地址...
var wwip=; $(function(){ $(document).ready( function() { $.getJSON( ... function(data){ alert( data.host); wwip=data.host;...例子,js获取本地与外网IP地址。 <script language=
获取设备端的公网IP、内网IP以及网关。
有时候会遇到获取当前Android设备所使用的网络IP地址的场景,有时候需要本地的网络IP地址,即局域网地址,更多的时候是需要当前网络的真实的对外IP地址,即真实的网络地址,如大数据分析时往往需要Android设备上传...
内外网IP切换 1. 注意在文件中修改网卡连接的名称,本例为“本地连接”。 2. 内外网切换分3种情况: 一是内外网均配IP和DNS。 二是有一个网自动获取,另一个网配IP和DNS。 三是有一个网自动获取,另一个网只配IP,...
获取本地和外网ip对于不会看ip的人来说是很好的工具,本软件无毒但杀毒软件会报毒,这是由于获取外网ip时需要后台运行cmd来同过网络获取外网ip属于正常 现象,如不相信请勿下载
接口亲测可用。在原有基础上修改了一部分.可在客户端直接发请求然后通过判断你请求的iP来获得你所在的城市从而获得你所在城市的天气。
1)本工具自动获取本地局域网的公网IP。2)当公网IP变化时或定时时间到时自动发送邮件到指定邮箱。3)可以设置发送邮箱账号、接收邮箱账号及密码。SMTP服务器及端口号可设置。支持QQ、163等主流SMTP服务器。4)支持...
在MFC环境下获取本机网络信息,本地IP 外网IP 子虚掩码 mac地址