[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=00:D0: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 編輯 ]
《解決方案》
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;
}
《解決方案》
謝謝子堅兄來回復。通過把
option subnet-mask 255.255.255.0;
修改成
option subnet-mask 255.255.255.192;
后,問題解決。之前一直誤以為只要修改subnet 處就可以了。下面的配置就沒仔細看了。
是我眼水不好。:oops:
《解決方案》
說點題外話,之前了解你一直在搞群集,最近我有個項目需要用到oracle雙機,到時在QQ上向你請教一下。