linux查看公网ip的方法

ifconfig命令

Linux查看IP地址的命令–ifconfig
ifconfig命令用于查看和更改网络接口的地址和参数
$ifconfig -a
lo0: flags=849 mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863 mtu 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
ether 8:0:20:a7:4d:21
系统会显示网络接口的名称,接口的状态(up or down),
接口的IP地址和掩码等信息

查看公网ip

curl cip.cc
curl ipinfo.io
curl  -s  icanhazip.com
IP      : xxxxxx
地址    : 中国  中国

数据二  : 浙江省杭州市 | 阿里云

数据三  : 中国浙江杭州 | 阿里云

URL     : http://www.cip.cc/xxxxxxxxx

{
  "ip": "xxxxxxxx",
  "city": "Beijing",
  "region": "Beijing",
  "country": "CN",
  "loc": "39.9075,116.3972",
  "org": "AS37963 Hangzhou Alibaba Advertising Co.,Ltd.",
  "timezone": "Asia/Shanghai",
  "readme": "https://ipinfo.io/missingauth"

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值