原文:http://www.cnblogs.com/wudonghang/p/354289a61129731e7d2075968356e6ad.html

Curl 纯文本格式输出:

curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io
curl ipecho.net/plain
curl www.trackip.net/i

curl JSON格式输出:

curl ipinfo.io/jsoncurl ifconfig.me/all.jsoncurl www.trackip.net/ip?json (有点丑陋)

curl XML格式输出:

curl ifconfig.me/all.xml

curl 得到所有IP细节 (挖掘机)

curl ifconfig.me/all

使用 DYDNS (当你使用 DYDNS 服务时有用)

curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"

使用 Wget 代替 Curl

wget http://ipecho.net/plain -O - -q ; echo
wget http://observebox.com/ip -O - -q ; echo

使用 host 和 dig 命令

如果有的话,你也可以直接使用 host 和 dig 命令。

host -t a dartsclink.com | sed 's/.*has address //'
dig +short myip.opendns.com @resolver1.opendns.com

bash 脚本示例:

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

几种Linux 查询外网出口IP的方法(转)的更多相关文章

  1. 几种Linux 查询外网出口IP的方法

    Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.appspot.com curl ipinfo. ...

  2. 查看外网出口IP && Traceroute

    一.CentOS 查看外网出口IP 1---------------- # curl ifconfig.me 2----------------# curl icanhazip.com 二.Trace ...

  3. 获取外网出口ip

    curl ifconfig.me 或 curl cip.cc

  4. 几种在Linux下查询外网IP的办法。

    几种在Linux下查询外网IP的办法.   Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.ap ...

  5. Linux查看外网IP

    Linux查看外网IP curl cip.cc curl ifconfig.me curl ipinfo.io

  6. linux获取外网ip

    引言:目前获取ip的方法中,ifconfig和ip获取函数得到的都是内网ip.有时候需要获取外网ip,目前通用的做法,是向外部服务器发送请求,解析外部服务器响应,从而得到的自己的外网ip.linux下 ...

  7. 查看linux系统外网ip命令

    终端中输入 curl ipinfo.io 或者 curl ifconfig.me 即可通过IP地址检测网站提供的api获得取本机的外网IP,或者以 JSON 格式返回全部结果.

  8. Linux连接外网

    1.给linux配置ip 进行远程管理 如果网络不同的话需要配置网卡,命令如下: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3   回车 就出现网络的环 ...

  9. Kali Linux上外网

    第一部分 攻击者杀链 第一章  走进Kali Linux 镜像准备:32位kali linxu 2019(之前下载好了,按书上的版本太低了要重新配置好多东西就用最新版了) , win XP 前两章照着 ...

随机推荐

  1. Async Performance: Understanding the Costs of Async and Await

    Stephen Toub Download the Code Sample Asynchronous programming has long been the realm of only the m ...

  2. windows 注册表讲解

    注册表存储结构: 整个注册表内容主要由项(键).值(键值)构成.(通过regedit命令打开注册表) 5个根键: HKEY_CLASSES_ROOT    (缩写HKCR) HKEY_CURRENT_ ...

  3. ios 消除 字符串 首尾空格

    本文转载至 http://blog.csdn.net/reylen/article/details/8233353 (1)系统去首尾空格方法,使用NSString中的str = [str string ...

  4. sklearn中的回归器性能评估方法

    explained_variance_score() mean_absolute_error() mean_squared_error() r2_score() 以上四个函数的相同点: 这些函数都有一 ...

  5. 八、K3 WISE 开发插件《工业单据老单插件中获取登陆用户名》

    备注:如果是BOS新单,都有获取用户名的方法.在单据有m_BillInterface.K3Lib.User.UserId,在序时薄有m_ListInterface.K3Lib.User.UserID ...

  6. 获取HttpServletRequest请求Body中的内容

    在实际开发过程中,经常需要从 HttpServletRequest 中读取HTTP请求的body内容,俗话说的好”好记性不如烂笔头“,特在此将其读取方法记录一下. import java.io.Buf ...

  7. Spring学习笔记--Spring IOC

    沿着我们上一篇的学习笔记,我们继续通过代码学习IOC这一设计思想. 6.Hello类 第一步:首先创建一个类Hello package cn.sxt.bean; public class Hello ...

  8. 多线程局部变量之threading.local()用法

    假如,开了十个线程并且做同样的一件事,他们需要带着自己的数据进来,完成事情后带着自己的数据出去.如果是并发,同时进来,他们的数据就会混乱. 一般情况,我们加锁就可以了,一个人先进来,先加锁,另一个人过 ...

  9. ftp如何使用命令上传文件

    本地上传到服务器的步骤如下: 1."开始"-"运行"-输入"FTP" 2.open qint.ithot.net 这一步可以与第一步合并,在 ...

  10. 数据库高分笔记01:事务ACID

    作者:arccosxy  转载请注明出处:http://www.cnblogs.com/arccosxy/ 事务就是一组原子性的SQL查询,或者说一个独立的工作单元.如果数据库引擎能够成功地对数据库应 ...