ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂDHCP·þÎñʵս

·¢²¼Ê±¼ä:2006-01-24 09:38:40À´Ô´:ºìÁª×÷Õß:cooc
ÎÒÃÇÖªµÀdhcp ¾ÍÊǶ¯Ì¬ip µØÖ··ÖÅä·þÎñÀ­£¡ÔÚÒ»¸öÍøÂçÖУ¬Èç¹ûµçÄÔ²»ÊÇºÜ ¶àµÄÇé¿öÏ£¬ÎÒÃÇÒ»°ã¶¼ÊÇÊÖ¶¯¸øÿ¸öµçÄÔ·ÖÅäipµØÖ·µÈһЩÍøÂçµÄÉ趨¡£Èç¹ûÒ»¸öÍøÂçÖÐÓÐÉÏ°Ų̀µçÄÔ£¬ÎÒÃÇҲҪһ̨̨ÅÜÈ¥É趨ËûÃǵÄip µØÖ· £¬ÄÇÑùÎÒÏëÈ˶¼»áÉèÖõÄÍ·»è »¹µÃÉÏ´®ÏÂÌøµÄµ½´¦ÅÜ¡£±¾È˵Ĺ«Ë¾ÊÇС¹«Ë¾ Ö»ÓÐ10¼¸Ì¨µçÄÔ£¬ÎÒºÜÀÁËùÒÔÓÃlinuxÅäÖÃÁËdhcp¶¯Ì¬·ÖÅäipµØÖ·µÄ·þÎñ£¡
Ò»°ãÀ´ËµÎÒÃÇÔÚ°²×°linuxʱÈç¹ûÑ¡ÁËeverything£¬ÄÇôÄãµÄdhcpÒ²¾ÍÓÐÁË¡£ÕæºÃ°¡~£¡µ«ÊÇÄãÏëÒªËü Äܹ»Õý³£¹¤×÷ÆðÀ´ £¬ÄÇ»¹µÃÄã×Ô¼º¶¯¶¯ÊÖ¡£
DHCPdºǫ́³ÌÐò×ÜÊǶÁÈ¡ÅäÖÃÎļþ/etc/dhcpd.conf, ÏÂÃæ¸ø³öÒ»ÎÒÖ÷»úÉϵÄDHCPÅäÖÃÎļþµÄÀý×Ó£º
ddns-update-style interim;
ignore client-updates;

subnet 192.168.25.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.25.15;
option subnet-mask 255.255.255.0;

# option nis-domain "uc88.domain";
option domain-name "uc88.domain";
option domain-name-servers 202.96.128.68,192.168.25.15;

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 unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.25.100 192.168.25.254;
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 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}

ÉÏÃæµÄÒâ˼ÊÇ£º
ÓÃ255.255.255.0×÷Ϊ×ÓÍøÑÚÂ룬ÓÃ192.168.25.255×÷Ϊ¹ã²¥µØÖ·£¬ÓÃ192.168.25.15×÷Ϊ
ĬÈÏÍø¹Ø£¬ÓÃ202.96.128.68 and 192.168.25.15×÷ΪDNS·þÎñÆ÷ ½«·ÖÅäµØÖ·µÄ·¶Î§ÊÇ£º192.168.25.100-192.168.25.254

±£´æÍ˳ö

ËÄ. ´ó¶àÊýÇé¿öÏ£¬DHCPµÄ°²×°²»´´½¨Ò»¸ödhcpd.leases Îļþ£¬ÔÚÄãÆô¶¯DHCP·þÎñÆ÷֮ǰ£¬Äã±ØÐë´´½¨¿ÕÎļþ dhcpd.leases

#touch /var/state/dhcp/dhcpd.leases
ΪÆô¶¯DHCP·þÎñÆ÷£¬¼òµ¥µØ´òÈë /usr/sbin/dhcpd »òÕßÓÃ#ntsysv°ÑDHCP·þÎñ×Ô¶¯Æô¶¯

Õ⽫Æô¶¯dhcpdÔÚeth0É豸ÉÏ£¬Èç¹ûÄãÏëÔÚeth1É豸ÉÏÆô¶¯dhcpd£¬Ôò
#/usr/sbin/dhcpd eth1


************
ÎҵĽÌѵ~£¡ÎÒ×÷ºÃºó dhcpÒ²Õý³£Æô¶¯·þÎñÁË~£¡µ«ÊÇÔÚÆäËû98¿Í»§»úÉÏ Æô¶¯×Ô¶¯»ñµÃipµØÖ· ¶¼²»ÐÐ ~£¡Ã¦ÁËÒ»ÌìÖÕÓÚ ·¢ÏÖÔ­Òò£¬Ô­À´ÍøÂçÉÏÓÐһ̨win2000Ò²ÔÚͬʱÔËÐÐdhcp·þÎñ£¬Õæ¸ÃËÀ~£¡°Ñwin2000µÄ dhcpÍ£µô¾ÍºÃÁË~£¡


ÈçºÎ¹Û²ì¿Í»§µÄipµ½µ×ÓÐûÓлñµÃÄØ£¿
ÔÚ98ÔËÐÐwinipcfg
ÔÚ2000 ÏÂÔËÐÐipconfig /all
¾ÍÒ»Çå¶þ³þÀ­£¡
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ