站群服务器如何分配IP?
2023-10-12 0站群服务器也就是多IP服务器,服务器上一般超过100个以上IP,目的是为了让多个网站绑定不同的IP,以实现让每个网站都有独立IP,为什么要每个网站有独立IP?这是因为独立IP的网站更容易被搜索引擎收录,SEO优化效果更好。
既然服务器上有这么多IP,那IP分配或管理起来也是一件复杂的事,所以必须针对IP段进行规划,不应该随便乱来绑定。其实针对这个问题,ARIN早已经定制出一个规则,实现对IP的科学分配与管理,今天我们讲解一下IP是如何分配绑定到服务器上的。
通常情况下,站群服务器绑定的IP往往是整个网段,比如:123.45.67.0/24,其中/24是什么意思呢?它表示子网掩码的长度是24位(二进制),用十进制的格式为:255.255.255.0,那123.45.67.0/24这个网段到底是表示哪些IP?里面有多少个IP可用呢?
这里有一个公式,比如我们用/N来代表/24,那么IP总数的公式为:IP总数=2^(32-N) ,解释:2^代表是次方,比如/24网段有多少个IP呢?那根据公式可以这样计算:2^(32-24),即2的8次方,结果是256个IP。
那么刚才的例子:123.45.67.0/24里面有哪些IP,123.45.67.0-255。哪些IP可用呢?其中123.45.67.0为网络地址,123.45.67.1为网关,123.45.67.255为广播地址,所以可用的IP地址为123.45.67.2-254。
目前IPv4有这些网段:/30、/29、 /28、 /27、 /26、 /24、 /23、 /22、 /21、 /20、 /19、 /18、 /17、 /16,我们怎么查询这些/N段所对应的IP总数、网络地址、可用IP数量及范围、网关、子网掩码、广播地址呢?根据规则,下面有一个用公式计算出来完整的表格。
.iptba{margin:0px; padding:4px;height:24px; font-size:1.6rem;border-top: none; border-right-style: solid; border-right-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-color: rgb(221, 221, 221); border-left-style: solid; border-left-color: rgb(221, 221, 221); background: rgb(239, 243, 245); overflow-wrap: break-word !important; box-sizing: border-box !important;}.iptbb{margin: 0px; padding:4px;height:24px;font-size:1.6rem; border-top: none; border-right-style: solid; border-right-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-color: rgb(221, 221, 221); border-left: none; background: rgb(247, 247, 247); overflow-wrap: break-word !important; box-sizing: border-box !important;}.iptbc{margin: 0px; padding:4px; height:24px;font-size:1.6rem;border-top: none; border-right-style: solid; border-right-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-color: rgb(221, 221, 221); border-left: none; overflow-wrap: break-word !important; box-sizing: border-box !important;}.iptbd{margin: 0px; padding:4px; height:24px;font-size:1.6rem;box-sizing: border-box !important; overflow-wrap: break-word !important; height: 22px;}.iptbe{margin: 0px; padding:4px;height:35px;font-size:1.6rem;border-style: solid solid solid none; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-width: initial; border-left-color: initial; background: rgb(239, 243, 245); overflow-wrap: break-word !important; box-sizing: border-box !important;}网段IP总数子网掩码 NetmaskC段数量/304255.255.255.2521/64/298255.255.255.2481/32/2816255.255.255.2401/16/2732255.255.255.2241/8/2664255.255.255.1921/4/24256255.255.255.01/23512255.255.254.02/221024255.255.252.04/212048255.255.248.08/204096255.255.240.016/198192255.255.224.032/1816384255.255.192.064/1732768255.255.128.0128/1665536255.255.0.0256- 上一篇:服务器丢包有哪些原因?
- 下一篇:如何检测境外服务器是否CN2线路?