免费注册 查看新帖 |

Chinaunix

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

怪异!在netmasks文件中修改了掩码不生效 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-01-09 19:11 |只看该作者 |倒序浏览
请各位高手给小弟指点一下,问什么我在netmasks文件中设置的ip 10.6.75.161的掩码为255.255.255.128不生效,重启机器后,用ifconfig -a查看,掩码却是255.0.0.0。相关配置文件如下:
root@I2000 # ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.6.75.161 netmask ffffff80 broadcast 10.255.255.255   
        ether 0:3:ba:9b:54:df     (红色的部分一重新启动就变成ff000000了,现在之所以正确,是我用命令ifconfig ce0 netmask 255.255.255.128改的//the red part is that I use command “ifconfig ce0 netmask 255.255.255.128” to realize,but it is not permanent )
root@I2000 # cd /etc
root@I2000 # ls hostname*
hostname.ce0
root@I2000 # more hostname.ce0
I2000
root@I2000 # cd /etc/inet
root@I2000 # more hosts
#
# Internet host table
#
127.0.0.1       localhost
10.6.75.161     I2000   loghost
root@I2000 # cd /etc
root@I2000 # more netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.  Currently this number is restricted to being a class
# A, B, or C network number.  In the future we should be able to support
# arbitrary network numbers per the Classless Internet Domain Routing
# guidelines.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
#
10.6.75.0       255.255.255.128
root@I2000 # more /etc/defaultrouter
10.6.75.147
root@I2000 #

论坛徽章:
0
2 [报告]
发表于 2007-01-09 19:49 |只看该作者
10.6.75.128  255.255.255.128
不是
10.6.75.0       255.255.255.128

论坛徽章:
0
3 [报告]
发表于 2007-01-09 19:57 |只看该作者
楼上的,楼主的设置好象没有错误,netmasks文件中 掩码前的 是网段 不是IP!  应该是这样的!呵呵

论坛徽章:
0
4 [报告]
发表于 2007-01-09 21:11 |只看该作者
10.6.75.0       255.255.255.128


该成
10.6.75.128    255.255.255.128


jindui1说的应该是对的

论坛徽章:
0
5 [报告]
发表于 2007-01-09 21:32 |只看该作者
10.6.75.128 也是网段,并不是单一IP

论坛徽章:
0
6 [报告]
发表于 2007-01-10 13:20 |只看该作者
谢谢jindui1,huanglao2002,C.Arthur改成10.6.75.128就好了。

论坛徽章:
0
7 [报告]
发表于 2007-01-10 13:32 |只看该作者
我只是没注意么,楼主这么吝啬只谢他们三个人?我也帮着分析了阿!555555555

论坛徽章:
0
8 [报告]
发表于 2007-01-10 14:09 |只看该作者
掩码和网段要对应上,才可以生效.

论坛徽章:
0
9 [报告]
发表于 2007-01-10 14:57 |只看该作者
为何我这样设置也没有问题,很正常
vi /etc/netmask
10.96.68.0        255.255.255.192

论坛徽章:
0
10 [报告]
发表于 2007-01-10 16:10 |只看该作者
原帖由 coollinn 于 2007-1-10 14:57 发表
为何我这样设置也没有问题,很正常
vi /etc/netmask
10.96.68.0        255.255.255.192

因为你主机的IP地址就在这个段里面.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP