获取网卡名称
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.me | ⇒ | 115.198.99.80 |
$ curl ifconfig.me/ip | ⇒ | 115.198.99.80 |
$ curl ifconfig.me/host | ⇒ | |
$ curl ifconfig.me/ua | ⇒ | 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 |
$ curl ifconfig.me/port | ⇒ | 30735 |
$ curl ifconfig.me/lang | ⇒ | zh-CN |
$ curl ifconfig.me/keepalive | ⇒ | |
$ curl ifconfig.me/connection | ⇒ | Keep-Alive |
$ curl ifconfig.me/encoding | ⇒ | gzip, deflate |
$ curl ifconfig.me/mime | ⇒ | text/html, application/xhtml+xml, image/jxr, */* |
$ curl ifconfig.me/charset | ⇒ | |
$ curl ifconfig.me/via | ⇒ | |
$ curl ifconfig.me/forwarded | ⇒ | |
$ curl ifconfig.me/all | ⇒ | ip_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"} |