11111111.11111111.11111111.11000000 portant; overflow-wrap: break-word !important; font-size: 15px; letter-spa。从这五个问题,来彻底了解ip地址的计算( 二 )。" />

从这五个问题,来彻底了解ip地址的计算( 二 )


portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">11111111.11111111.11111111.11000000
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">子网掩码共有26位,还有6位可用 。
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">即2的6次方减去2,等于62,即有62个ip地址可用 。
第三关
portant; overflow-wrap: break-word !important; background-color: rgb(255, 251, 0);">portant; overflow-wrap: break-word !important; color: rgb(62, 62, 62); font-family: Optima-Regular, PingFangTC-light; font-size: 15px; letter-spacing: 0.544px; text-align: left; text-indent: 34px;">某公司申请到一个C 类IP 地址,只连接6 个子公司,最大的一个子公司有26 台计算机,每个子公司都分配在同一个网段,则子网掩码应设为多长合适?
portant; overflow-wrap: break-word !important;">首先一个C类的子网掩码为255.255.255.0,这个是最原始 。portant; overflow-wrap: break-word !important;">但现在我们是有要求:
portant; overflow-wrap: break-word !important;">1、连接6个子网
portant; overflow-wrap: break-word !important;">2、且最大一个子网的ip地址为26个 。
portant; overflow-wrap: break-word !important;">
portant; overflow-wrap: break-word !important;">如何来设置这个子网掩码呢?portant; overflow-wrap: break-word !important; font-size: 15px;">
portant; overflow-wrap: break-word !important; font-size: 15px;">具体计算
portant; overflow-wrap: break-word !important; font-size: 15px;">网络中的原则是ip地址与子网掩码越越精准,portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">网portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">络越易治理,故障越低 。portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">首先来portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">分portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">析2的2次方portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">等于4,2的3portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">次方等portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">于portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">8,
portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">所以最正确portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">网portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">络中是portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">容portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">纳8个子网,最接近6个子网的划分portant; overflow-wrap: break-word !important; letter-spacing: 0.544px; font-size: 15px;">即为255.255.255.224 。portant; overflow-wrap: break-word !important; font-size: 15px;">我们再来验证下,每个子网的主机数量 。portant; overflow-wrap: break-word !important; font-size: 15px;">portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">子网掩码255.portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">255.255.portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">224转化为二进制为:
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px; color: rgb(217, 33, 66);">11111111.11111111.11111111.111portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">00000
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">子网掩码为27位,那么主机位数为5位 。
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">即可容纳的主机数为2的5次方减2,等于30 。
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">完全符合一个子网内容纳26个ip地址 。
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 0.544px;">portant; overflow-wrap: break-word !important; letter-spacing: 0.544px;">所以最终的子网掩码为255.255.255.224