
DHCP mini-HOWTO

Vladimir Vuksan

               vuksan@veus.hr
    

戝怷曐塸 - 擔杮岅東栿

               dasen@icntv.ne.jp
            
Revision History                                                       
Revision v4.12       October 22, 2000           Revised by: vv         

偙偺暥彂偼丄Linux 儅僔儞傪 DHCP 僒乕僶傗 DHCP 僋儔僀傾儞僩偵偡傞曽朄偵
偮偄偰丄婎杮揑側幙栤偵摎偊傞傕偺偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

Table of Contents
1. 偼偠傔偵
    1.1. 傛偔偁傞柶愑忦審
    1.2. 偙偺暥彂偺嵟怴斉
    1.3. 僼傿乕僪僶僢僋
    1.4. 峷專幰
    1.5. 挊嶌尃偵娭偡傞忣曬
   
   
2. DHCP 僾儘僩僐儖
3. 僋儔僀傾儞僩偺愝掕
    3.1. 僋儔僀傾儞僩僨乕儌儞 (dhcpcd) 偺僟僂儞儘乕僪
    3.2. Slackware
    3.3. RedHat 6.x 偍傛傃 Mandrake 6.x
    3.4. RedHat 5.x
    3.5. RedHat 4.x 偍傛傃 Caldera OpenLinux 1.1/1.2
    3.6. Debian
    3.7. LinuxPPC 偍傛傃 MkLinux
    3.8. 嵟廔愝掕
    3.9. 嶨懡側拲堄
    3.10. 僩儔僽儖僔儏乕僥傿儞僌
    3.11. 傕偆堦偮偺 DHCP 僋儔僀傾儞僩 (ISC dhclient)
   
   
4. DHCP 僒乕僶偺僙僢僩傾僢僾
    4.1. UNIX 梡偺 DHCP 僒乕僶
    4.2. DHCP 僒乕僶偺愝掕
    4.3. DHCPd 偺僆僾僔儑儞
    4.4. 僒乕僶傪婲摦偡傞
    4.5. 偦偺懠偺嫽枴怺偄暥彂
   
   
Appendix A. 擔杮岅栿偵偮偄偰

1. 偼偠傔偵

1.1. 傛偔偁傞柶愑忦審

No liability for the contents of this documents can be accepted. Use
the concepts, examples and other content at your own risk. As this is a
new edition of this document, there may be errors and inaccuracies,
that may of course be damaging to your system. Proceed with caution,
and although this is highly unlikely, I don't take any responsibility
for that.

偙偺暥彂偺撪梕偵娭偟偰偼堦愗柍曐徹偱偡丅奣擮丒椺丒偦偺懠慡偰撉幰偺愑擟
偺傕偲偵偛棙梡偔偩偝偄丅尰嵼偺斉偼怴偟偄偺偱丄娫堘偄傗晄惓妋側晹暘偑偁
傞偐傕偟傟傑偣傫丅偦傟偵傛偭偰偁側偨偺僔僗僥儉偵忈奞偑婲偒傞偐傕偟傟傑
偣傫丅婥傪偮偗偰嶌嬈偟偰偔偩偝偄丅偁傑傝偦偆偄偆偙偲偼側偄偲偼巚偄傑偡
偑丄巹偼偦偺傛偆側忈奞偵懳偟偰堦愗愑擟傪晧偄傑偣傫丅

Also bear in mind that this is NOT official information. Much content
in this document are assumptions, which appear to work for people. Use
the information at your own risk.

傑偨丄偙傟偼僆僼傿僔儍儖側忣曬偱偼側偄偙偲傕怱偵偲傔偰偍偄偰偔偩偝偄丅
偙偺暥彂偺撪梕偼偁傞堄枴壖掕偱偡 (偨偩偟懡偔偺恖乆偺娐嫬偱摦嶌偟偰偼偄
傑偡)丅忣曬偼偁側偨偺愑擟偺傕偲偵偛棙梡偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

1.2. 偙偺暥彂偺嵟怴斉

偙偺暥彂偺嵟怴斉偼師偵宖偘傞儕儞僋偐傜擖庤壜擻偱偡丅

http://www.oswg.org/oswg-nightly/DHCP.html

DHCP mini-HOWTO 偺東栿斉偼師偵宖偘傞儕儞僋偐傜擖庤壜擻偱偡丅

 丒 拞崙岅 - http://www.linux.org.tw/CLDP/mini/DHCP.html
   
 丒 擔杮岅 - http://www.linux.or.jp/JF/JFdocs/DHCP/index.html
   
 丒 僗儁僀儞岅 - ftp://cuates.pue.upaep.mx/pub/linux/LuCAS/
    DHCP-mini-Como/
   

偙偺暥彂偺懠偺尵岅傊偺東栿偼帺桼偲偟傑偡丅偨偩偙偺僆儕僕僫儖暥彂傊栠傞
儕儞僋傪偦偺東栿拞偵帵偟偰偄偨偩偔偙偲丄偍傛傃東栿斉偺 URL 傪偍抦傜偣偔
偩偝傞偙偲丄傪偍婅偄偟偨偄偲巚偄傑偡丅屻幰偼偙偺暥彂偵東栿傊偺儕儞僋傪
捛壛偱偒傞傛偆偵偡傞偨傔偱偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

1.3. 僼傿乕僪僶僢僋

偙偺暥彂偵娭偡傞僼傿乕僪僶僢僋偼傕偪傠傫戝娊寎偱偡丅偁側偨偺嫤椡偲忣曬
採嫙偑側偗傟偽丄偙偺暥彂偼懚懕偱偒傑偣傫丅捛婰丒僐儊儞僩丒斸敾側偳傪 <
vuksan-feedback@veus.hr> 傑偱憲偭偰偔偩偝偄丅

栿拲: 擔杮岅栿偵娭偡傞僐儊儞僩偼偙偙傪撉傫偱憲偭偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

1.4. 峷專幰

偙偺暥彂偼 Paul Makeev 偵傛傞僆儕僕僫儖斉傪廋惓偟偰偱偒偨傕偺偱偡丅

栿拲: 擔杮岅栿偵娭偟偰偼丄拞栰仐惉纥戝偝傫偺東栿傪丄戝怷曐塸偑 DocBook
斉 v4.12 偵捛廬偝偣偰偱偒偨傕偺偱偡丅

埲壓偺曽乆偑偙偺 mini-HOWTO 偵峷專偟偰偔偩偝偄傑偟偨丅

 丒 Heiko Schlittermann
   
 丒 Jonathan Smith
   
 丒 Dan Khabaza
   
 丒 Hal Sadofsky
   
 丒 Henrik Stoerner
   
 丒 Paul Rossington
   
 丒 numerous others
   

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

1.5. 挊嶌尃偵娭偡傞忣曬

This document is copyrighted (c) 1998 Vladimir Vuksan and distributed
under the terms of the OpenContent License (OPL). Full text of the
license can be found at

http://www.opencontent.org/opl.shtml

偙偺暥彂偺挊嶌尃偼 (c)1998 Vladimir Vuksan 偵偁傝丄 the OpenContent
License (OPL) 偵婎偯偄偰攝晍偱偒傑偡丅儔僀僙儞僗暥彂偺慡暥偼丄忋宖偺儕
儞僋偐傜棙梡壜擻偱偡丅

栿拲: 擔杮岅栿偺挊嶌尃偼 (c)1999 Takeo Nakano, (c)2001 Yasuhide OOMORI
偵偁傝傑偡丅嵞攝晍偺忦審偼忋婰僆儕僕僫儖偵弨偠傞傕偺偲偟傑偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2. DHCP 僾儘僩僐儖

  DHCP 偲偼 Dynamic Host Configuration Protocol 偺偙偲偱偡丅偙傟偼儂僗
僩 (摦嶌拞偺僋儔僀傾儞僩) 偵梌偊傜傟傞僱僢僩儚乕僋偺僷儔儊乕僞傪丄僒乕
僶傪棙梡偟偰摦揑偵惂屼偡傞偨傔偵梡偄傜傟傑偡丅 DHCP 偼 BOOTP 偵懳偟偰屻
曽屳姺 (backward compatible) 偱偡丅傛傝徻偟偄忣曬偼 RFC 2131 (埲慜偼
RFC 1541 偱偟偨) 側偳傪尒偰偔偩偝偄丅

栿拲: RFC 偺崙撪儈儔乕僒僀僩偲偟偰偼丄

 丒 ftp://ftp.ring.gr.jp/pub/doc/RFC/rfc2131.txt
   
 丒 ftp://ftp.ring.gr.jp/pub/doc/RFC/rfc1541.txt
   

偑偁傝傑偡丅

http://web.syr.edu/~jmwobus/comfaqs/dhcp.faq.html 傕嶲峫偵側傞偱偟傚偆
丅

偙偺 mini-HOWTO 偼 DHCP 乽僒乕僶乿僨乕儌儞偲 DHCP 乽僋儔僀傾儞僩乿僨乕
儌儞偺椉曽傪埖偄傑偡丅懡偔偺恖偑昁梫偲偟偰偄傞偺偼僋儔僀傾儞僩僨乕儌儞
偱偟傚偆丅偙傟偼儚乕僋僗僥乕僔儑儞偑儕儌乕僩僒乕僶偐傜僱僢僩儚乕僋偺忣
曬傪庢摼偡傞偨傔偵梡偄傜傟傑偡丅僒乕僶僨乕儌儞偼僔僗僥儉娗棟幰偑僱僢僩
儚乕僋偺忣曬傪僋儔僀傾儞僩偵攝晍偡傞偨傔偵梡偄傜傟傑偡丅偱偡偐傜丄晛捠
偺儐乕僓偑昁梫偲偟偰偄傞偺偼乽僋儔僀傾儞僩乿僨乕儌儞偺偼偢偱偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3. 僋儔僀傾儞僩偺愝掕

尰嵼 Linux 偱偼丄3偮偺堎側傞 DHCP 僋儔僀傾儞僩僾儘僌儔儉偑偁傝傑偡丅
dhcpcd, pump 偲 dhclient 偱偡丅偙偺 mini-HOWTO 偱偼丄庡偵 dhcpcd 傪庢傝
埖偄傑偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.1. 僋儔僀傾儞僩僨乕儌儞 (dhcpcd) 偺僟僂儞儘乕僪

偍巊偄偺僨傿僗僩儕價儏乕僔儑儞偵傛偭偰偼丄 DHCP 僋儔僀傾儞僩僨乕儌儞傪
僟僂儞儘乕僪偡傞昁梫偑偁傞偐傕偟傟傑偣傫丅僜乕僗偐傜僐儞僷僀儖偟偨偄偺
偱偁傟偽丄昁梫側僷僢働乕僕偼 dhcpcd 偲屇偽傟傞傕偺偱丄尰嵼偺嵟怴斉偼
1.3.18 偱偡丅 Sergei Viznyuk <sergei@phystech.com> 偑儊儞僥僫儞僗偟偰偍
傝丄崱擔偱偼懡偔偺僨傿僗僩儕價儏乕僔儑儞偱僶僀僫儕僷僢働乕僕偑廂榐偝傟
偰偄傑偡丅

dhcpcd 偺僜乕僗偼師偺応強偐傜僟僂儞儘乕僪偱偒傑偡丅

 丒 ftp://ftp.phystech.com/pub/ (Primary site)
   
 丒 http://www.cps.msu.edu/~dunham/out/
   

僟僂儞儘乕僪偟偨傜丄埲壓偺巜帵偵廬偭偰偔偩偝偄丅偳偪傜偺儕儞僋偐傜傕摨
偠傕偺偑擖庤壜擻側偼偢偱偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.2. Slackware

嵟怴斉偺 DHCPcd 偼 metalab 偺儈儔乕偐傜丄偁傞偄偼埲壓偐傜僟僂儞儘乕僪偱
偒傑偡丅

 丒 ftp://metalab.unc.edu/pub/Linux/system/network/daemons
   
 丒 ftp://ftp.phystech.com/pub/ (Primary site)
   
 丒 ftp://ftp.kobe-u.ac.jp/pub/PC-UNIX/Linux/network/dhcp/ (Primary
    site in Japan)
   

嵟怴斉偺 dhcpcd.tar.gz 傪僟僂儞儘乕僪偟傑偟傚偆丅

 丒 揥奐偟傑偡丅
   
    tar -zxvf dhcpcd-1.3.18pl1.tar.gz
   
 丒 僨傿儗僋僩儕偵擖偭偰 dhcpcd 傪 make 偟傑偡丅
   
    cd dhcpcd-1.3.18pl1
   
    make
   
 丒 僀儞僗僩乕儖偟傑偡 (埲壓偺僐儅儞僪偼 root 偱幚峴偡傞昁梫偑偁傝傑
    偡)
   
    make install
   

/etc/dhcpc 偲偄偆僨傿儗僋僩儕偑偱偒傑偡丅 DHCPcd 偼偙偙偵 DHCP 忣曬傪曐
懚偟傑偡丅 dhcpcd 偼 /usr/sbin 偵僐僺乕偝傟傑偡丅

僽乕僩帪偵 DHCP 傪棙梡偟偰僔僗僥儉偺弶婜壔傪峴偆偵偼丄埲壓偺傛偆偵擖椡
偟傑偡丅

cd /etc/rc.d

mv rc.inet1 rc.inet1.OLD

屆偄僱僢僩儚乕僋弶婜壔僗僋儕僾僩傪 rc.inet1.OLD 偵儕僱乕儉偟傑偡丅偙偙
偱怴偟偄 rc.inet1 僗僋儕僾僩傪嶌惉偡傞昁梫偑偁傝傑偡丅埲壓偺僐乕僪偱 OK
偱偟傚偆丅
#!/bin/sh                                                                    
#                                                                            
# rc.inet1      This shell script boots up the base INET system.             
                                                                             
HOSTNAME=`cat /etc/HOSTNAME` #This is probably not necessary but I           
                             #will leave it in anyways                       
                                                                             
# Attach the loopback device.                                                
/sbin/ifconfig lo 127.0.0.1                                                  
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo                          
                                                                             
# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the 
# eth0 interface. If you're only using loopback or SLIP, don't include the   
# rest of the lines in this file.                                            
                                                                             
/usr/sbin/dhcpcd                                                             

曐懚偟偰僐儞僺儏乕僞傪嵞婲摦偟傑偟傚偆丅

廔傢偭偨傜嵟廔愝掕偵恑傒傑偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.3. RedHat 6.x 偍傛傃 Mandrake 6.x

RedHat 6.0+ 偵偍偗傞 DHCPcd 偺愝掕偼偲偰傕娙扨偱偡丅傑偢 control-panel
僐儅儞僪偱僐儞僩儘乕儖僷僱儖傪婲摦偟傑偡丅

 丒 "Network Configuration" 傪慖傃傑偡丅
   
 丒 Click on Interfaces
   
 丒 Add 傪僋儕僢僋偟傑偡丅
   
 丒 Ethernet 傪慖傃傑偡丅
   
 丒 Edit Ethernet/Bus Interface 偐傜 "Activate interface at boot
    time" 傪慖傃丄"Interface configuration protocol" 偲偟偰 "DHCP" 傪慖
    傃傑偡丅
   

RedHat 6.x 偱偼丄忋婰偺 dhcpcd 偱偼側偔丄pump 偑昗弨偺 DHCP 僋儔僀傾儞
僩偲偟偰摨崼偝傟偰偄傞偙偲偵婥傪偮偗偰偔偩偝偄丅CD-ROM 偵偼 dhcpcd 偺
rpm 傕娷傑傟偰偄傞偺偱丄pump 偱偆傑偔偄偐側偐偭偨傜 dhcpcd 偱帋偟偰傒傑
偟傚偆丅dhcpcd 傪 (椺偊偽 rpm -i dhcpcd-1.3.17pl2-1.i386.rpm 偺傛偆偵)
僀儞僗僩乕儖偟偨傜丄廋惓偑昁梫偵側傝傑偡丅

Alexander Stevenson <alexander.stevenson@home.com> 偵傛傞捛壛忣曬傪埲壓
偵帵偟傑偡丅
   
   
    DHCPcd 偱偼慡偔偆傑偔偄偒傑偣傫偱偟偨丅寢嬊栶偵棫偭偨偺偼 Mandrake
    6.0 摨崼偺 (偨傇傫 RedHat 偵傕偁傞偲巚偆) "pump" 偱偟偨丅巹偑巊偭偨
    僐儅儞僪傪埲壓偵帵偟傑偡丅
   
    pump -i eth0 -h hostname
   
    "hostname" 偼壗偱傕峔偄傑偣傫偱偟偨偑丄偲偵偐偔偙傟偑側偄偲僒乕僶偼
    斀墳傪帵偟傑偣傫偱偟偨丅
   
    偦傟偐傜丄/sbin/ifup 僗僋儕僾僩偵曄峏傪壛偊丄愝掕傪斀塮偝偣傑偟偨丅
    昗弨偺僶乕僕儑儞偱偼 -h 僆僾僔儑儞偑側偐偭偨偺偱丄偆傑偔摦偒傑偣傫
    偱偟偨丅
   
    婎杮揑偵丄linuxconf 傪巊偭偰偄傞偺偱偁傟偽丄傾僟僾僞偺愝掕傪 "DHCP"
    偵偟偰傕摦偐側偄応崌偵偼丄 /sbin/ifup 偺僗僋儕僾僩偺 pump 偺峴偵 "
    -h hostname" 偲偄偆僆僾僔儑儞傪捛壛偟偰傒傞偲偄偄偺偱偼側偄偱偟傚偆
    偐丅巹偼僗僋儕僾僩傪師偺傛偆偵廋惓偟傑偟偨丅
    ...                                                                
    if [ -n "$PUMP" ]; then                                            
        echo -n "Determining IP information for $DEVICE..."            
        if /sbin/pump -i $DEVICE -h hostname; then                     
            echo " done."                                              
        else                                                           
            echo " failed."                                            
            exit 1                                                     
        fi                                                             
    else ...                                                           

傕偆堦偮偺丄傛傝僄儗僈儞僩偵儂僗僩柤傪愝掕偡傞曽朄偑 Aad van der Klaauw
偐傜婑偣傜傟傑偟偨丅埲壓偵帵偟傑偡丅
   
   
    偄傑帺戭偺僎乕僩僂僃僀僔僗僥儉傪愝掕偟偰偄傞傫偱偡偑丄 MAC 傾僪儗僗
    傪僙僢僩偟偰 '-h hostname' 傪桳岠偵偡傞昁梫偑偁傝傑偟偨丅偦偺偨傔偵
    丄僗僋儕僾僩傪乽曄峏偣偢偵乿丄愝掕僼傽僀儖傪巊偆偙偲偵偟傑偟偨丅 /
    etc/sysconfig/network-scripts/ifcfg-eth0 偵丄師偺傛偆側婰弎傪壛偊傑
    偟偨丅
    DEVICE="eth0"                                                      
    MACADDR="00:11:22:33:44:55"                                        
    DHCP_HOSTNAME="trigger_for_terayon"                                
   
    偙偪傜側傜傾僢僾僌儗乕僪偟偰傕愝掕偑巆傝傑偡偟丄巹偺抦傞尷傝偱偼乽
    尒捠偟偺椙偄乿曽朄偱偡丅

偙傟偱廔傢傝偱偡丅儅僔儞傪儕僽乕僩偡傞偐丄 /sbin/ifup eth0 傪僐儅儞僪儔
僀儞偱幚峴偟偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.4. RedHat 5.x

RedHat 5.0+ 偵偍偗傞 DHCPcd 偺愝掕偼偲偰傕娙扨偱偡丅傑偢 control-panel
僐儅儞僪偱僐儞僩儘乕儖僷僱儖傪婲摦偟傑偡丅

 丒 "Network Configuration" 傪慖傃傑偡丅
   
 丒 Click on Interfaces
   
 丒 Add 傪僋儕僢僋偟傑偡丅
   
 丒 Ethernet 傪慖傃傑偡丅
   
 丒 Edit Ethernet/Bus Interface 偐傜 "Activate interface at boot
    time" 傪慖傃丄"Interface configuration protocol" 偲偟偰 "DHCP" 傪慖
    傃傑偡丅
   

廔傢偭偨傜嵟廔愝掕偵恑傒傑偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.5. RedHat 4.x 偍傛傃 Caldera OpenLinux 1.1/1.2

DHCPcd 偼 RedHat 偺昗弨僨傿僗僩儕價儏乕僔儑儞偵 RPM 偲偟偰擖偭偰偄傑偡
丅僨傿僗僩儕價儏乕僔儑儞 CD-ROM 偺 RPMS 僨傿儗僋僩儕偵偁傞偱偟傚偆丅埲
壓偐傜僟僂儞儘乕僪偟偰傕偄偄偱偟傚偆丅

ftp://ftp.redhat.com/pub/redhat/redhat-4.2/i386/RedHat/RPMS/
dhcpcd-0.6-2.i386.rpm

師偺僐儅儞僪偱僀儞僗僩乕儖偟傑偟傚偆: rpm -i dhcpcd-0.6-2.i386.rpm

偁傞偄偼帺暘偺岲偒側僶乕僕儑儞傪庢偭偰偒偰丄Slackware 偺晹暘偱愢柧偟偨
傗傝曽偱僐儞僷僀儖偟偰傕偐傑偄傑偣傫丅

埲壓偺忣曬偼 nothing <nothing@cc.gatech.edu> 偐傜婑偣傜傟傑偟偨丅
   
   
    惷揑側 IP 傾僪儗僗偲柤慜傪 /etc/resolv.conf 偐傜庢傝彍偒傑偟偨丅偟
    偐偟 search 峴偲擇偮偺 nameserver 峴偼巆偟傑偟偨 (側偤偐巹偺 dhcpcd
    偼 /etc/dhcpc/resolv.conf 傪惗惉偟偰偔傟側偄偺偱丄惷揑側 /etc/
    resolv.conf 傪巊傢側偗傟偽側傝傑偣傫偱偟偨)丅
   
    /etc/sysconfig/network 偐傜偼 HOSTNAME, GATEWAY 偺僄儞僩儕傪嶍彍偟
    傑偟偨丅偦偺懠偺僄儞僩儕 (NETWORKING, DOMAINNAME, GATEWAYDEV) 偼偦
    偺傑傑巆偟傑偟偨丅
   
    /etc/sysconfig/network-scripts/ifcfg-eth0 偐傜偼 IPADDR, NETMASK,
    NETWORK, BROADCAST 偺僄儞僩儕傪嶍彍偟傑偟偨丅 DEVICE 偲 ONBOOT 偼偦
    偺傑傑巆偟傑偟偨丅 BOOTPROTO 峴偼 BOOTPROTO=dhcp 偲曄峏偟傑偟偨丅
   
    僼傽僀儖傪僙乕僽偟丄僐儞僺儏乕僞傪儕僽乕僩偟傑偟傚偆丅

廔傢偭偨傜嵟廔愝掕偵恑傒傑偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.6. Debian

DHCPcd 偺 deb 僷僢働乕僕偼埲壓偵偁傝傑偡丅dhcpcd 偱巒傑傞傕偺傪擖庤偟傑
偟傚偆丅

http://ftp.debian.org/debian/dists/slink/main/binary-i386/net/

偁傞偄偼 Slackware 偺傛偆偵帺暘偱僀儞僗僩乕儖偟偰傕偄偄偱偟傚偆丅

deb 僷僢働乕僕傪揥奐偡傞偵偼埲壓偺僐儅儞僪傪擖椡偟傑偡丅 dpkg -i /where
/ever/your/debian/packages/are/dhcpcd*deb

DHCPcd 梡偺愝掕偼摿偵昁梫側偄傛偆偱偡丅棟桼傪埲壓偵帵偟傑偡丅
        debian 僷僢働乕僕偼偩偄偨偄偦偆偱偡偑丄dhcpcd 僷僢働乕         
        僕傕僗僞乕僩傾僢僾僗僋儕僾僩傪 /etc/init.d/package_name        
        偵僀儞僗僩乕儖偟 (偙偙偱偼 /etc/init.d/dhcpcd 偱偡)丄偦        
        偟偰 /etc/rc?.d/ 僨傿儗僋僩儕偵丄昁梫側儕儞僋傪攝抲偟偰        
        偔傟傑偡丅                                                     
    --Heiko Schlittermann <heiko@os.inf.tu-dresden.de> 偵傛傞丅        

偟偨偑偭偰 /etc/rc?.d/ 僨傿儗僋僩儕偺撪梕偑僽乕僩帪偵幚峴偝傟傑偡丅

僀儞僗僩乕儖偟偰偐傜僐儞僺儏乕僞傪嵞婲摦偟側偄応崌偼丄師偺僐儅儞僪偵傛
偭偰庤摦偱僨乕儌儞傪婲摦偟偰傒偰偔偩偝偄丅 /etc/init.d/dhcpcd start

廔傢偭偨傜嵟廔愝掕偵恑傒傑偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.7. LinuxPPC 偍傛傃 MkLinux

埲壓偺撪梕偼 R. Shapiro 偵傛傞傕偺偱偡丅

"1999" (R5) 儕儕乕僗偱丄Linuxppc 偼丄傎傏姰慡偵 RedHat 6 屳姺偲側傝傑偟
偨丅偨偩偟堦偮寈崘偑偁傝傑偡(壓傪尒偰偔偩偝偄)丅偦傟埲奜偺揰偵偮偄偰偼
丄 RedHat 6.x 偍傛傃 Mandrake 6.x 偱偺愢柧偲摨偠偙偲偑偁偰偼傑傝傑偡丅

巆偭偰偄傞栤戣偼丄Redhat 6 偑昗弨偺 DHCP 僋儔僀傾儞僩偲偟偰巊偭偰偄傞
pump 偑丄Linuxppc 偱偼埨掕偟偰摦嶌偟側偄丄偲偄偆傕偺偱偡丅偙偺栤戣偵懳
張偡傞偵偼丄Sergei Viznyuk 偺儁乕僕偐傜嵟怴斉偺 dhcpcd 傪擖庤偟偰僀儞僗
僩乕儖偟丄/sbin/ifup 傪曇廤偟偰 pump 偺戙傢傝偵 dhcpcd 傪巊偆傛偆偵偡傞
昁梫偑偁傝傑偡丅
if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then               
     PUMP=true                                                         
 fi                                                                    
                                                                       
 if [ -n "$PUMP" ]; then                                               

偲偁傞晹暘傪丄
 if [  "$BOOTPROTO" = bootp ]; then                                    
       echo " done."                                                   
     else                                                              
       echo " failed."                                                 
       exit 1                                                          
     fi                                                                
 elif [ "$BOOTPROTO" = dhcp ]; then                                    
     echo -n "Determining IP information for $DEVICE..."               
     if /sbin/dhcpcd -d $DEVICE ; then                                 
       if [ -f /etc/dhcpc/dhcpcd-${DEVICE}.exe ]; then                 
           /etc/dhcpc/dhcpcd-${DEVICE}.exe                             
       fi                                                              

偲彂偒姺偊偰偔偩偝偄丅ifdown 偵傕偙傟偵懳墳偡傞廋惓偑昁梫偱偡丅
if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then               
....                                                                   
fi                                                                     

偲偁傞晹暘傪
if [ "$BOOTPROTO" = bootp ]; then                                      
fi                                                                     
                                                                       
if [ "$BOOTPROTO" = dhcp ]; then                                       
      if [ -f /var/run/dhcpcd-${DEVICE}.pid ]; then                    
              kill `cat /var/run/dhcpcd-${DEVICE}.pid`                 
              rm -f /var/run/dhcpcd-${DEVICE}.pid                      
      fi                                                               
fi                                                                     

偲彂偒姺偊傑偡丅

ppc 偱摦偔 dhcpcd 偺 rpm 偼 Linuxppc 1999 偵摨崼偝傟偰偄傑偡丅傕偆彮偟
怴偟偄 rpm 偑丄 ftp://ftp.linuxppc.org/ 偺 contrib 僨傿儗僋僩儕偵偁傝傑
偡丅Linuxppc 1999 偱僐儞僷僀儖偱偒傞僜乕僗偼 ftp://ftp.phystech.com/pub
/dhcpcd-1.3.17-pl9.tar.gz 偐傜擖庤壜擻偱偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.8. 嵟廔愝掕

儅僔儞傪嵞婲摦偟偨傜丄僱僢僩儚乕僋僀儞僞乕僼僃乕僗偼愝掕嵪傒偵側偭偰偄
傞偼偢偱偡丅ifconfig 僐儅儞僪傪幚峴偟傑偟傚偆丅

埲壓偺傛偆側昞帵偑弌傞偼偢偱偡丅
          lo        Link encap:Local Loopback                              
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0       
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1                
          RX packets:302 errors:0 dropped:0 overruns:0 frame:0             
          TX packets:302 errors:0 dropped:0 overruns:0 carrier:0 coll:0    
                                                                           
eth0      Link encap:Ethernet  HWaddr 00:20:AF:EE:05:45                    
          inet addr:24.128.53.102  Bcast:24.128.53.255  Mask:255.255.254.0 
          ^^^^^^^^^^^^^^^^^^^^^^^                                          
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1    
          RX packets:24783 errors:1 dropped:1 overruns:0 frame:1           
          TX packets:11598 errors:0 dropped:0 overruns:0 carrier:0 coll:96 
          Interrupt:10 Base address:0x300                                  

inet addr 偺偁偲偵捠忢偺斣崋偑弌偰偄傟偽 OK 偱偡丅 0.0.0.0 偑弌偰傕偑偭
偐傝偟側偄偱偔偩偝偄丄偙傟偼 dhcpcd 偑 IP 傾僪儗僗傪庢摼偡傞慜偺堦帪揑
側忬懺偱偡丅悢暘宱偭偰傕 0.0.0.0 偺傑傑偱偟偨傜丄僩儔僽儖僔儏乕僥傿儞僌
傪僠僃僢僋偟偰偔偩偝偄丅 DHCPcd 偼僨乕儌儞偱偡偐傜丄儅僔儞偺揹尮偑擖偭
偰偄傞尷傝嫃嵗傝懕偗傑偡丅 DHCPcd 偼 3 帪娫偍偒偵 DHCP 僒乕僶偵愙懕偟丄
怴偨側 IP 傾僪儗僗傪戄偟弌偟偰傕傜偍偆偲偟傑偡丅儊僢僙乕僕偼偡傋偰
syslog 偵曐懚偝傟傑偡 (Slackware 宯側傜 /var/adm/syslog, Redhat/
OpenLinux 側傜 /var/log/syslog 偱偡)丅

嵟屻偵傕偆堦偮丅僱乕儉僒乕僶傪巜掕偟側偗傟偽側傝傑偣傫丅偙傟偵偼擇偮偺
傗傝曽偑偁傝傑偡丅堦偮偼僾儘僶僀僟偵丄巊偭偰傕偐傑傢側偄僱乕儉僒乕僶偺
傾僪儗僗傪嫵偊偰傕傜偄丄偦傟傪 /etc/resolv.conf 偵彂偔曽朄丄傕偆堦偮偼
DHCPcd 偵 DHCP 僒乕僶偐傜儕僗僩傪庢摼偝偣丄/etc/dhcpc 偵 resolv.conf 傪
嶌惉偝偣傞曽朄偱偡丅

巹偼 DHCPcd 偺 resolv.conf 傪巊偆偙偲偵偟傑偟偨丅傗傝曽傪埲壓偵帵偟傑偡
丅

屆偄 /etc/resolv.conf 傪丄師偺僐儅儞僪傪幚峴偟偰僶僢僋傾僢僾偟傑偡丅 mv
/etc/resolv.conf /etc/resolv.conf.OLD

/etc/dhcpc僨傿儗僋僩儕偑側偗傟偽丄師偺僐儅儞僪傪幚峴偟偰嶌傝傑偡丅
mkdir /etc/dhcpc

/etc/dhcpc/resolv.conf 偐傜 /etc/resolv.conf傊偺儕儞僋傪嶌傝傑偡丅 ln
-s /etc/dhcpc/resolv.conf /etc/resolv.conf

忋婰偱偆傑偔偄偐側偄応崌偼埲壓傪帋偟偰偔偩偝偄 ( <nothing@cc.gatech.edu
> 偺巜揈傪庴偗偰廋惓偟傑偟偨丅傑偨 Henrik Stoerner 偐傜傕夵慞採埬傪偄偨
偩偒傑偟偨)丅

偙偺嵟廔僗僥僢僾傪峴傢側偗傟偽側傜側偐偭偨偺偼丄巹偺 dhcpcd 偑 /etc/
dhcpc/resolv.conf 傪嶌惉偟側偐偭偨偐傜偱偟偨丅巹偼 /etc/sysconfig/
network-scripts/ifup 偵埲壓偺廋惓傪峴偄傑偟偨 (旕忢偵忣偗側偄僴僢僋偱偡
偑丄巹偺偲偙傠偱偼偆傑偔摦偄偰偄傑偡)丅
elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then                      
    echo -n "Using DHCP for ${DEVICE}... "                                 
    /sbin/dhcpcd -c /etc/sysconfig/network-scripts/ifdhcpc-done ${DEVICE}  
    echo "echo \$$ > /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh 
                                                                           
    if [ -f /var/run/dhcp-wait-${DEVICE}.pid ]; then                       
        ^^^^                                                               
        echo "failed."                                                     
        exit 1                                                             

偙傟傪埲壓偺傛偆偵曄峏偟傑偟偨丅
elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then                      
    echo -n "Using DHCP for ${DEVICE}... "                                 
    /sbin/dhcpcd                                                           
    echo "echo \$$ > /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh 
                                                                           
    if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ]; then                     
        ^^^^^^                                                             
       echo "failed."                                                      
       exit 1                                                              
   
   
    Note: 拲堄偡傋偒偼 if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ]; 偺
    晹暘偺 ! (僄僋僗僋儔儊乕僔儑儞) 偱偡丅

偝偁丄偱偼惾偵栠偭偰妝偟傒傑偟傚偆 :-)
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.9. 嶨懡側拲堄

埲壓偺僗僥僢僾偼杮棃晄梫偱偡偑丄栶偵棫偮恖傕偄傞偱偟傚偆丅

 a. 僱僢僩儚乕僋愙懕傪帪乆偟偐昁梫偲偟側偄側傜丄 dhcpcd 傪僐儅儞僪儔僀儞
    偐傜婲摦偡傞帠傕偱偒傑偡 (root 尃尷偑昁梫偱偡)丅埲壓傪幚峴偟傑偡丅
    /usr/sbin/dhcpcd
   
    僱僢僩儚乕僋傪愗抐偡傞偲偒偵偼埲壓傪幚峴偟傑偡丅 /usr/sbin/dhcpcd
    -k
   

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10. 僩儔僽儖僔儏乕僥傿儞僌

偙傟傑偱弎傋偰偒偨僗僥僢僾傪惓偟偔偨偳偭偰傕僱僢僩儚乕僋傾僋僙僗偑偱偒
側偄応崌偵偼丄偄偔偮偐偺棟桼偑峫偊傜傟傑偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.1. 僱僢僩儚乕僋僇乕僪偑惓偟偔愝掕偝傟偰偄側偄

僽乕僩傾僢僾偺僾儘僙僗偱丄 Linux 偼僱僢僩儚乕僋僇乕僪傪僾儘乕僽偟偰埲壓
偺傛偆側峴傪弌椡偡傞偼偢偱偡丅
eth0: 3c509 at 0x300 tag 1, 10baseT port, address  00 20 af ee 11 11, IRQ 10. 
3c509.c:1.07 6/15/95 becker@cesdis.gsfc.nasa.gov                              

偙偺傛偆側儊僢僙乕僕偑尰傟側偄応崌偼丄偁側偨偺 Linux 僔僗僥儉偱偼
Ethernet 僇乕僪偑擣幆偝傟偰偄傑偣傫丅堦斒揑側 Ethernet 僇乕僪 (NE2000
僋儘乕儞側偳) 傪巊偭偰偄傞応崌偼丄僇乕僪愝掕梡偺 DOS 儐乕僥傿儕僥傿偺擖
偭偨僨傿僗僋偑偁傞偼偢偱偡丅 Linux 偑僇乕僪傪擣幆偡傞傑偱丄IRQ 傪曄偊偰
偄偭偰傒傑偟傚偆 (IRQ 9, 10, 12 側偳側傜捠忢偼椙偄偼偢偱偡)丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.2. DHCP 僒乕僶偑 RFC1541 弨嫆偱偁傞/DHCP 僒乕僶偑 Windows NT 偱偁
傞

dhcpcd 傪丄dhcpcd -r 偲僞僀僾偟偰幚峴偟偰傒傑偟傚偆丅

ifconfig 傪梡偄偰僱僢僩儚乕僋僀儞僞乕僼僃乕僗偑惓偟偔愝掕偝傟偨偐僠僃僢
僋偟偰傒傑偟傚偆 (愝掕偺僾儘僙僗偵偼悢昩偐偐傝傑偡丅嵟弶偼 Inet.addr=
0.0.0.0 偲尵偭偰偒傑偡)丅

偙傟偱夝寛偟偨傜丄僽乕僩傾僢僾僗僋儕僾僩偵傕 "-r" 僼儔僌傪壛偊傑偟傚偆
丅偮傑傝 /sbin/dhcpcd 偺偐傢傝偵 /sbin/dhcpcd -r 偺傛偆偵偟傑偟傚偆丅

椺偊偽 RedHat 側傜丄 /etc/sysconfig/network-scripts/ifup 僗僋儕僾僩傪曇
廤偟偰埲壓偺傛偆偵偟傑偟傚偆丅
        IFNAME=$[ {DEVICE} \                                           
        "/sbin/dhcpcd -r -c /etc/"- etc etc.                           
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.3. 僽乕僩傾僢僾偺嵟拞偵 "Using DHCP for eth0 ... failed" 偲偄偆儊
僢僙乕僕偑弌傞偺偱偡偑丄僔僗僥儉偼偆傑偔摦偄偰偄傑偡丅

偍偦傜偔 RedHat 傪偍巊偄偱丄愢柧傪拲堄怺偔偨偳偭偰棃傑偣傫偱偟偨偹 :-)
丅 if 暥偺 ! (僄僋僗僋儔儊乕僔儑儞) 偑敳偗偰偄傞偺偱偟傚偆丅偙偙偵栠偭
偰廋惓曽朄傪僠僃僢僋偡傞偙偲丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.4. 悢暘偼偪傖傫偲僱僢僩儚乕僋偑摦嶌偡傞偺偱偡偑丄偦偺偁偲斀墳偟側
偔側偭偰偟傑偄傑偡丅

gated (僎乕僩僂僃僀僨乕儌儞) 偑 Linux 儅僔儞偺儖乕僥傿儞僌傪夡偟偰偟傑
偄丄偙偺傛偆側栤戣傪堷偒婲偙偡偙偲偑偁傞偦偆偱偡丅 gated 偑婲摦偟偰偄側
偄偐偳偆偐傪丄師偺僐儅儞僪偱妋擣偟偰偔偩偝偄丅 ps -auxww | grep gate

偁偭偨応崌偼 RedHat 偺 RPM 儅僱乕僕儍偱嶍彍偡傞偐丄 /etc/rc.d/ 偺僄儞僩
儕傪嶍彍偟傑偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.5. 僽乕僩傾僢僾偺偲偒偵偼 Ethernet 僇乕僪偼擣幆偝傟偰偄傞偺偵丄
"NO DHCPOFFER" 儊僢僙乕僕偑儘僌偵巆傝傑偡丅 PCMCIA 偺 Ethernet 僇乕僪側
傫偱偡偗偳丅

僱僢僩儚乕僋僇乕僪偺 10BaseT 億乕僩 (揹榖僾儔僌傒偨偄側傗偮偱偡) 偑巊傢
傟傞愝掕偵側偭偰偄傞偐傪妋擣偡傞昁梫偑偁傝傑偡丅挷傋傞偺偵堦斣偄偄曽朄
偼丄僇乕僪偺偳偺僐僱僋僞偑巊傢傟傞傛偆偵側偭偰偄傞偺偐傪僽乕僩傾僢僾帪
偵妋擣偡傞偙偲偱偡丅埲壓偺傛偆側昞帵偑偁傞偼偢偱偡丅
eth0: 3c509 at 0x300 tag 1, 10baseT port, address  00 20 af ee 11 11, IRQ 10. 
                            ^^^^^^^^^^^^                                      
3c509.c:1.07 6/15/95 becker@cesdis.gsfc.nasa.gov                              

儔僢僾僩僢僾宆偺儐乕僓偐傜丄偙偺傛偆側栤戣偑 PCMCIA 儐乕僥傿儕僥傿 (摿
偵 ifport) 偺偣偄偱惗偠傞偲偄偆曬崘傪傕傜偭偰偄傑偡丅偙傟偑僐僱僋僞偺僞
僀僾傪 10Base2 (摨幉働乕僽儖) 偵愝掕偟偰偟傑偆偺偱偡丅 10BaseT 偵側偭偰
偄傞偙偲傪妋擣偟偰偔偩偝偄丅偦偆側偭偰偄側偗傟偽僇乕僪傪嵞愝掕偟偰僐儞
僺儏乕僞傪嵞婲摦偟偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.6. DHCP 僋儔僀傾儞僩偼僽儘乕僪僉儍僗僩儕僋僄僗僩傪弌偡傫偱偡偑丄扤
傕摎偊偰偔傟側偄傫偱偡 (Peter Amstutz 偐傜婑偣傜傟傑偟偨)

僔僗僥儉偵傛偭偰偼儕僋僄僗僩偺堦晹偵儂僗僩偺柤慜傪娷傔側偗傟偽側傜側偄
応崌偑偁傝傑偡丅 dhcpcd 偱偙傟傪峴偆偵偼 dhcpcd -h foohost 偲偟傑偡丅昁
梫偲側傞儂僗僩柤偼丄偦偺僱僢僩儚乕僋偱偺偁側偨偺傾僇僂儞僩柤偲堦抳偡傞
偙偲偑懡偄偱偟傚偆丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.7. 慡晹偺僗僥僢僾傪偪傖傫偲偨偳偭偨偺偵丄巹偺儅僔儞偼愙懕偱偒傑偣
傫

懡偔偺応崌丄働乕僽儖儌僨儉偼丄僱僢僩儚乕僋僇乕僪偺 Ethernet 傾僪儗僗傪
婰壇偟偰偟傑偄傑偡丅偦偺応崌丄怴偟偄僐儞僺儏乕僞傪愙懕偟偨傝僱僢僩儚乕
僋僇乕僪傪岎姺偟偨偲偒偵偼壗偲偐偟偰働乕僽儖儌僨儉偵怴偟偄僐儞僺儏乕僞
偲僇乕僪傪嫵偊偰傗傜側偗傟偽側傝傑偣傫丅捠忢偼僐儞僺儏乕僞偺揹尮傪擖傟
偨傑傑儌僨儉偺揹尮傪堦搙愗偭偰擖傟捈偣偽偄偄偼偢偱偡丅偩傔側応崌偼僥僋
僯僇儖僒億乕僩偵揹榖偟偰丄僐儞僺儏乕僞偺僱僢僩儚乕僋僇乕僪傪岎姺偟偨巪
傪揱偊偰偔偩偝偄丅

僼傽僀傾僂僅乕儖偺儖乕儖 (ipfwadm rule) 偵傛偭偰丄 DHCP 偑愝掕忣曬傪棳
偡億乕僩 67/68 偑傆偝偑傟偰偄傞偺偐傕偟傟傑偣傫丅僼傽僀傾僂僅乕儖偺儖乕
儖傪拲堄偟偰挷傋偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.10.8. MediaOne Express 偺僒乕價僗傪巊偭偰偄傞傫偱偡偑丄愙懕偱偒傑偣傫

MediaOne 偼 DHCP 偵晅壛偡傋偒偱側偄忣曬傪壛偊偰偟傑偭偰偄傑偡丅偍偦傜偔
偙傟偼傕偆栤戣偱偼側偄偺偱偟傚偆偑丄偆傑偔偄偐側偄応崌偼偙傟傜傪妋擣偟
偰傒偰偔偩偝偄丅傕偟岾塣 (晄塣?) 偵傕摨偠儅僔儞偵 Windows NT 偑嵹偭偰偄
傞応崌偼丄僀儀儞僩價儏乕傾傪婲摦偡傞偲埲壓偺傛偆側寈崘偑弌偰偄傞偼偢偱
偡丅
DHCP received an unknown option 067 of length 005. The raw option data is  
given  below.                                                              
                                                                           
0000: 62 61 73 69 63            basic                                      

栿拲: 栿幰偼 NT 傪巊偭偰偄傑偣傫偺偱丄擔杮岅斉偺儊僢僙乕僕偼傢偐傝傑偣
傫(^_^;

偙傟偑尨場偩偭偨応崌偼 ftp://vanbuer.ddns.org/pub/ 偵峴偭偰僶僀僫儕傪僟
僂儞儘乕僪偡傞偐丄僜乕僗傪擖庤偟偰擖傟懼偊偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.11. 傕偆堦偮偺 DHCP 僋儔僀傾儞僩 (ISC dhclient)

dhcpcd 傪巊偭偰傕 Linux 偱愙懕傪妋棫偱偒側偄応崌偼丄 ISC dhclient 傪帋
偟偰傒傞偲偄偄偐傕偟傟傑偣傫丅dhclient 偼丄 ISC 桼棃偺 DHCP 攝晍 (僋儔
僀傾儞僩丒僒乕僶椉曽傪摨崼偟偰偄傑偡) 偵娷傑傟傑偡丅擖庤曽朄傗僐儞僷僀
儖曽朄偵偮偄偰偼偙偙傪撉傫偱偔偩偝偄丅惉岟偟偨傜丄偙偺復偵栠偭偰僋儔僀
傾儞僩傪愝掕偟偰偔偩偝偄丅
   
   
    Note: 師偺忣曬偼丄dhclient 偺嶌幰偺堦恖丄 Ted Lemon <mellon@isc.org
    > 偐傜婑偣傜傟傑偟偨丅

DHCP client 偺尰嵼偺僶乕僕儑儞偱偼丄 dhclient.conf 偼昁梫偁傝傑偣傫丅
dhclient 傪丄師偺僐儅儞僪偱婲摦偡傞偩偗偱偡丅 /sbin/dhclient

偙偺僐儅儞僪傪幚峴偡傞偲丄慡偰偺僽儘乕僪僉儍僗僩僀儞僞乕僼僃乕僗偑愝掕
偝傟傑偡丅偙傟偱偆傑偔摦偐側偐偭偨傝丄摿掕偺僀儞僞乕僼僃乕僗偩偗傪巊偄
偨偄偺側傜丄師偺傛偆側愝掕傪 /etc/dhclient.conf 偵婰弎偟偰偔偩偝偄丅
interface "eth0" {                                                     
  send dhcp-client-identifier 1:xx:xx:xx:xx:xx:xx;                     
  send dhcp-lease-time 86400;                                          
}                                                                      

偙偺椺偱偼丄僀乕僒僱僢僩僀儞僞乕僼僃乕僗偼 eth0 傪巊偆傕偺偲壖掕偟偰偄
傑偡丅懠偺傕偺傪巊偆偲偒偼丄婰弎傕偦傟偵崌傢偣偰偔偩偝偄丅 xx:xx:xx:xx:
xx 偺晹暘傕丄偍巊偄偺僀乕僒僱僢僩傾僪儗僗偵崌傢偣偰偔偩偝偄丅偙偺
dhclient.conf 傪巊偆偲丄Win 95 偺僋儔僀傾儞僩偺嫇摦偵嬤偄傕偺偵側傝傑偡
丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4. DHCP 僒乕僶偺僙僢僩傾僢僾

4.1. UNIX 梡偺 DHCP 僒乕僶

U*X 儔僀僋 OS 梡偺 DHCP 僒乕僶偼偄偔偮偐懚嵼偟傑偡丅彜梡偺傕偺傕僼儕乕
偺傕偺傕偁傝傑偡丅僼儕乕偺 DHCP 僒乕僶偺拞偱傛偔巊傢傟偰偄傞傕偺偼 Paul
Vixie 偺 ISC DHCPd 偱偟傚偆丅尰嵼偺嵟怴斉偼 2.0 (傎偲傫偳偺儐乕僓偼偙偪
傜偑椙偄偱偟傚偆) 偱偡偑丄 3.0 傕兝僥僗僩偺抜奒偱偡丅師偵宖偘傞儕儞僋偐
傜擖庤壜擻偱偡丅

ftp://ftp.isc.org/isc/dhcp/

僶僀僫儕僷僢働乕僕偑廂榐偝傟偰偄傞僨傿僗僩儕價儏乕僔儑儞傕偁傝傑偡丅偦
傟傪巊偆応崌偼丄師偺僙僋僔儑儞偼旘偽偟偰偔偩偝偄丅

僟僂儞儘乕僪偟偨傜揥奐偟傑偡丅揥奐偟偨傜丄攝晍僜乕僗偺僨傿儗僋僩儕偵 cd
偟偰丄 ./configure 傪幚峴偟傑偡丅

愝掕偵偼偟偽傜偔帪娫偑偐偐傞偱偟傚偆丅廔傢偭偨傜丄 make 偲 make install
傪幚峴偟傑偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4.2. DHCP 僒乕僶偺愝掕

僀儞僗僩乕儖偑廔傢偭偨傜丄 ifconfig -a 偲擖椡偟偰偔偩偝偄丅埲壓偺傛偆側
昞帵偑弌傞偼偢偱偡丅
eth0      Link encap:10Mbps Ethernet  HWaddr 00:C0:4F:D3:C4:62              
          inet addr:183.217.19.43  Bcast:183.217.19.255  Mask:255.255.255.0 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                
          RX packets:2875542 errors:0 dropped:0 overruns:0                  
          TX packets:218647 errors:0 dropped:0 overruns:0                   
          Interrupt:11 Base address:0x210                                   

MULTICAST 偲偄偆暥帤偑尰傟側偄応崌偼僇乕僱儖傪愝掕偟側偍偟偰 multicast
偺僒億乕僩傪捛壛偡傞昁梫偑偁傝傑偡丅傎偲傫偳偺僔僗僥儉偱偼偙傟偼晄梫偱
偟傚偆丅

師偵峴偆偙偲偼 255.255.255.255 傊偺宱楬偺捛壛偱偡丅 DHCPd 偺 README 偐
傜堷梡偟傑偡丅
   
   
    乽dhcpd 傪嵶偐偄偙偲偵偆傞偝偄 DHCP 僋儔僀傾儞僩 (椺偊偽 Windows 95
    偺傕偺側偳) 偲惓偟偔摦嶌偝偣傞偵偼丄dhcpd 偼 destination address 偑
    255.255.255.255 偺 IP 僷働僢僩傪憲傞偙偲偑偱偒傞傛偆偵側偭偰偄傞昁
    梫偑偁傝傑偡丅巆擮側偑傜 Linux 偼 255.255.255.255 傪儘乕僇儖側僒僽
    僱僢僩偺僽儘乕僪僉儍僗僩 (偙偙偱偼 192.5.5.223) 偵曄姺偟偰偟傑偆偺
    偱偡丅偙偺寢壥偼 DHCP 僾儘僩僐儖偵堘斀偡傞偙偲偵側傝傑偡丅偨偄偰偄
    偺 DHCP 僋儔僀傾儞僩偼偙傟偵婥偑偮偒傑偣傫偑丄婥偑偮偔傕偺 (椺偊偽
    Microsoft 偺 DHCP 僋儔僀傾儞僩偼慡偰偦偆偱偡) 傕偁傝傑偡丅屻幰偺條
    側僋儔僀傾儞僩偼僒乕僶偐傜偺 DHCPOFFER 儊僢僙乕僕傪庴怣偡傞帠偑偱偒
    側偄偺偱偡丅乿

師偺傛偆偵擖椡偟傑偟傚偆丅 route add -host 255.255.255.255 dev eth0

傕偟傕 "255.255.255.255: Unknown host" 偺傛偆側儊僢僙乕僕偑弌椡偝傟偨応
崌偼丄師偺傛偆側僄儞僩儕傪 /etc/hosts 僼傽僀儖偵捛壛偡傞昁梫偑偁傝傑偡
丅
255.255.255.255 all-ones                                               

捛壛偟偨傜
route add -host all-ones dev eth0                                      

偁傞偄偼
route add 255.255.255.0 dev eth0                                       

偲偟偰偔偩偝偄丅傕偪傠傫 eth0 偼巊偍偆偲偟偰偄傞僱僢僩儚乕僋僨僶僀僗柤
偱偡丅堎側傞応崌偼揔媂曄峏偟偰偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4.3. DHCPd 偺僆僾僔儑儞

偙偙偱 DHCPd 傪愝掕偟側偗傟偽側傝傑偣傫丅 /etc/dhcpd.conf 傪曇廤 (側偗
傟偽嶌惉) 偟傑偡丅KDE ( http://www.kde.org/ ) 偵偼丄kcmdhcpd 偲偄偆丄
GUI 偵傛傞 dhcpd 偺愝掕僣乕儖偑偁傝傑偡丅Windows NT 偺 DHCP 僐儞僼傿僌
儗乕僞偵嬌傔偰傛偔帡偰偄傑偡丅 KDE 2.0 偑儕儕乕僗偝傟傟偽丄kcmdhcpd 傕
儕儕乕僗偝傟傞偼偢偱偡丅師偵宖偘傞儕儞僋偐傜傕擖庤偱偒傑偡丅

ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/

栿拲: 尰帪揰偱 KDE-2.0.1 偑儕儕乕僗偝傟偰偄傑偡偑丄 kdenetwork-2.0.1 偵
偼 kcmdhcpd 偼娷傑傟偰偄傑偣傫丅

捈愙 DHCPd 傪愝掕偟偨偗傟偽丄埲壓偺巜帵偵廬偭偰偔偩偝偄丅

偨偄偰偄偺恖偑傗傝偨偄偲巚偆偺偼 IP 傾僪儗僗傪儔儞僟儉偵妱傝摉偰傞偙偲
偱偟傚偆丅偙傟偵偼埲壓偺傛偆側愝掕傪梡偄傑偡丅
# Sample /etc/dhcpd.conf                                               
# (add your comments here)                                             
default-lease-time 600;                                                
max-lease-time 7200;                                                   
option subnet-mask 255.255.255.0;                                      
option broadcast-address 192.168.1.255;                                
option routers 192.168.1.254;                                          
option domain-name-servers 192.168.1.1, 192.168.1.2;                   
option domain-name "mydomain.org";                                     
                                                                       
subnet 192.168.1.0 netmask 255.255.255.0 {                             
   range 192.168.1.10 192.168.1.100;                                   
   range 192.168.1.150 192.168.1.200;                                  
}                                                                      

偙偆偡傞偲 DHCP 僒乕僶偑僋儔僀傾儞僩偵梌偊傞 IP 傾僪儗僗偼
192.168.1.10-192.168.1.100 傑偨偼 192.168.1.150-192.168.1.200 偺斖埻偲
側傝傑偡丅摿偵僋儔僀傾儞僩偐傜偺帪娫榞偺梫媮偑側偗傟偽丄 600 昩偺娫 IP
傾僪儗僗偑戄偟弌偝傟傑偡丅梫媮偑偁偭偨応崌偵嵟戝尷嫋偝傟傞戄偟弌偟帪娫
偼 7200 昩偱偡丅傑偨僒乕僶偼僋儔僀傾儞僩偵 255.255.255.0 傪僒僽僱僢僩儅
僗僋偲偟偰梡偄丄 192.168.1.255 傪僽儘乕僪僉儍僗僩傾僪儗僗偲偟偰梡偄丄
192.168.1.254 傪僎乕僩僂僃僀偲偟偰梡偄丄 192.168.1.1 偐 192.168.1.2 傪
DNS 僒乕僶偲偟偰梡偄傞傛偆偵乽傾僪僶僀僗乿偟傑偡丅

Windows 僋儔僀傾儞僩偵 WINS 僒乕僶傪嫵偊偰偁偘傞昁梫偑偁傞応崌偼丄
netbios-name-servers 僆僾僔儑儞傪彂偔昁梫偑偁傝傑偡丅嬶懱椺傪埲壓偵帵偟
傑偡丅
option netbios-name-servers 192.168.1.1;                               

摿掕偺 IP 傾僪儗僗傪僋儔僀傾儞僩偺 Ethernet 傾僪儗僗偵墳偠偰妱傝摉偰傞
偙偲傕偱偒傑偡丅
host haagen {                                                          
   hardware ethernet 08:00:2b:4c:59:23;                                
   fixed-address 192.168.1.222;                                        
}                                                                      

偙偺傛偆偵偡傞偲 IP 傾僪儗僗 192.168.1.222 偑 Ethernet 傾僪儗僗 08:00:
2b:4c:59:23 傪帩偭偨僋儔僀傾儞僩偵妱傝摉偰傜傟傑偡丅

偙傟傜傪揔摉偵崿偤傞帠傕偱偒傑偡丅偮傑傝摿掕偺僋儔僀傾儞僩偵偼惷揑側 IP
傾僪儗僗傪梌偊 (僒乕僶側偳)丄懠偵偼摦揑側 IP 傪梌偊傞 (儔僢僾僩僢僾儐乕
僓側偳) 偙偲偑偱偒傑偡丅懠偵傕偨偔偝傫偺僆僾僔儑儞偑偁傝傑偡丅 nis 僒乕
僶偺傾僪儗僗傪梌偊偨傝丄僞僀儉僒乕僶傪嫵偊偨傝丄側偳偱偡丅偙傟傜偑昁梫
側応崌偼 dhcpd.conf 偺儅僯儏傾儖儁乕僕傪撉傫偱偔偩偝偄丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4.4. 僒乕僶傪婲摦偡傞

僒乕僶傪婲摦偡傞慜偵堦偮偩偗傗偭偰偍偐偹偽側傜側偄偙偲偑偁傝傑偡丅懡偔
偺応崌丄DHCP 僒乕僶傪僀儞僗僩乕儖偟偰傕 dhcpd.leases 僼傽僀儖偑嶌惉偝傟
傑偣傫丅偙偺僼傽僀儖偼丄尰嵼偺 IP 傾僪儗僗戄偟弌偟偵娭偡傞忣曬傪曐懚偡
傞偨傔偵DHCPd 偑巊偆傕偺偱偡丅僾儗僀儞僥僉僗僩偺宍幃側偺偱丄 DHCPd 傪憖
嶌偟偰偄傞娫偵尒傞偙偲偑偱偒傑偡丅 dhcpd.leases 傪嶌惉偡傞偵偼丄師偺傛
偆偵偟傑偡丅
touch /var/state/dhcp/dhcpd.leases                                     

偙傟偱嬻偺僼傽僀儖(僼傽僀儖僒僀僘 = 0)偑嶌惉偝傟傑偡丅 dhcpd 2.0 埲慜偺
僶乕僕儑儞偺拞偵偼丄 /etc/dhcpd.leases 傪巊偆傕偺偑偁傝傑偟偨丅戄偟弌偟
忣曬僼傽僀儖傪曇廤偡傞昁梫偼偁傝傑偣傫丅 DHCPCd 偑帺摦揑偵憖嶌偟傑偡丅
乽僼傽僀儖偑懚嵼偟傑偡乿偲偄偆傛偆側儊僢僙乕僕傪庴偗偨偲偟偰傕丄柍帇偟
偰師偵恑傫偱峔偄傑偣傫丅

偄傛偄傛 DHCP 僒乕僶傪婲摦偱偒傑偡丅扨偵埲壓偺傛偆偵擖椡偡傞偩偗偱偡
(偁傞偄偼僽乕僩傾僢僾僗僋儕僾僩偵彂偒傑偡)丅
/usr/sbin/dhcpd                                                        

偙偺僐儅儞僪偼丄DHCP 僒乕僶傪 eth0 僨僶僀僗偵懳偟偰婲摦偟傑偡丅懠偺僨僶
僀僗偱婲摦偟偨偗傟偽丄扨偵偦偺僨僶僀僗柤傪僐儅儞僪儔僀儞偱搉偟偰偔偩偝
偄丅嬶懱椺傪埲壓偵帵偟傑偡丅
/usr/sbin/dhcpd eth1                                                   

偪傖傫偲摦嶌偟偰偄傞偐偳偆偐傪妋偐傔偨偄応崌偼丄傑偢僨僶僢僌儌乕僪傪僆
儞偵偟偰僒乕僶傪僼僅傾僌儔僂儞僪偱幚峴偟偰傒傑偟傚偆丅埲壓偺傛偆偵偟傑
偡丅
/usr/sbin/dhcpd -d -f                                                  

偦偟偰偳傟偐僋儔僀傾儞僩傪堦偮僽乕僩偟偰傒偰丄僒乕僶偺僐儞僜乕儖傪妋擣
偟傑偟傚偆丅偨偔偝傫偺僨僶僢僌儊僢僙乕僕偑尰傟傞偼偢偱偡丅慡偰偑偆傑偔
偄偭偰偄傞傛偆側傜丄姰椆偱偡 :-) dhcpd 傪廔椆偟偰 -d -f 僆僾僔儑儞柍偟
偱婲摦偟傑偟傚偆丅僽乕僩帪偵 dhcpd 傪婲摦偟偨偄偺偱偁傟偽丄椺偊偽師偺僼
傽僀儖偵 dhcpd 傪捛壛偡傞偲偄偄偱偟傚偆丅
/etc/rc.d/rc.local                                                     
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4.5. 偦偺懠偺嫽枴怺偄暥彂

Linux Magazine (栿拲: 擔杮偺傕偺偱偼偁傝傑偣傫) 偺2000擭4寧崋偵偼丄旕忢
偵傛偄婰帠偑宖嵹偝傟偰偄傑偡丅僱僢僩儚乕僋偺妝墍 (Nirvana)丗僱僢僩儚乕
僋偺愝掕傪 DHCP 暲偵娙扨偵偡傞曽朄偲偄偆戣柤偱丄DHCP 偺僙僢僩傾僢僾偵偮
偄偰弎傋傜傟偰偄傑偡丅
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

Appendix A. 擔杮岅栿偵偮偄偰

擔杮岅栿偼 Linux Japanese FAQ Project 偑峴偄傑偟偨丏東栿偵娭偡傞偛堄尒
偼 JF 僾儘僕僃僋僩 <JF@linux.or.jp> 埗偵楢棈偟偰偔偩偝偄丏

夵掶棜楌傪埲壓偵帵偟傑偡丏

v4.12j, Sun Feb 4 2001
   
    東栿:
        戝怷曐塸 <dasen@icntv.ne.jp>
       
    峑惓:
         仚 憗愳恗偝傫
           
         仚 拞栰仐惉纥戝偝傫
           
         仚 愳嶈婱旻偝傫
           
         仚 偦偺懠偺 JF 儊儞僶乕偺曽乆
           
       
   
   

