Curl 纯文本格式输出:

curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io/ip
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的方法(转)

    原文:http://www.cnblogs.com/wudonghang/p/354289a61129731e7d2075968356e6ad.html Curl 纯文本格式输出: curl ican ...

  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. BufferedReader readLine()方法

    控制台输入字符串之后回车,后台接收传来的字符串,代码如下: import java.io.BufferedReader; import java.io.IOException; import java ...

  2. 如何申请https证书、搭建https网站

    如何申请https证书.搭建https网站 随着国内搜索引擎巨头百度启用全站https加密服务,全国掀起了网站https加密浪潮.越来越多的站点希望通过部署https证书来解决“第三方”对用户隐私的嗅 ...

  3. 2014牡丹江D Domination

    Domination Time Limit: 8 Seconds      Memory Limit: 131072 KB      Special Judge Edward is the headm ...

  4. Hadoop 面试题之Hbase

    Hadoop 面试题之九 16.Hbase 的rowkey 怎么创建比较好?列族怎么创建比较好? 答: 19.Hbase 内部是什么机制? 答: 73.hbase 写数据的原理是什么? 答: 75.h ...

  5. jquery mobile cannot be created in a document with origin 'null' and URL

    jquery mobile cannot be created in a document with origin 'null' and URL http://zhidao.baidu.com/lin ...

  6. Java Io 之 编码

    Java字符串编码一些知识总结: package com.dcz.io; import java.io.UnsupportedEncodingException; public class Encod ...

  7. php中mysql与mysqli的区别

    两个函数都是用来处理DB 的.首先, mysqli 连接是永久连接,而mysql是非永久连接. mysql连接每当第二次使用的时候,都会重新打开一个新的进程,而mysqli则只使用同一个进程,这样可以 ...

  8. Android中的四种动画(一)

    TweenAnimation 变换动画(也叫作"补间动画"),有四种(alpha scale translate rote). FrameAnimation(也叫DrawableA ...

  9. Raspberry Pi 配置笔记二

    配置源 http://blog.chinaunix.net/uid-21658993-id-4702322.html deb http://ipv4.mirrors.ustc.edu.cn/raspb ...

  10. SNMP常用数据操作

    SNMP常用数据操作 snmp编程中常见的数据类型基本上就是integer32/oct_str(字节数组)/counter64/timeticks/dateAndTime这些.很多其它的比如Truth ...