获取内网ip
ifconfig eth0 | grep 'inet'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}'

获取公网ip
ifconfig eth1 | grep 'inet'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}'

获取本机外网ip的更多相关文章

  1. 获取本机外网ip和内网ip

    获取本机外网ip //获取本机的公网IP public static string GetIP() { string tempip = ""; try { WebRequest r ...

  2. 获取本机外网IP的工具类

    ExternalIpAddressFetcher.java package com.tyust.common; import java.io.IOException; import java.io.I ...

  3. cURL 命令获取本机外网 IP

    1.1 查询本机外网 IP # curl dhcp.cn 134.175.159.160 1.2 输出格式为 JSON # curl dhcp.cn/?json { "IP": & ...

  4. 用Linux命令行获取本机外网IP地址

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

  5. 获取本机外网IP的方式笔记

    1.IP138 网址:http://www.ip138.com/: 分离出的快速查询地址:http://20140507.ip138.com/ic.asp(2014年8月9日有效) 个人经验:百度搜索 ...

  6. Linux命令行获取本机外网IP地址

    问题: 服务器地址为net映射地址,本机ifconfig无法直接获取映射的公网地址. 方法: [root@TiaoBan- nidongde]# curl http://ifconfig.me 50. ...

  7. 【转】用Linux命令行获取本机外网IP地址

    $ curl ifconfig.me $ curl icanhazip.com $ curl ident.me $ curl ipecho.net/plain $ curl whatismyip.ak ...

  8. java获取本机外网ip

    public static String getV4IP(){ String ip = ""; String chinaz = "http://ip.chinaz.com ...

  9. 2019-11-17-dotnet-C#-获取本机外网-IP-地址

    title author date CreateTime categories dotnet C# 获取本机外网 IP 地址 lindexi 2019-11-17 16:38:10 +0800 201 ...

随机推荐

  1. 微信小程序-生命周期图解

    微信小程序-生命周期图解 小程序生命周期 App 生命周期 https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.htm ...

  2. 使用 js 实现一个中文自动转换成拼音的工具库

    使用 js 实现一个中文自动转换成拼音的工具库 中文 => zhong-wen 应用场景 SEO 友好, URL 自动转换 blogs 发布文章,自动化部署,自动生成 url 的 path (时 ...

  3. macOS & uninstall app

    macOS & uninstall app https://support.apple.com/en-hk/guide/mac-help/install-and-uninstall-other ...

  4. 【转】ICP算法(Iterative Closest Point迭代最近点算法)

    原文网址:https://www.cnblogs.com/sddai/p/6129437.html.转载主要方便随时可以查看,如有版权要求请及时联系. 最近在做点云匹配,需要用c++实现ICP算法,下 ...

  5. Scrapy 项目:QuotesBot

    QuotesBot This is a Scrapy project to scrape quotes from famous people from http://quotes.toscrape.c ...

  6. Centos7修改Docker默认存储位置

    一.前言 Centos7安装docker之后,默认的镜像及容器存储路径为/var/lib/docker,可以使用命令docker info查看. 但是该路径默认使用的是系统盘的存储,如果挂载了数据盘, ...

  7. 微信支付 V3 的 Java 实现 Payment Spring Boot-1.0.7.RELEASE 发布

    Payment Spring Boot 是微信支付V3的Java实现,仅仅依赖Spring内置的一些类库.配置简单方便,可以让开发者快速为Spring Boot应用接入微信支付. 功能特性 实现微信支 ...

  8. 后端程序员之路 36、Apache Kafka

    Apache Kafkahttp://kafka.apache.org/ Kafka,很容易就联想到<海边的卡夫卡>,文艺程度和Casablanca有得一拼.Kafka是一个分布式消息系统 ...

  9. LeetCode392. 判断子序列

    原题链接 1 class Solution: 2 def isSubsequence(self, s: str, t: str) -> bool: 3 lens,lent = len(s),le ...

  10. rest framework Views

    基于类的意见 Django的基于类的意见是从旧式的观点颇受欢迎. - Reinout面包车里斯 REST框架提供了一个APIView类,它的子类Django的View类. APIView类是从正规不同 ...