Chinaunix

标题: [DHCP]分配给客户端的掩码和服务器设置不一至的问题 [打印本页]

作者: chenyufan    时间: 2007-05-29 23:25
标题: [DHCP]分配给客户端的掩码和服务器设置不一至的问题
由于之前到dhcp服务器一直丢包,于是我尝试将子网划小,从原来的192.168.1.0/24划分成192.168.1.0/26,没想到还真解决了,但是发现个问题就是dhcp客户端获取到的子网掩码还是255.255.255.0,而不是255.255.255.192,虽然没有什么问题,但本着求知的精神,特发帖向老师们请教一下。

系统环境:
---------------------------------
Centos 4.4 (2.6.9-42.0.10.EL)
dhcp-3.0.1-59.EL4(PS:yum install dchp而来)


网卡设置:
---------------------------------
DEVICE=eth2
BOOTPROTO=static
BROADCAST=192.168.1.63
HWADDR=000:B7:A7:7D:28
IPADDR=192.168.1.1
NETMASK=255.255.255.192
NETWORK=192.168.1.0
ONBOOT=yes
TYPE=Ethernet

DHCP设置:
---------------------------------
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.192 {
# --- default gateway
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;
        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      192.168.1.4;
        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unle
ss
# -- you understand Netbios very well
#       option netbios-node-type 2;
        range dynamic-bootp 192.168.1.31 192.168.1.62;
        default-lease-time 259200;
        max-lease-time 518400;
        # we want the nameserver to appear at a fixed address
        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 00:30:48:20:15:e6;
                fixed-address 192.168.1.2;
        }
}

某一客户端获取到的IP信息:
---------------------------------
Ethernet adapter 本地连接:
        Connection-specific DNS Suffix  . : domain.org
        Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
        Physical Address. . . . . . . . . : 00-11-09-FB-64-DE
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.50
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 192.168.1.4
        Lease Obtained. . . . . . . . . . : 2007年5月28日 15:04:45
        Lease Expires . . . . . . . . . . : 2007年5月31日 15:04:45

[ 本帖最后由 chenyufan 于 2007-5-29 23:28 编辑 ]
作者: zhangzijian    时间: 2007-05-29 23:43
subnet 192.168.1.0 netmask 255.255.255.0{
option routers 192.168.1.1;
range 192.168.1.10 192.168.1.50;
option domain-name-servers      192.168.1.4;
}
作者: chenyufan    时间: 2007-05-30 11:38
谢谢子坚兄来回复。通过把
option subnet-mask              255.255.255.0;
修改成
option subnet-mask              255.255.255.192;
后,问题解决。之前一直误以为只要修改subnet 处就可以了。下面的配置就没仔细看了。

是我眼水不好。
作者: chenyufan    时间: 2007-05-30 11:39
说点题外话,之前了解你一直在搞群集,最近我有个项目需要用到oracle双机,到时在QQ上向你请教一下。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2