---
title: "linux查看自己公网ip"
author: "w6889037"
date: "2015-12-01T23:57:31Z"
tags: []
categories: ["编程语言"]
slug: "linux-ip"
draft: false
lastmod: "2015-12-01T23:57:31Z"
id: 2260976
url: "https://huxc.iteye.com/blog/2260976"
---

```java

方法一：
curl http://members.3322.org/dyndns/getip

方法二：
curl -s http://whatismyip.org

方法三：
1， cd  /etc/sysconfig/network-scripts/    进入存放网卡信息的文件夹下
2，ls  ls ifcfg-eth*    看显示有几个网卡
3，cat  ifcfg-eth0 从上面ls  找出来的结果查看网卡配置信息！！

```