免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2551 | 回复: 6
打印 上一主题 下一主题

求教,这样设置掩码可以么? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-03 11:12 |只看该作者 |倒序浏览
假设有三个网段
192.168.1.1/255.255.255.240
192.168.1.17/255.255.255.240
192.168.1.33/255.255.255.240
路由器只有两个口,外网口为
192.168.1.17/255.255.255.240

内网口包含两个网段:
192.168.1.1/255.255.255.240
192.168.1.33/255.255.255.240

为了节省被浪费的地址,由于
192.168.1.1网段为    11111111.11111111.11111111.0000xxxx
192.168.1.33网段为  11111111.11111111.11111111.0010xxxx
那么我可以不可以把它们合并写成:
192.168.1.1/255.255.255.208

论坛徽章:
0
2 [报告]
发表于 2010-06-03 12:09 |只看该作者
不行的吧

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
3 [报告]
发表于 2010-06-03 12:34 |只看该作者
不可以。

论坛徽章:
0
4 [报告]
发表于 2010-06-03 12:55 |只看该作者
我印象里以前有讨论过的,忘了结论是可以还是不可以了

论坛徽章:
0
5 [报告]
发表于 2010-06-03 13:19 |只看该作者
指出两点:
1.要表示网段的话,不要用一个主机位来表示.应该是:
192.168.1.0/255.255.255.240 或者 192.168.1.0/28
192.168.1.16/255.255.255.240 或者 192.168.1.16/28
192.168.1.32/255.255.255.240 或者 192.168.1.32/28

2.掩码位必须是连续的1.  208的二进制是 11010000 这样是不行的.

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2010-06-03 14:39 |只看该作者
不能这么合并,掩码要连续

论坛徽章:
0
7 [报告]
发表于 2010-06-03 15:14 |只看该作者
找到了。

RFC 950 - Internet Standard Subnetting Procedure中有一小句这样子的声明:
Since the bits that identify the subnet are specified by a bitmask, they need not be adjacent in the address. However, we recommend that the subnet bits be contiguous and located as the most significant bits of the local address.

然后在RFC 1219 - On the assignment of subnet numbers对RFC 950其中的子网号设定作了一些补充,在这里就可以看到对RFC 950的一些总结:
RFC-950 [2] specifies a procedure for subnetting Internet addresses using a bit-mask.  While RFC-950 allows the "ones" in the subnet mask to be non-contiguous, RFC-950 recommends that 1) they be contiguous, and 2) that they occupy the most significant bits of the "host" part of the internet address.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP