portant; overflow-wrap: break-word !important; color: rgb(217, 33, 66);">portant; overflow-wrap: break-word !important; letter-spacing: 2px; text-indent: 30px; font-family: Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px;">例2
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); font-family: 微软雅黑, 宋体, 黑体, Arial, Helvetica, sans-serif; font-size: 15px; letter-spacing: 2px; text-indent: 30px;">ip地址1:192.168.1.1 子网掩码:255.255.252.0
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); font-family: 微软雅黑, 宋体, 黑体, Arial, Helvetica, sans-serif; font-size: 15px; letter-spacing: 2px; text-indent: 30px;">ip地址2:192.168.2.1 子网掩码:255.255.252.0
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); letter-spacing: 2px; text-indent: 30px; font-family: Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px;">很明显,我们这个和上面例1的ip地址是一样的,只是子网掩码不一样,假如不看子网掩码,首先可能就判定他们不是同一个网段 。
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); letter-spacing: 2px; text-indent: 30px; font-family: Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px;">这里面和上面例1中唯一变化就是子网掩码从portant; overflow-wrap: break-word !important; font-family: 微软雅黑, 宋体, 黑体, Arial, Helvetica, sans-serif; font-size: 15px;">255.255.255.0换成了portant; overflow-wrap: break-word !important;">255.255.252.0了,那我们来看下,他们是否属于同一个网段 。
portant; overflow-wrap: break-word !important; font-size: 15px;">具体计算
portant; overflow-wrap: break-word !important; font-size: 15px;">将ip地址192.168.1.1转换为二进制
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000001 00000001
portant; overflow-wrap: break-word !important; font-size: 15px;">将子网掩码255.255.252.0转换成二进制
portant; overflow-wrap: break-word !important; font-size: 15px;">11111111.11111111.11111100.00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">然后将两者相“与(and)运算:
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000001 00000001
portant; overflow-wrap: break-word !important; font-size: 15px;">11111111.11111111.11111100.00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">然后得到:
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000000 00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">转换成网络号就是:192.168.0.0
portant; overflow-wrap: break-word !important; font-size: 15px;">将ip地址192.168.2.1转换为二进制
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000010 00000001
portant; overflow-wrap: break-word !important; font-size: 15px;">将子网掩码255.255.252.0转换成二进制
portant; overflow-wrap: break-word !important; font-size: 15px;">11111111.11111111.11111100.00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">然后将两者相“与(and)运算:
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000010 00000001
portant; overflow-wrap: break-word !important; font-size: 15px;">11111111.11111111.11111100.00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">然后得到:
portant; overflow-wrap: break-word !important; font-size: 15px;">11000000 10101000 00000000 00000000
portant; overflow-wrap: break-word !important; font-size: 15px;">转换成网络号就是:192.168.0.0
portant; overflow-wrap: break-word !important; font-size: 15px;">很明显,二者的结果是一样的,都是属于192.168.0.0网段,所以他们是同属于一个网段 。
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); font-family: 微软雅黑, 宋体, 黑体, Arial, Helvetica, sans-serif; font-size: 15px; letter-spacing: 2px;">当然,假如对子网较熟了就不需要经过这些运算了,大部分的网段可以通过分析子网掩码与ip地址就可以判定出来是否属于网一网段,但前提是你需要认识网段的原理与运算的方法 。
portant; overflow-wrap: break-word !important; font-size: 15px;">三、如何根据ip地址推算子网掩码
portant; overflow-wrap: break-word !important; font-size: 15px; letter-spacing: 2px; color: rgb(217, 33, 66);">确定ip地址子网掩码
portant; overflow-wrap: break-word !important; color: rgb(84, 84, 84); font-family: 微软雅黑, 宋体, 黑体, Arial, Helvetica, sans-serif; font-size: 15px; letter-spacing: 2px;">大部分的情况下,我们网络中只要不超过254台主机的的话,子网掩码都可以设置成255.255.255.0 。那么超过了254台主机的话怎么办呢?
- 怎么检查宾馆摄像头 住酒店宾馆如何查找针孔摄像头
- 河豚中毒该如何急救?
- 买宰杀后的鸡怎么挑 宰杀后的鸡要如何选
- 甲周肿痛如何急救
- 草莽子中毒如何急救?
- 孕妇哈哈大笑打一成语 两个高字一个楼梯是什么
- 冬季如何煲汤 加山药陈皮更养生
- 如何抢救服灭鼠药自杀者
- TDR如何测试线缆断点与短路
- 什么是单臂路由与三层交换机?他们如何实现不同vlan间的通信?