linux 查看公网IP和获取网卡名称

获取网卡名称

lshw -c network | grep -E "logical name'  

一、命令查询 

方法1:

apt install curl

curl ifconfig.me

方法2:

echo `nc ns1.dnspod.net 6666`

方法3:

curl cip.cc

方法4:

curl ipinfo.io

方法5:

curl myip.ipip.net

方法6:

curl ip.sb

 

 

二、网页查询法

方法1:登录网站:http://www.whatismyip.com/

方法2:登录网站:http://www.ip138.com/

方法2:登录网站: ifconfig.me/

————————————————————————————————————————————————————————————————————————————————————————————————————————————————

ifconfig.me 提供的其他接口

Command Line Interface

$ curl ifconfig.me115.198.99.80
$ curl ifconfig.me/ip115.198.99.80
$ curl ifconfig.me/host 
$ curl ifconfig.me/uaMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
$ curl ifconfig.me/port30735
$ curl ifconfig.me/langzh-CN
$ curl ifconfig.me/keepalive 
$ curl ifconfig.me/connectionKeep-Alive
$ curl ifconfig.me/encodinggzip, deflate
$ curl ifconfig.me/mimetext/html, application/xhtml+xml, image/jxr, */*
$ curl ifconfig.me/charset 
$ curl ifconfig.me/via 
$ curl ifconfig.me/forwarded 
$ curl ifconfig.me/allip_addr: 115.198.99.80
remote_host:
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
port: 30735
lang: zh-CN
connection: Keep-Alive
keep_alive:
encoding: gzip, deflate
mime: text/html, application/xhtml+xml, image/jxr, */*
charset:
via:
forwarded:
$ curl ifconfig.me/all.xml<info>
    <charset></charset>
    <connection>Keep-Alive</connection>
    <encoding>gzip, deflate</encoding>
    <forwarded></forwarded>
    <ip_addr>115.198.99.80</ip_addr>
    <keep_alive></keep_alive>
    <lang>zh-CN</lang>
    <mime>text/html, application/xhtml+xml, image/jxr, */*</mime>
    <port>30735</port>
    <remote_host></remote_host>
    <user_agent>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299</user_agent>
    <via></via>
</info>
$ curl ifconfig.me/all.json{"connection":"Keep-Alive","ip_addr":"115.198.99.80","lang":"zh-CN","remote_host":"","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299","charset":"","port":"30735","via":"","forwarded":"","mime":"text/html, application/xhtml+xml, image/jxr, */*","keep_alive":"","encoding":"gzip, deflate"}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值