计算IP地址的CIDR

以IP 101.20.91.192为例

在linux下执行如下命令

shell># whois 101.20.91.192
[Querying whois.arin.net]
[Redirected to whois.apnic.net]
[Querying whois.apnic.net]
[whois.apnic.net]
% [whois.apnic.net node-3]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html


inetnum:        101.16.0.0 - 101.31.255.255
netname:        CNCGROUP-HE
descr:          China Unicom Hebei province network
descr:          China Unicom
descr:          No.21,Ji-Rong Street,
descr:          Beijing 100140
country:        CN
admin-c:        CH455-AP
tech-c:         KL984-AP
remarks:        service provider
mnt-by:         APNIC-HM
mnt-lower:      MAINT-CNCGROUP
mnt-lower:      MAINT-CNCGROUP-HE
mnt-routes:     MAINT-CNCGROUP-RR
mnt-irt:        IRT-CU-CN
status:         ALLOCATED PORTABLE
remarks:        -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+
remarks:        This object can only be updated by APNIC hostmasters.
remarks:        To update this object, please contact APNIC
remarks:        hostmasters and include your organisation's account
remarks:        name in the subject line.
remarks:        -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+
changed:        hm-changed@apnic.net 20101210
source:         APNIC


route:          101.16.0.0/12
descr:          China Unicom Hebei Province Network
country:        CN
origin:         AS4837
mnt-by:         MAINT-CNCGROUP-RR
changed:        abuse@cnc-noc.net 20101231
source:         APNIC


role:           CNCGroup Hostmaster
e-mail:         abuse@cnc-noc.net
address:        No.156,Fu-Xing-Men-Nei Street,
address:        Beijing,100031,P.R.China
nic-hdl:        CH455-AP
phone:          +86-10-82993155
fax-no:         +86-10-82993102
country:        CN
admin-c:        CH444-AP
tech-c:         CH444-AP
changed:        abuse@cnc-noc.net 20041119
mnt-by:         MAINT-CNCGROUP
source:         APNIC


person:         Kong Lingfei
nic-hdl:        KL984-AP
e-mail:         konglf5@chinaunicom.cn
address:        45, Guang An Street, Shi Jiazhuang City, HeBei Province,050011,CN
phone:          +86-311-86681601
fax-no:         +86-311-86689210
country:        cn
changed:        konglf5@chinaunicom.cn 20090206
mnt-by:         MAINT-CNCGROUP-HE
source:         APNIC

得到inetnum:        101.16.0.0 - 101.31.255.255

31-16=15也就是1111

所以主机位是8+4=12位

其CIDR是101.16.0.0/12


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值