\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{DHCP mini-HOWTO (DHCPd/DHCPcd)}
\author{§@ªÌ¡GVladimir Vuksan, {\ttfamily vuksan@veus.hr}
Ä¶ªÌ¡G ½±¤j°¶¡A {\ttfamily dawei@sinica.edu.tw}}
\date{ª©¥»/µo¦æ¤é´Á¡Gv4.2, 11 June 1999}
\abstract{³o¥÷¤å¥ó¥D­n¦b¸Ñµª¦U¦ì¡A¦p¦ó§â§Aªº Linux ¾÷¾¹³]©w¦¨ DHCP ¦øªA¾¹©Î DHCP ¥Î¤áºÝ¡A¤@¨Ç°ò¥»ªº°ÝÃD¡C}


\begin{document}
\maketitle
\tableofcontents





\section{¤¶²Ð}

       




\subsection{§K³dÁn©ú}

³o¥÷¤å¥óªº¤º®e¤£±µ¨ü¥ô¦ó½ßÀv­n¨D¡C¤Þ¥Î³o¥÷¤å¥óªº·§©À¡N¨Ò¤l¡N¥H¤Î¨ä¥Lªº¤º®e
®É¡A¦U¦ì­n¦Û¤v©Ó¾á­·ÀI¡C¥Ñ©ó³o¬O¤@¥÷·s¥Xª©ªº¤å¥ó¡A©Ò¥H¥i¯à·|¦³¨Ç¿ù»~¥H¤Î¤£
¥¿½Tªº¦a¤è¡A¦]¦¹¡A·íµM¥i¯à¹ï§Aªº¨t²Î³y¦¨¦M®`¡CÁöµM¡A¨aÃø¤£¤Ó¥i¯àµo¥Í¡A¦ýÁÙ
¬O½Ð¤p¤ß¬°¤W¡A¥X¤F¨Æ§Ú¤@·§¤£­t¥ô¦ó³d¥ô¡C

¦P®É¡A¤]½Ð§A»Ê°O¦b¤ß¡A³o¥÷¤å¥ó©Ò´£¨Ñªº¤º®e¨Ã {\ttfamily ¤£¬O} ¥¿¦¡ªº¸ê°T¡C³o¥÷
¤å¥óªº¤º®e¡A¦³³\¦h³£¬O°²³]¥X¨Óªº¡A¬Ý°_¨Ó¦n¹³¯à¹B§@¡A¦ý¥¼¥²¥i¥H¡C¤Þ¥Î®É¡A¦U¦ì
­n¦Û¤v©Ó¾á­·ÀI¡C






\subsection{¦p¦ó¨ú±o³o¥÷¤å¥óªº³Ì·sª©¥»}

³o¥÷¤å¥óªº³Ì·sª©¥»·|©w´Á¦a±i¶K¦b {\itshape comp.os.linux.answers\/} ªº·s»D½×¾Â¤W¡C
¥¦¤]·|³Q©ñ¸m¦b¦U­ÓÀx¦s³oÃþ¸ê°Tªº°Î¦W FTP ¯¸¥x¤W¡A¨Ò¦p¡G

{\ttfamily \onlynameurl{ftp://metalab.unc.edu/pub/Linux/docs/HOWTO}}

¦¹¥~¡A§A³q±`¥i¥H¦b Linux ¤å¥ó­p¹ºªººô­¶¤W§ä¨ì³o¥÷¤å¥ó¡A½Ð°Ñ¦Òºô§}¡G

{\ttfamily \onlynameurl{http://metalab.unc.edu/LDP/}}





³o¥÷¤å¥óªº¤¤¤åª©Â½Ä¶¡A½Ð°Ñ¦Òºô§}¡G





\onlynameurl{http://www.linux.org.tw/CLDP/mini/DHCP.html}





§Ú¦b¦¹¥¿¦¡±Â¤©Â½Ä¶Åvµ¹¤Z¬O­n±N¥»¤å¥óÂ½Ä¶¦¨¦Û¤v¥»°ê»y¨¥ªº¥ô¦ó¤H¡C±ø¥ó¬O§A¥²¶·±N
¸ÓÂ½Ä¶ª©¥»ªºÃìµ²¦ì§}´£¨Ñµ¹§Ú¡C






\subsection{¦^õX}

¤Z¬O¹ï³o¥÷¤å¥ó©Ò§@ªº¥ô¦ó¦^õX³£«D±`Åwªï¡C¨S¦³±zªº¥I¥X©M°Ñ»P¡A³o¥÷¤å¥ó±N¤£·|
§e²{¦b²³¤Hªº­±«e¡C©Ò¥H¡A½Ð±N±zªº«ØÄ³¡N§åµû¡N©M«ü±Ð±H¦Ü 
{\ttfamily vuksan@veus.hr}¡C






\subsection{¨ÑÄmªÌ}

³o¥÷¤å¥ó³Ìªì¬O­×§ï¦Û Paul Makeev ©Ò¼¶¼gªºª©¥»¦Ó¨Óªº¡C

¨ä¥L¹ï³o¥÷¤å¥ó¦³¹L¨ÑÄmªºªB¤Í¡A¦CÁ|¦p¤U¡G
\begin{itemize}
\item Heiko Schlittermann
\item Jonathan Smith
\item Dan Khabaza
\item Hal Sadofsky
\item Henrik Stoerner
\item Paul Rossington
\end{itemize}







\subsection{ª©ÅvÁn©ú}

³o¥÷¤å¥ó¦Û 1998 ¶}©lªºª©ÅvÄÝ©ó Vladimir Vuksan ©Ò¦³¡A¨Ã½Ð«ö·Ó¥H¤U³W©w¨Ó¬y³q¡G

 
\begin{itemize}
\item  Linux HOWTO ¤å¥óªº¥þ³¡©Î³¡¤À¡A¥i¥H¨Ï¥Î¥ô¦óª«²z©Î¹q¤lªº´CÅé§Î¦¡¨Ó½Æ»s
»P¬y³q¡A¥u­n³o­Óª©ÅvÁn©ú³Q«O¯d¦b¨C¥÷«þ¨©¤¤¡C°Ó·~¦æ¬°ªº¦A¬y³q¬O³Q¤¹³\¦Ó¥B¨üÅw
ªïªº¡F¦ý¬O¡A¥ô¦óªº¬y³q¦æ¬°¡A§@ªÌ³£§Æ±æ¯à³Q§iª¾¡C
\item ©Ò¦³Â½Ä¶¡N­l¥Íªº¤u§@¡N©Î¦X¨Ö¥ô¦ó Linux HOWTO ¤å¥óªº»E¶°¤u§@¡A³£¥²¶·¨ü
¨ì³o­Óª©ÅvÁn©úªº«OÅ@¡C¤]´N¬O»¡¡A§A¤£¥i¥H±q HOWTO ­l¥Í¥X¤@¥÷¤å¥ó¡AµM«á¹ï³o¥÷
­l¥Í¤å¥óªº¬y³q±j¥[¤W¨ä¥L­­¨î±ø¥ó¡C°£«D¦b¤@¨Ç¯S©wªºª¬ªp¤U¡A¤~·|¤¹¿Õ³o¨Ç­­¨î
±ø¥ó¡F½ÐÁpµ¸ Linux HOWTO ªº¨ó½Õ¤H¡A¥Lªº¦a§}¦p¤U¡G
\item  ¦pªG§A¦³¥ô¦óºÃ°Ý¡A½ÐÁpµ¸ Linux HOWTO ªº¨ó½Õ¤H
\end{itemize}

{\ttfamily \onlynameurl{linux-howto@metalab.unc.edu}}








\section{DHCP ³q°T¨ó©w}



DHCP ´N¬O¡§°ÊºA¥D¾÷³]©w¨ó©w¡¨(Dynamic Host Configuration Protocol)ªºÂ²¼g¡CDHCP ªº
¥D­n¥Î³~¬O¡G³z¹L¦øªA¾¹ªº¨ó§U¨Ó±±ºÞ¦U­Ó¥D¾÷¡]°õ¦æ¤¤ªº¥Î¤áºÝ¡^¤W¤£¥i¯Ê¤Öªººô¸ô
³s½u°Ñ¼Æ¡CDHCP ¨ó©w¦V«á¬Û®e BOOTP ³o­Ó³q°T¨ó©w¡C§ó¶i¤@¨Bªº¸ê°T½Ð°Ñ¦Ò RFC 2131 
ªº¼Ð·Ç¡] RFC 1531 ¬OÂÂ¼Ð·Ç¡^¥H¤Î¨ä¥¦¬ÛÃö¸ê®Æ¡C¡]½Ð°Ñ¦Ò¸Ó¤å¥ó¥½§À¡A°Ñ¦Ò¸ê®Æ¨Ó·½
ªº³¡¤À¡^¡C§A¤]¥i¥H°Ñ¾\¡G
\onlynameurl{DHCP FAQ}
(http://web.syr.edu/~jmwobus/comfaqs/dhcp.faq.html)¡C



³o¥÷¤å¥ó±N·|¬°¦U¦ì»¡©ú DHCP ¦øªA¾¹ºÝªº¡§ºÊ±±µ{¦¡¡¨(daemon)©M¥Î¤áºÝªººÊ±±µ{¦¡¡C¦h
¼Æ¤H¦b¤u§@¯¸¤W·|»Ý­n¥Î¨ì¤áºÝªººÊ±±µ{¦¡¡A¥H«K±q»·ºÝªº¦øªA¾¹¤W¨ú±oºô¸ô³]©w¸ê°T¡C¦Ó
¨t²ÎºÞ²z­û«h·|¨Ï¥Î¦øªA¾¹ºÝªººÊ±±µ{¦¡¡A¥H«K´²§Gºô¸ô³]©w¸ê°Tµ¹¥Î¤áºÝ¨Ó¨ú¥Î¡A©Ò¥H¡Ai
¦pªG§A¥u¬O­Ó¤@¯ëªº¨Ï¥ÎªÌ¡A¨º»ò§A±N·|»Ý­n¥Î¤áºÝªººÊ±±µ{¦¡¡C




\section{³]©w¥Î¤áºÝ}


\subsection{¤U¸ü¥Î¤áºÝªººÊ±±µ{¦¡}



{\bfseries ®Ö¤ß 2.0.x }





¤£½×§A¨Ï¥Îªº¬O­þ¤@ºØ Linux ªºµo¦æª©¥»¡A§A³£¥²»Ý¤U¸ü¥Î¤áºÝªººÊ±±µ{¦¡¡C§A©Ò»Ý­n
¤U¸üªºµ{¦¡®M¥óºÙ¬° dhcpcd ¡A¥Ø«eªºª©¥»½s¸¹¬O 0.70¡C§A¥i¦b
\onlynameurl{¦¹³B} ¾\Åª¨ì³o­Ó®M¥óªº¤º®e»¡©ú¡C
(ftp://metalab.unc.edu/pub/Linux/system/network/daemons/dhcpcd-0.70.lsm)





{\bfseries ®Ö¤ß 2.2.x }





¥Ñ©ó¦b®Ö¤ß 2.1.x ©M 2.2.x ¤¤ ipv4 ªººô¸ôµ{¦¡®M¥ó´¿³Q­×§ï¹L¡]¨Ò¦p¡A¥¦·|¦b³\¦h
Äæ¦ì³]©w¹w³]­È¡^dhcpcd µLªk¥¿±`¹B§@¡C°£«D§A¨Ï¥Îªº¬O RedHat 6.x¡]¥¦¥Ø«e´£¨Ñ¤F 
dhcpcd 1.3.x ©M 2.2.x ªº®Ö¤ß¡^§_«h§A´N¥²¶·¤U¸ü¥t¤@­Óª©¥»ªº dhcpcd¡]§Y 1.3.x¡^
¨Ó¨Ï¥Î¡A³o¬O Sergei Viznyuk {\ttfamily sergei@phystech.com} ¬°¤FÁ×§K¤W­z°ÝÃD©Ò
­×§ïªºª©¥»¡C§A¥i¥H¦b¥H¤U´X­Ó¦a¤è¨ú±o¡G





\begin{itemize}
\item \onlynameurl{ftp://phystech.dyn.ml.org/pub/}
\item \onlynameurl{http://www.cps.msu.edu/\~{}dunham/out/dhcpcd-1.3.6.tar.gz}
\end{itemize}






±µ¤U¨Ó©Ò°µªº»¡©ú³£¬O¥H¦¹¬°°ò¥»ªº­ì«h¡C




\subsection{¦w¸Ë¦b Slackware ¤§¤W}



§A¥i¥H±q¥ô¦ó Metalab ªº¡§Ãè®g¡¨(mirror¡^¯¸¥x©Î¥H¤U´X­Ó¦a¤è¡A¤U¸ü³Ì·sªº DHCPcd 
µ{¦¡®M¥ó¡G

\begin{itemize}
\item \onlynameurl{}
\item \onlynameurl{}
\item \onlynameurl{}
¡]¥D¯¸¥x¦b¤é¥»¡^
\end{itemize}






¤U¸ü³Ì·sª©¥»ªº dhcpcd.tar.gz ³Ì·sª©¥»

\begin{itemize}
\item ±N dhcpcd.tar.gz ¸Ñ¶}



{\ttfamily tar -zxvf dhcpcd-0.70.tar.gz}



\item ¤Á´«¦Ü®M¥ó¸Ñ¶}«áªº¤l¥Ø¿ý¸Ì¡A¨Ã½sÄ¶ dhcpcd µ{¦¡ 

{\ttfamily cd dhcpcd-0.70}

{\ttfamily make}



\item ¦w¸Ë®M¥ó (§A¥²¶·¥H root ªº¨­¥÷°õ¦æ¥H¤Uªº©R¥O)

{\ttfamily make install}



\end{itemize}


³o­Ó©R¥O·|«Ø¥ß /etc/dhcpc ³o­Ó¤l¥Ø¿ý¡ADHCPcd ®M¥ó·|§â DHCP ªº¸ê°TÀx¦s¦b¸Ó³B¡A
¨Ã¥B±N dhcpcd µ{¦¡ÀÉ½Æ»s¨ì /usr/sbin ³o­Ó¤l¥Ø¿ý¸Ì¡C

¬°¯à°÷¦b¶}¾÷®É¡A¨t²Î³]©wªì­È´Á¶¡¡A¨Ï¥Î DHCP ªº¥\¯à¡A½Ð°µ¦p¤Uªº³]©w¡G

{\ttfamily cd /etc/rc.d}

{\ttfamily mv rc.inet1 rc.inet1.OLD}



¤W­±ªº°Ê§@·|±NÂÂ¦³ªººô¸ôªì­È³]©w¡§©R¥O½Z¡¨(script¡^²¾Âà¦Ü rc.inet1.OLD¡C±µ¤U¨Ó¡A
§A¥²¶·«Ø¥ß·sªº rc.inet1 ©R¥O½Z¡C¤U­±ªºµ{¦¡½X¥]§t¤F¥²»Ýªº³]©w¤º®e¡G

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
#
# rc.inet1      ³o­Ó shell ªº©R¥O½Z·|¦b¶}¾÷®É³B²z INET ¨t²Îªº°ò¥»³]©w¡C      

HOSTNAME=`cat /etc/HOSTNAME` # ³o­Ó©R¥O©Î³\¤£¬O¥²»Ýªº¡A¦ý¬O§ÚÁÙ¬O
                             # ±N¥¦«O¯d¤F¤U¨Ó¡C

# ªþ±µ¤W loopback¡]Â¶¦^¡^¸Ë¸m¡C
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# ­Y§A¦³¤A¤Óºô¸ôªº³s½u¡A«h¨Ï¥Î¤U­±ªº©R¥O¨Ó³]©w eth0 ¬É­±¡C
# ­Y§A¥u¦³ loopback ©Î SLIP ªº³s½u¡A«h¤£­n¦b³o­ÓÀÉ®×¸Ì¨Ï¥Î¤U­±ªº©R¥O¡C 

/usr/sbin/dhcpcd
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¦sÀÉ®×¤§«á½Ð±N¹q¸£­«·s¶}¾÷¡C





·í§A§¹¦¨¥H¤Wªº°Ê§@«á¡A½Ð¸õ¦Ü \ref{nameserver} {(³Ì«áªº¨BÆJ)}




\subsection{¦w¸Ë¦b RedHat 5.x ©M RedHat 6.x ¤§¤W}



DHCPcd ªº³]©w¦b RedHat 5.0 »P¥H¤Wªºª©¥»¨ä¹ê«Ü®e©ö¡C§A©Ò­n§@ªº¨Æ±¡¡A´N¬O±Ò°Ê
¡§±±¨î¥x¡¨(Control Panel)¡A½Ð¿é¤J





{\ttfamily control-panel}





\begin{itemize}
\item  ¿ï¨ú Network Configuration ªº¹Ï¹³
\item  ¥H·Æ¹«³æÀ» Interfaces Äæ¼Ð
\item  ¥H·Æ¹«³æÀ» Add «ö¶s
\item  ¿ï¥Î Ethernet ¶µ¥Ø
\item  ¦b Edit Ethernet/Bus Interface ¹ï¸Ü®Ø¤¤¤Ä¿ï {\bfseries "Activate interface at boot time"}
¶µ¥Ø¥H¤Î¿ï¨ú {\bfseries DHCP} °µ¬° {\bfseries Interface configuration protocol} ¶µ¥Øªº
¿é¤J¡C
\end{itemize}






·í§A§¹¦¨¥H¤Wªº°Ê§@«á¡A½Ð¸õ¦Ü \ref{nameserver} {(³Ì«áªº¨BÆJ)}






\subsection{¦b RedHat 4.x »P Caldera OpenLinux 1.1 ¤Wªº³]©w}



DHCPcd ¦b¼Ð·Çªº RedHat ª©¥»¤¤¬O¥H RPM ªº¥]¸Ë¤è¦¡¨Óµo¦æªº¡A§A¥i¥H¦b¨ä©Òµo¦æªº 
CD-ROM ¤Wªº RPMS ¥Ø¿ý¤¤§ä¨ì¥¦¡A©Î¨ì¤U­±ªººô§}¤U¸ü¡G





\onlynameurl{}





µM«á¦w¸Ë¥¦¡A¦p¤U©Ò¥Ü¡G

{\ttfamily rpm -i dhcpcd-0.6-2.i386.rpm}





©ÎªÌ¡A§A¥i¥H«ö·Ó Slackware ¨º¸`©Ò´y­zªº¤èªk¡A½sÄ¶¤@­ÓÄÝ©ó§A¦Û¤vªºª©¥»¡C





{\ttfamily ·PÁÂ nothing nothing@cc.gatech.edu ´£¨Ñ¥H¤Uªº¸ê°Tµ¹§Ú}

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
§Ú§âÀRºAªº ip ¦ì§}©Îºô°ì¦WºÙ¡A±qÀÉ®× /etc/resolv.conf ¤¤²¾°£¡C¦ý¬O¡A§Ú¯d¤U¤F
search ©M nameserver ªº³]©w¦æ¡]¦]¬°¬Y¨Ç­ì¦]§Úªº dhcpcd ¦øªA¾¹¤£·|²£¥ÍÀÉ®× 
/etc/dhcpc/resol.conf¡A©Ò¥H§Ú¥²¶·¨Ï¥ÎÀRºAªº /etc/resolv.conf¡^¡C

¦bÀÉ®× /etc/sysconfig/network ¸Ì¡A§Ú²¾°£¤F HOSTNAME »P GATEWAY ªº³]©w¦æ¡C¦ý¬O¡A
§Ú«O¯d¤F¨ä¥¦ªº³]©w¦æ¡]NETWORKING¡NDOMAINNAME¡NGATEWAYDEV¡^¡C

¦bÀÉ®× /etc/sysconfig/network-scripts/ifcfg-eth0 ¸Ì¡A§Ú²¾°£¤F IPADDR¡NNETMASK¡N
NETWORK¡N©M BROADCAST µ¥³]©w¦æ¡C¦ý¬O¡A§Ú«O¯d¤F DEVICE ©M ONBOOT ªº³]©w¦æ¡A¨Ã±N
BOOTPROTO ªº³]©w¦æ¡A­×§ï¦¨ BOOTPROTO=dhcp¡C

³Ì«áÀx¦sÀÉ®×¡A¨Ã±N¹q¸£­«·s¶}¾÷¡C
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


·í§A§¹¦¨¥H¤Wªº°Ê§@«á¡A½Ð¸õ¦Ü \ref{nameserver} {(³Ì«áªº¨BÆJ)}




\subsection{¦w¸Ë¦b Debian ¤§¤W}



§A¥i¥H¦b¤U­±ªººô§}§ä¨ì¥H deb ¤è¦¡¥]¸Ëªº DHCPcd µ{¦¡®M¥ó¡G





{\ttfamily \onlynameurl{}}

©ÎªÌ¡A§A¥i¥H«ö·Ó Slackware ¨º¸`©Ò´y­zªº¤èªk¨Ó¦w¸Ë¡C

­n¦w¸Ë³o­Ó deb ¥]¸Ëªºµ{¦¡®M¥ó¡A½Ð¿é¤J¡G

{\ttfamily dpkg -i /where/ever/your/debian/packages/are/dhcpd*deb}





§A´X¥G¤£¥²°µ¥ô¦óªº DHCPcd ³]©w¡A¦]¬°¡G
{\ttfamily From: Heiko Schlittermann (heiko@os.inf.tu-dresden.de)}





³o­Ó dhcpcd ªºµ{¦¡®M¥ó¦p¦P¨ä¥¦ªº debian ®M¥ó¤@¼Ë¡A·|±N±Ò°Ê©R¥O½Z¦w¸Ë¦b
/etc/init.d/$<$package\_name$>$ ¤§¤W¡A¦¹³B¬° /etc/init.d/dhcpcd¡A¨Ã±N
¤§Ãìµ²¨ì¦U­Ó /etc/rc?.d/ ¥Ø¿ý¤¤¡C





¦b /etc/rc?.d/ ¥Ø¿ý¤¤©Ò¦s©ñªº¦UÃþÀÉ®×¡A¬O¶}¾÷®É©Ò°õ¦æªº©R¥O½Z¡C







¦pªG§A¦b¦w¸Ë«á¤£·Q­«·s¶}¾÷¡A§AÀ³¸Ó¦Ò¼{¨Ï¥Î¤H¤u±Ò°Ê¡§ºÊ±±µ{¦¡¡¨(daemon) ªº¤è¦¡¡G



{\ttfamily /etc/init.d/dhcpcd start}

·í§A§¹¦¨¥H¤Wªº°Ê§@«á¡A½Ð¸õ¦Ü \ref{nameserver} {(³Ì«áªº¨BÆJ)}




\subsection{¦b LinuxPPC »P MkLinux ¤Wªº³]©w}



¤U­±³o¸`¬O R. Shapiro ¼¶¼gªº¡C





¥Ñ Yoichi Hariguchi ©Òµo®iªºª©¥» 0.65 ©M 0.7 ªº dhcpcd µ{¦¡À³¸Ó¥i¥H¦b¨Ï¥Î®Ö¤ß
2.1.24 ªº LinuxPPC »P MkLinux ¤W¥¿±`°õ¦æ¡A¦ý¬O¡A§A¥²¶·ª`·N¥H¤U´X­Ó­nÂI¡G





* ¦pªG§A·Q­n©Î»Ý­n¡A³z¹L­ì©lµ{¦¡½X¨Ó«Ø¥ß¥i°õ¦æªºÀÉ®×¡A½Ðª`·N¡Appc linux ¤Wªº
½sÄ¶¾¹·|±N 'char' °²©w¬° 'unsigned char'¡A¦ý¬O¡AHariguchi ªº­ì©lµ{¦¡½X½T±N
'char' °²©w¬° 'signed char'¡C©Ò¥H¡A­n³z¹L­ì©lµ{¦¡½X¨Ó²£¥Í°õ¦æÀÉ¡A§A¥²¶·½s¿è
Makefile¡AÅý CFLAGS ¤¤¥]§t "-fsigned-char" ³o­Ó¿ï¶µ¡C





* ¥Ø«e linuxppc {[}´N¬O©Ò¿×ªº linux-pmac] ¥­»O¤W³ÌÃ­©wªºª©¥»¬O 2.1.24¡A»Ý­nªº¸Ü
¥i¨ì¤U­±ªººô§}¨ú±o dhcpcd ªº­×¥¿½X¡G
\onlynameurl{2.1 ª©ªº­×¥¿½X}
(http://www.cro.net/~vuksan/dhcppatch)¡C
mklinux ¥­»O¤W©Òµo¦æªº DR2.1 ©M DR3.0 ³o¨â­Óª©¥»¡A±Ä¥Îªº¬O 2.0 ªº®Ö¤ß (2.0.33)
¡A©Ò¥H¡A¤£¥²¨Ï¥Î³o­Ó­×¥¿½X¡A¦ý¬O¡A§Y¨Ï¦w¸Ë¤F³o­Ó­×¥¿½X¤]¨S¦³¤°»ò¶Ë®`¡C½Ðª`·N
¡Alinuxppc ¦w¸Ë¥úºÐ¤ù¤W dhcpcd µ{¦¡ªº rpm ¥]¸Ë¸Ì¡A¨Ã¤£¥]§t³o­Ó 2.1 ­×¥¿½X¡A¦]¦¹
¡A¥¦¦b linuxppc ¥­»O¤WµLªk¥¿±`¹B§@¡A¤Ï­Ë¬O¡A¥i¥H¦b mklinux ¥­»O¤W¥¿±`°õ¦æ¡C







* ·í§Ú­Ì¨Ï¥Î linuxppc ¥­»Oªº 2.1.24 ®Ö¤ß®É¡A¦b dhcpcd µ{¦¡±Ò°Ê¤§«á¡A§A·|¬Ý¨ì
¤@­ÓÂ²µuªº¸ô¥Ñ¾¹Äµ§i°T®§¡C§A¥i¥H©¿²¤¥¦¡C





* Hariguchi ªº dhcpcd µ{¦¡·|ªá¤@¨Ç®É¶¡¡A¤j¬ù¬O 30 ¬í¡A¨Ó§¹¦¨¥¦ªì¦¸³s±µ¦øªA¾¹©M
³]©w¸ô¥Ñªº°Ê§@¡C·í§Ú­Ì¨Ï¥Îªº¬O linuxppc ¥­»Oªº 2.1.24 ®Ö¤ß®É¡A¤W­zªºÄµ§i°T®§¡A
¥u¬O¦b»¡©ú¡A¸ô¥Ñ¤w¸g³]©w§¹¦¨¤F¡C





¹ï©ó¤ñ¸û·sª©ªº linuxppc ®Ö¤ß¦Ó¨¥¡A¥Ñ Hariguchi ©Òµo®iªº dhcpcd µ{¦¡³£µLªk¨Ï¥Î
¡G¦¹®É§A {\bfseries ¥²¶·} §ï±Ä Sergei Viznyuk ©Òµo®iªºª©¥»¡]¥Ø«eªºµo¦æª©¥»¬° 1.3.9
¡^¡C³Â·Ðªº¬O Viznyuk ªº dhcpcd µ{¦¡¬O¥H glibc 2 ¬°¨ç¦¡®w¨Óµo®iªº¡AµM¦Ó linuxppc 
2.1.1xx «o¤£¨Ï¥Î³o­Ó¨ç¦¡®w¡Cµ²ªG¡A½sÄ¶µ{¦¡»Ý­n¥Î¨ì¤@¨Ç§Þ¥© - ¬ÛÃöªº²Ó¸`½Ð»P§Ú
Ápµ¸¡C¤@¥¹µ{¦¡½sÄ¶¦n¤§«á¡A¥¦´N¯à°÷¦b¸û·sª©ªº®Ö¤ß¤W¥¿±`¹B§@¤F¡]¦b linuxppc ªº
2.1.24 ª©¥»©Î MkLinux ªº³¡¤Àª©¥»¤WÁÙ¬O¤£¦æ¡^¡C





²{¦b§Ú­Ì¨Ó°Q½× Viznyuk ©Òµo®iªº dhcpcd µ{¦¡¡A§Ú¤â¤W¦³¤@­Ó Viznyuk ª©ªº dhcpcd
¡]v1.3.7¡^°õ¦æÀÉ¡A¥i¥H¦b³Ìªñµo¦æªº linuxppc ®Ö¤ß¡G2.1.102¡N103¡N115¡N©M 119¡A¤W
°õ¦æ¡A¨Ã¥B¤w¸g§¹¦¨´ú¸Õ¡C§AÀ³¸Ó¥i¥H³z¹L­ì©lµ{¦¡½X¨Ó²£¥Í°õ¦æÀÉ¡A¦ý¬O¡A§Ú¤£ª¾¹D¹ê»Ú
ªº²Ó¸`¡CViznyuk ª©ªº dhcpcd µLªk¦b 2.1.24 ªº®Ö¤ß¤W¹B§@¡AµM¦Ó­×¸É¹Lªº Hariguchi 
ª©ªº dhcpcd µ{¦¡«o¥i¥H¥¿±`¨Ï¥Î¡C­n½sÄ¶ Hariguchi ª©ªº dhcpcd µ{¦¡´N®e©ö¦h¤F¡C





ºK­n¾ã²z¦p¤U¡G





\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
MkLinux¡G  Hariguchi¡G ¥i¥Î¡F Viznyuk¡G ¤£¥i¥Î
2.1.24¡G   Hariguchi¡G ¦pªG­×¥¿¹L¡A¥i¥H¥¿±`¨Ï¥Î¡]²£¥Í°õ¦æÀÉ«Ü®e©ö¡^¡F Viznyuk¡G ¤£¥i¥Î
2.1.102+¡G Hariguchi¡G ¤£¥i¥Î¡F Viznyuk¡G ¥i¥Î¡]²£¥Í°õ¦æÀÉ»Ý­n§Þ¥©¡^ 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






½Ðª`·N¡AViznyuk ª©ªº dhcpcd ·|§â¸ê®Æª½±µ¼g¨ì /etc/resolv.conf ¸Ì¡]¼g¤J¤§«e·|¥ý
³Æ¥÷ÂÂ¦³ªºÀÉ®×¡^¡A¦]¦¹§A¤£¥²¦A¦Û¤v±q /etc/dhcpc ½Æ»s©ÎÃìµ²¬ÛÃöªº¸ê°T¡C¦P®É¤]½Ð
ª`·N¥¦³q±`·|§â°õ¦æÀÉ©ñ¨ì /sbin ¥Ø¿ý¤¤¦Ó¤£¬O©ñ¨ì /usr/sbin ¸Ì¡A©Ò¥H¥¦ªº©R¥O¦C¿ï
¶µ»P Hariguchi ª©¥»¤§¶¡·|¦³¤@ÂI¤£¦P¡C­Y§A¨Ï¥Î ifup ¨Ó±Ò°Ê dhcpcd ¡A«h ifup ³o­Ó
©R¥O½Z¤]¥²¶·°µ¤@¨Ç¤pªº­×¥¿¡C





­Y§A·Q­n¨ú±oµ¹ linuxppc ¨Ï¥Îªº¹w¥ý½sÄ¶¦n¤§ dhcpcd µ{¦¡¡A½Ð±H«H¨ì





\onlynameurl{reshapiro@mediaone.net}¡C

§Ú¤]´£¨Ñ¤F¤G¤¸½Xªº RPMs ¥]¸ËÀÉ¡G





\onlynameurl{}

½Ð¤£­n¨Ï¥Î¸Ó¥Ø¿ý¤§¤Uªº dhcpcd-1.3.8-2.ppc.rpm ÀÉ®×¡A¥¦¤w¸g°±¤îºûÅ@¤F¡C¥i¾aªºª©
¥»¬O dhcpcd-0.70-0.ppc.rpm¡]µ¹ linuxppc 2.1.24 ¨Ï¥Îªº¡^¥H¤Î dhcpcd-1.3.8-3.ppc.rpm 
¡]µ¹ linuxppc 2.1.102 ©M¥H¤Wªºª©¥»¨Ï¥Îªº¡^¡Cª©¥» 1.3.9 ªº rpm ¥]¸ËÀÉªñ´Á¤ºÀ³¸Ó
·|´£¨Ñ¥X¨Ó¡C¦P®É§ÚÁÙ¨Ì·Óª©¥» 0.65 ©M 0.70¡]¥Ñ Hariguchi ©Òµo®i¡^ªº¤è¦¡¹ïª©¥» 1.3.9 
¡]¥Ñ Viznyuk ©Òµo®i¡^ °µ¤F¤@¨Ç­×§ï¡]´N¬O ªþ¥[¤W -c ªº©R¥O¦C¿ï¶µ¡^¡C¡]½Ðª`·N¡A¼Ð
·Çªº Viznyuk dhcpcd ¨Ã¤£¥]§t³o¼Ëªº¤º®e¡C¡^






\subsection{¡§°O¸¹Àô¡¨¡]Token Ring¡^ºô¸ô}



­Y§A¹Á¸Õ¦b¡§°O¸¹Àô¡¨ºô¸ô¤W°õ¦æ dhcpcd µ{¦¡¡A±NµLªk¥¿±`¹B§@¡C¥H¤U¬O
Henrik Stoerner {\ttfamily (henrik\_stoerner@olicom.dk)} ´£¨Ñµ¹§Úªº¸Ñ¨M¤è®×¡C





°ÝÃD¥X¦b dhcpcd ¥u»{ÃÑ¡§¤A¤Óºô¸ô¡¨¡] Ethernet¡^¥d¡C­Y¥¦µo²{¨ì¡§°O¸¹Àô¡¨ºô¸ô¥d
¡A«h¥¦·|©Úµ´°µ¥ô¦óªº¨Æ±¡¡A¨Ã¥B³ø§i»¡¡§¬É­±¤£¬O¤A¤Óºô¸ô¡¨¡C





¸Ñ¨M¤è®×´N¬O¨Ï¥Î¤@­ÓÂ²³æªº­×¥¿½X¨ÓÅÜ§ó dhcpcd ªº­ì©lµ{¦¡½X¡C§Ú¤w¸g±N¦¹­×¥¿½X
©ñ¦b¤@­Ó¤p«¬ªººô­¶¤W¡A¨Ã´£¨Ñ RedHat ªº RPM ¥]¸ËÀÉ©M¤@­Ó¹w¥ý½sÄ¶¦nªº¤G¤¸ÀÉ¡G
\onlynameurl{}





³o­Ó­×¥¿½X¤w¸g°e¨ì¤F dhcpcd ªººûÅ@ªÌ¤â¤W¤F¡A¦]¦¹¡A¥¦¦³§Æ±æ³Q¥¼¨Óµo¦æªº dhcpcd 
ª©¥»©Ò±Ä¥Î¡C




\subsection{³Ì«á¡A½Ð§¹¦¨¥H¤Uªº°Ê§@\label{nameserver}}



¦b§Aªº¾÷¾¹­«·s¶}¾÷¤§«á¡A§AÀ³¸Ó³]©wºô¸ôªº¬É­±¡C½Ð¿é¤J¡G

{\ttfamily ifconfig}

§AÀ³¸Ó·|¬Ý¨ì¦p¤Uªº¤º®e

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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 
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






¦pªG¡A§A¦b inet addr ¤§«á¬Ý¨ì¤@¨Ç¥¿±`ªº¼Æ¦r¡A³oªí¥Ü§A¤w¸g³]©w¦n¤F¡C¦pªG¡A§A¬Ý¨ì
ªº¬O 0.0.0.0 ¤]¤£­nµ´±æ¡A¥¦¥u¬O dhcpcd ¦b¨ú±o IP ¦ì§}«e¼È®Éªº³]©w­È¡C¦pªG¡A¹L¤F
´X¤ÀÄÁ¤§«á¡A§A¤´µM¬Ý¨ì 0.0.0.0 ¡A½Ð°Ñ¦Ò \ref{troubleshooting} {(ºÃÃø±Æ°£)}
¡CDHCPcd ¬O¤@­Ó¡§ºÊ±±µ{¦¡¡¨(daemon)¡A©Ò¥H¥u­n§Aªº¾÷¾¹ÁÙ¬¡µÛ¡A¥¦±N·|«ùÄò«O«ù°õ¦æ
ªºª¬ºA¡C¥¦¨C¤T¤p®É·|»P DHCP ¦øªA¾¹¦AÁpµ¸¤@¦¸¡A¹Á¸ÕÄò¬ù IP ¦ì§}ªº¯²´Á¡C¥¦·|±N©Ò
¦³ªº°T®§°O¿ý¦b syslog ÀÉ®×¤¤¡]¦b Slackware ¤W¡A¬° /var/adm/syslog¡F¦b RedHat/OpenLinux
¤W¡A¬° /var/log/syslog¡^¡C





³Ì«á­n°µ¤@¥ó¨Æ¡C§A¥²¶·«ü©w¦WºÙ¦øªA¾¹¡C¦³¨â­Ó¤è¦¡¥i¥H§¹¦¨³o­Ó¨BÆJ¡A§A¥i¥H­n¨Dºô¸ô
ªA°È¨ÑÀ³°Ó¡A§iª¾¦WºÙ¦øªA¾¹ªº IP ¦ì§}¡AµM«á¦A±N¦¹¦ì§}¶ñ¤J /etc/resolv.conf ÀÉ¤¤
¡A©ÎªÌ¡A§A¤]¥i¥HÅý DHCPcd ±q DHCP ¦øªA¾¹¨ú±o¸ê®Æ¡AµM«á¦b /etc/dhcpc ¥Ø¿ý¤U²£¥Í
ÀÉ®× resolv.conf¡C§Ú¨M©w¨Ï¥Î DHCPcd ¨Ó²£¥ÍÀÉ®× resolv.conf ªº¤º®e¡A¤èªk¦p¤U¡G





³Æ¥÷ÂÂªº /etc/resolv.conf ÀÉ®×

{\ttfamily mv /etc/resolv.conf /etc/resolv.conf.OLD}

¦pªG¥Ø¿ý /etc/dhcpc ¤£¦s¦b¡A§A¥i¥H¦Û¦æ²£¥Í¦¹¥Ø¿ý

{\ttfamily mkdir /etc/dhcpc}

µM­Ô±N /etc/resolv.conf ¥H¡§²Å¸¹Ãìµ²¡¨¦Ü /etc/dhcpc/resolv.conf

{\ttfamily ln -s /etc/dhcpc/resolv.conf /etc/resolv.conf}



 ¦pªG³o­Ó¤è¦¡µLªk¥¿±`¹B§@¡A½Ð¹Á¸Õ¨Ï¥Î¤U­±ªº¤èªk
¡]¤U­±³o­Ó­×¥¿¤èªk¬O nothing@cc.gatech.edu ©Ò«ØÄ³ªº¡A¨ä¤º®e­×§ï¦Û Henrik Stoerner
©Ò´£¨Ñªº­×¥¿¤èªk¡^

 

\label{error3}

§ÚÁÙ¥²¶·°õ¦æ¤U­±³o­Ó¨BÆJ¡A¥u¦]¬°§Úªº dhcpcd ¤£·|²£¥ÍÀÉ®× /etc/dhcpc/resolv.conf
¡C§Ú¦b /etc/sysconfig/network-scripts/ifup ÀÉ®×¤¤¡A°µ¤F¥H¤Uªº­×§ï¡]ÁöµM§ïªº¤£¬O
«Ü¦n¡A¦ý¬O¥¦¤w¸g¥i¥H¬°§Ú¸Ñ¨M³o­Ó°ÝÃD¤F¡^¡G







\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


§Ú§â¥¦­×§ï¦¨¡G

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






{\bfseries ª`·N} ! (bang) ³o­Ó²Å¸¹
{\ttfamily if [ ! -f /var/run/dhcp-wait-\$$\{$DEVICE$\}$.pid ];}









Á`ºâ¤j¥\§i¦¨¡A¥i¥H§¤¤U¨Ó¨É¨ü¦¨ªG¤F :-)¡C


\subsection{¨ä¥¦ª`·N¨Æ¶µ}



¥H¤Uªº¨BÆJ¤£¬Oµ´¹ï¥²­n¡A¦ý¬O¹ï¬Y¨Ç¤H¦Ó¨¥¡A¥i¯à´N¬£±o¤W¥Î³õ¡C

{\bfseries a) }¦pªG¡A§A¥u¬O°¸º¸¤~·|¦³ºô¸ô³s½uªº»Ý¨D¡A§A¥i¥H¨Ï¥Î©R¥O¦Cªº¤è¦¡¨Ó±Ò°Ê
dhcpcd¡]­n§¹¦¨³o­Ó¨BÆJ¡A§A¥²¶·¾Ö¦³ root ªº¨­¥÷¡^¡G



{\ttfamily /usr/sbin/dhcpcd}

·í§A·Q­nÃö±¼ºô¸ô¡A½Ð¿é¤J

{\ttfamily /usr/sbin/dhcpcd -k}






\subsection{ºÃÃø±Æ°£\label{troubleshooting}}



¦pªG¡A§A«ö·Ó¤F¤W­zªº¨BÆJ¡A«o¤´µMµLªk¦s¨úºô¸ô¡A«Ü¥i¯à¬O¦]¬°¡G





{\bfseries I. §Aªººô¸ô¥d³]©w¤£¥¿½T¡C }



¦b¶}¾÷ªº¹Lµ{¤¤¡A§A¾÷¾¹±N·|°»´ú§Aªººô¸ô¥d¡A¨Ã¥BÀ³¸Ó·|Åã¥Ü¤U­±´X¦æªº°T®§¤º®e¡G

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}


¦pªG¡A§Aªº Linux ¨t²Î¤£·|¥X²{¤W­±³o­Ó°T®§¡A³oªí¥Ü¡A§Aªººô¸ô¥d¥i¯àµLªk³Q¿ëÃÑ¡C°²
¨Ï¡A§A¨Ï¥Îªº¬O¤@¯ëªº¤A¤Óºô¸ô¥d¡]NE2000 ¬Û®e¡^¡A§AÀ³¸Ó·|®³¨ì¤@¤ù DOS ¤u¨ãºÏ¤ù¡A§A
¥i¥H¥Î¥¦¨Ó³]©wºô¸ô¥d¡C¹Á¸Õ³]©w¦U­Ó IRQs ­È¡A¤@ª½¨ì Linux ¥i¥H¿ëÃÑ¨ì§Aªººô¸ô¥d¡]
IRQ ªº­È³]©w³q±`¬° 9,10,12¡^¡C





{\bfseries II. ©Ò¨Ï¥Îªº DHCP ¦øªA¾¹¤ä´© RFC 1541 ¼Ð·Ç/§Úªº DHCP ¦øªA¾¹¬O  Windows NT}



¹Á¸Õ°õ¦æ dhcpcd ¡A½Ð¿é¤J

{\ttfamily dhcpcd -r}

¨Ï¥Î ifconfig ¨ÓÀË¬d¬Ý¬Ý¡A¬O§_§Aªººô¸ô¬É­±¤w¸g³]©w¦n¤F¡]³Ìªì§A©Ò¬Ý¨ìªº¬O 
Inet.addr=0.0.0.0¡A§A±oµ¥«Ý´X¬íªº³]©w®É¶¡¡^¡C



¦pªG³o­Ó¤èªk¥i¥H¸Ñ¨M§Aªº°ÝÃD¡A«h§AÀ³¸Ó¦b¬ÛÃöªº¶}¾÷©R¥O½Z¤¤¥[¤W "-r" ¿ï¶µ¡AÄ´¦p
±N {\ttfamily /sbin/dhcpcd} ­×§ï¦¨ {\ttfamily /sbin/dhcpcd -r ¡C}





¥H RedHat ¬°¨Ò¡A§A¥²¶·½s¿è /etc/sysconfig/network-scripts/ifup ³o­Ó©R¥O½Z¡A¨Ã
±N¥¦­×§ï¦¨¡G

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
        IFNAME=$[ {DEVICE} \
        "/sbin/dhcpcd -r -c /etc/"- etc etc.    
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






{\bfseries III. ¦b¶}¾÷´Á¶¡·|²£¥Í¿ù»~°T®§ "Using DHCP for eth0 ... failed"¡A¦ý¬O¡A¨t²Î
«o¯à¥¿±`¹B§@¡C}





§A«Ü¥i¯à¨Ï¥Îªº¬O RedHat ªº¨t²Î¡A¦Ó¥B¡A§A¨Ã¥¼¥J²Ó¦a«ö·Ó»¡©ú¾Þ§@ :-)¡C§A¦b if ±Ô­z
¤¤¿òº|¤F ! (bang) ³o­Ó²Å¸¹¡C¸õ¨ì \ref{error3} {(¦¹³B)} ¡AÀËµø¦p¦ó¨Ó­×¥¿
¥¦¡C





{\bfseries IV. §Úªººô¸ô¥d¹B§@¤F´X¤ÀÄÁ¤§«á¡A«K¨S¦³¤ÏÀ³¤F¡C}





¥i¯à¬O gated¡]¡§¹h¹DºÊ±±µ{¦¡¡¨(gateway daemon)¡^ ©Ò¦^³øªº¸ê°T¡A§Ë¶Ã¤F Linux 
¥D¾÷ªº¸ô¥Ñ¡A¤~·|³y¦¨³o¼Ëªº°ÝÃD¡CÀË¬d¬O§_ gated ¥¿¦b°õ¦æ¤¤¡G





{\ttfamily ps -auxww $|$ grep gate}





¦pªG¯uªº¬O³o¼Ë¡A§A¥i¥H¨Ï¥Î RedHat ªº RPM ºÞ²zµ{¦¡±N¥¦²¾°£¡A©Î¬O¤â°Ê±N¥¦±q 
/etc/rc.d/ ¤¤²¾°£¡C





{\bfseries V.¦b¶}¾÷®É¥i¥H¿ëÃÑ¨ì§Úªº¤A¤Óºô¸ô¥d¡A¦ý¬O¡A¦b§Úªº°T®§°O¿ý¤¤¡A¤´µM·|¥X²{ "NO
DHCPOFFER" ªº°T®§¡C¦P®É¡A³o­Óª¬ªp¤]·|µo¥Í¦b§Úªº PCMCIA ¤A¤Óºô¸ô¥d¤W¡C}





§A¥²¶·½T©w¡Aºô¸ô¥d¨Ï¥Îªº¬O 10BaseT ³s±µ°ð¡]´N¹³¹q¸Ü½uªº´¡®y)¡C§A³Ì¦nÀË¬d¤@¤U¡A
¶}¾÷®Éºô¸ô¥dªº³]©w¡A¨ì©³¬O¨Ï¥Î¨º­Ó³s±µ°ð¡C¨Ò¦p¡G

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






§Ú´¿Å¥¹L¨Ï¥Î½¥¤W«¬¹q¸£ªº¤H©ê«è¡A¥L­Ì¨Ï¥Î PCMCIA ¤u¨ã¡]¯S§O¬O ifport¡^±N³s±µ°ð³]
©w¬° 10Base2 (¡§²Ó¦P¶b½uºô¸ô¡¨(thinnet)¡^¡A¤]·|¦³³o¼Ëªº°ÝÃD¡C¦pªG§A¤£·Q­«·s³]©w
ºô¸ô¥d©M­«¶}¾÷¡C§A¥²¶·½T©w§A¨Ï¥Îªº¬O 10BaseT ªº³s½u¡C





{\bfseries VI. ¨S¦³¦øªA¾¹¦^À³§Ú DHCP ¥Î¤áºÝªº¼s¼½­n¨D¡]¥Ñ Peter Amstutz ´£¨Ñ¡^}





¦b¬Y¨Ç¨t²Î¤W¡A§Aªº¼s¼½­n¨D¤¤¥²¶·¥]§t§A¾÷¾¹ªº¥D¾÷¦WºÙ¡C¥H dhcpcd ¬°¨Ò¡A§A¥i¥H°õ¦æ
'dhcpcd -h foohost'¡C©Î³\¡A§A¥i¥H¨Ï¥Î§A¦bºô¸ô¤Wªº±b¤á¦WºÙ¡A¨Ó°µ¬°¸Ó¥D¾÷¦WºÙ¡C





{\bfseries VII. §Ú¤w¸g«ö·Ó©Ò¦³ªº¨BÆJ§¹¦¨¤F³]©w¡A¦ý¬O¡A§Úªº¾÷¾¹¤´µMµLªk³s½u¡C}





¡§Æl½u¼Æ¾Ú¾÷¡¨¡]cable modem¡^³q±`·|°O¦í§Aºô¸ô¥dªº¤A¤Óºô¸ô¦ì§}¡A©Ò¥H¡A­Y§A­n³s±µ
·sªº¹q¸£©Î§ó´«ºô¸ô¥d¡A§A¥²¶·¥H¬YºØ¤èªk¨Ó¡§±Ð¾É¡¨§Aªº cable modem »{±o·sªº¹q¸£/ºô¸ô
¥d¡C³q±`§A¥i¥H¥ýÃö±¼ cable modem ¡A¹q¸£¶}¾÷«á¦A¨Ï¥Î cable modem¡A©Î¬O¥H¹q¸Ü½Ð¨D
§Þ³Nªº¤ä´©¡A§iª¾¹ï¤è§Aªº¹q¸£¤w¸g§ó´«¤Fºô¸ô¥d¡C 





§Aªº¨¾¤õÀð³W«h¡]ipfwadm ªº³W«h¡^¤£¤¹³\°ð½s¸¹ 67/68¡] DHCP ¨Ï¥Î¨Ó´²§G³]©w¸ê°T¡^
ªº¬y¶q¡C½Ð¥J²ÓÀË¬d§Aªº¨¾¤õÀð³W«h¡C





{\bfseries VIII. §Ú¨Ï¥Îªº¬O MediaOne Express ©Ò´£¨ÑªºªA°È¡A¦ý¬O§Ú¤´µMµLªk³s½u¡C} 





­ì¦]¥i¯à¬O MediaOne ¦b DHCP ¤¤ªþ¥[¤F¤£À³¸Ó¥X²{ªº°T®§¡C¤@¯ë¬Û«H¡A¦p¤µ³o¤w¤£¦A
¬O­Ó°ÝÃD¡A¦ý¬O§A«oµLªk¨Ï¥Î¥¦¡A§A¥i¥H´Â³o¤è­±¨ÓÀË¬d¡C¦pªG§A¡]¤£¡^©¯¨Ï¥Îªº¬O 
Windows NT¡A¦¹®É¡A¦pªG§A¨Ï¥Î¡§¨Æ¥óÀËµø¾¹¡¨¡]Event Viewer¡^¡A§A±N·|¬Ý¨ì¦p¤Uªº
Äµ¥Ü°T®§¡C





DHCP ±µ¦¬¨ì¤@­Ó¥¼ª¾ªºªø«×¬° 005 ªº 067 ¿ï¶µ¡C­ì©lªº¿ï¶µ¸ê®Æ¦p¤U©Ò¥Ü¡C

{\ttfamily 0000: 62 61 73 69 63            basic}



¦pªG§A¹J¨ì³o¼Ëªº°ÝÃD¡A½Ð¨ì \onlynameurl{} ¤U¸ü­×¥¿
ªº¤G¤¸½X©Î¨ú±o­ì©l½X¡C


















\section{³]©w DHCP ¦øªA¾¹}


\subsection{UNIX ¤Wªº DHCP ¦øªA¾¹}

¦b¦UºØ UNIX ¬Û®eªº§@·~¨t²Î¤W¡A¦³³\¦h°Ó·~©Î§K¶Oªº DHCP ¦øªA¾¹µ{¦¡¥i¥Î¡C¨ä¤¤¡A
¸ûµÛ¦Wªº§K¶O¦øªA¾¹µ{¦¡¬O Paul Vixie/ISC ª©ªº DHCPd¡C¥Ø«e³Ì·sªºª©¥»¬O 2.0¡]
«ØÄ³¤j®a¨Ï¥Î¡^¡A¦Ó 3.0 ª©¥¿¦b°µ beta ¶¥¬qªº´ú¸Õ¡C§A¥i¥H¨ì¤U­±ªººô§}¨ú±o¡G

\onlynameurl{}





¦b RedHat¡]ª©¥» 5.2¡^³o­Ó Linux ®M¥ó¤¤¥]§t¤F¦³ DHCP ¦øªA¾¹¤G¤¸½Xªº RPM ¥]¸Ë¡C
¸Ó RPM ¥]¸ËªºÀÉ¦W¬° dhcp-2.0b1pl6-2.platform.rpm¡C¦w¸Ë®É¥u­n¿é¤J





{\ttfamily rpm -i dhcp-2.0b1pl6-2.i386.rpm}





­Y§A¨Ï¥Î¤W­±ªº¨BÆJ¡A«h§A¥i¥H¸õ¹L¤U­±ªº¦w¸Ë»¡©ú¡C





¦b§A¤U¸ü¤§«á¡A§A¥²¶·±N¥¦¸Ñ¶}¡CµM«á¶i¤J¸Ñ¶}ªº¥Ø¿ý¡A¿é¤J¡G

{\ttfamily ./configure}

­n°µ¦n¦w¸Ë«eªº³]©w¤u§@¡A¥i¯à­nªáÂI®É¶¡¡C½ÐÀH«á¿é¤J¡G

{\ttfamily make}

¥H¤Î

{\ttfamily make install}








\subsection{³]©wºô¸ô²ÕºA¡C}



·í§¹¦¨¦w¸Ë¤§«á¡A½Ð¿é¤J ifconfig -a¡A§A±N¬Ý¨ì¦p¤Uªº°T®§¡G





\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






¦pªG¥¼Åã¥Ü MULTICAST ªº°T®§¡A§AÀ³¸Ó­«·s³]©w§Aªº®Ö¤ß¡A¥[¤J¹ï¡§¦h§}¶Ç¼½¡¨
¡]multicast¡^ªº¤ä´©¡C¹ï©ó¤j¦h¼Æªº¨t²Î¦Ó¨¥¡A§A´X¥G³£¤£¥²¦p¦¹°µ¡C





¤U­Ó¨BÆJ¬O¡A¥[¤J 255.255.255.255 ªº¸ô¥Ñ¡C¥H¤Uªº»¡©ú¤Þ­z¦Û DHCPd µ{¦¡ªº
¡§Åª§ÚÀÉ®×¡¨¡]README¡^¡G





¡§¬°¤FÅý dhcpd ¯à°÷¥¿½T¦aªA°È¹L¤À¬D­çªº DHCP ¥Î¤áºÝ¡]¨Ò¦p¡AWindows 95¡^¡Adhcpd 
¥²¶·¯à°÷°e«Ê¥]¨ì 255.255.255.255 ªº IP ¦ì§}¤W¡C¤£©¯ªº¬O¡ALinux ·|±N 255.255.255.255
°µ¬°¥»¦a¤lºô¸ôªº¼s¼½¦ì§}¡]¦¹³B¬° 192.5.5.223¡^¡C³o±N¹H¤Ï DHCP ³q°T¨ó©w¡AµM¦Ó³\¦h
DHCP ¥Î¤áºÝ¨Ã¤£¨ü¼vÅT¡A¦³¨Ç¡]¨Ò¦p¡A©Ò¦³ Microsoft DHCP ¥Î¤áºÝ¡^«o·|¡C¦³¦¹Ãþ°ÝÃD
ªº¥Î¤áºÝ¡A±N·|¬Ý¤£¨ì¨Ó¦Û¦øªA¾¹ªº DHCPOFFER °T®§¡C¡¨





¿é¤J¡G

{\ttfamily route add -host 255.255.255.255 dev eth0}

¦pªG§A¬Ý¨ì¦p¤Uªº°T®§

{\ttfamily "255.255.255.255: Unknown host"}

§AÀ³¸Ó±N¤U­±ªº¸ê°T¥[¤J¨ì /etc/hosts ÀÉ®×¤¤¡G
/etc/hosts file:

{\ttfamily 255.255.255.255 all-ones}

µM«á¡A¿é¤J¡G

{\ttfamily route add -host all-ones dev eth0}

©Î

{\ttfamily route add 255.255.255.0 dev eth0}

eth0 À³¸Ó¬O§A¥Ø«e¨Ï¥Îºô¸ô¥dªº¸Ë¸m¦WºÙ¡C¦pªG¤£¬O¡A§A±o°t¦X¹ê»Ú±¡ªp°µ¥¿½Tªº­×§ï¡C








\subsection{DHCPd ªº¿ï¶µ³]©w}



²{¦b¡A§A¥²¶·³]©w DHCPd¡C¬°¦¹¡A§A¥²¶·²£¥Í©Î½s¿è /etc/dhcpd.conf¡C





³q±`§A©Ò­n°µªº¬O¡AÀH¾÷¦a«ü¬£ IP ¦ì§}¡C¬°¦¹¡A§A¥²¶·«ö·Ó¤U­±ªº¤è¦¡¨Ó³]©w¡G





\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
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;
}
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






³]©wªºµ²ªG¬°¡ADHCP ¦øªA¾¹·|´£¨Ñ¥Î¤áºÝ¡A¨Ï¥Î½d³ò 192.168.1.10-192.168.1.100 ©Î
192.168.1.150-192.168.1.200 ªº IP ¦ì§}¡C¦pªG¡A¥Î¤áºÝ¨S¦³¯S§O¬ù©w IP ¦ì§}ªº¯²¥Î
®É¶¡¡A«hÄÀ¥X®É¶¡¹w©w¬° 600 ¬í¡A­n¤£µM¡A³Ì¤j¡]¤¹³\¡^ªºÄÀ¥X®É¶¡¬° 7200 ¬í¡C¦P®É
¦øªA¾¹¤]·|¡§³qª¾¡¨¥Î¤áºÝ¡A­n¨D¥¦¨Ï¥Î 255.255.255.0 °µ¬°¤lºô¸ô¾B¸n¡A192.168.1.255
°µ¬°¼s¼½¦ì§}¡A192.168.1.254 °µ¬°¸ô¥Ñ/¹h¹D¾¹¡A¨Ã¥H 192.168.1.2 °µ¬° DNS ¦øªA¾¹¡C





§A¤]¥i¥H¨Ì¾Ú¥Î¤áºÝªº¤A¤Óºô¸ô¦ì§}¡A¨Ó«ü¬£¯S©wªº IP ¦ì§}µ¹¥Î¤áºÝ¡A¨Ò¦p

\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
host haagen {
   hardware ethernet 08:00:2b:4c:59:23;
   fixed-address 192.168.1.222;
}
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}






³o­Ó³]©w±N·|«ü¬£ IP ¦ì§} 192.168.1.222 µ¹¤A¤Óºô¸ô¦ì§}¬°  08:00:2b:4c:59:23 ªº
¥Î¤áºÝ¡C





ºô¸ô¤W IP ¦ì§}ªº«ü©w¡A¥i¥H±Ä²V¦XÂù­y¨î¡AÄ´¦p¡A§A¥i¥HÅý¬Y¨Ç¹q¸£¾Ö¦³¡§ÀRºA¡¨ªº
IP ¦ì§}¡]¨Ò¦p¡A¦øªA¾¹¡^¡A¦ÓÅý¨ä¥¦ªº¥Î¤áºÝ¨ú±o¡§°ÊºA¡¨ªºIP ¦ì§}¡]¨Ò¦p¡A¨Ï¥Î½¥
¤W«¬¹q¸£¡A¾÷°Êªº¨Ï¥ÎªÌ¡^¡CÁÙ¦³¨ä¥¦ªº¿ï¶µ¡AÄ´¦p¡A»¡ wins ¦øªA¾¹ªº¦ì§}¡N®É¶¡¦øªA
¾¹µ¥µ¥¡A¦pªG§A»Ý­n¶i¤@¨BÁA¸Ñªº¸Ü¡A¥i¥H½Ð°Ñ¾\ dhcpd.conf ªº»¡©ú¤å¥ó¡C








\subsection{±Ò°Ê¦øªA¾¹}



¦b±Ò°Ê¦øªA¾¹¤§«e§A¥u­n°µ¤@¥ó¨Æ±¡´N¦æ¤F¡C³q±` DHCP ªº¦w¸Ë¹Lµ{¤¤¨Ã¤£·|²£¥ÍÀÉ®×
dhcp.leases¡C¦øªA¾¹ DHCPd ·|¨Ï¥Î³o­ÓÀÉ®×¨ÓÀx¦s¥Ø«eªº¯²¥Î¸ê°T¡C¸ÓÀÉ®×±Ä¥Î¤@¯ë
¤å¦rªº®æ¦¡¨ÓÀx¦s¸ê®Æ¡A©Ò¥H¦b DHCPd ¾Þ§@´Á¶¡§A¥i¥Hª½±µÀËµø¥¦ªº¤º®e¡C²{¦b§Ú­Ì
¨Ó²£¥ÍÀÉ®× dhcp.leases¡A½Ð¦b©R¥O¦C¤W¿é¤J¡G

{\ttfamily touch /etc/dhcp.leases}

³o­Ó°Ê§@±N·|²£¥Í¤@­ÓªÅ¥ÕªºÀÉ®×¡]ÀÉ®×ªº¤j¤p = 0¡^¡C§A¤£»Ý­n¹ï¸ÓÀÉ®×°µ¥ô¦óªº­×§ï
©Ò¥H¥¦À³¸Ó¬OªÅ¥Õªº¡C­Y§A¬Ý¨ì¤@­Ó¿ù»~ªº°T®§»¡¸ÓÀÉ®×¬OªÅ¥Õªº¡A§A¥i¥H¤£²z·|¥¦¨Ã¥B
½ÐÄ~Äò¥H¤Uªº¨BÆJ¡C



²{¦b¡A§A¥i¥H±Ò¥Î DHCP ¦øªA¾¹¤F¡C¥u­n¿é¤J¡]©Î±N¤U­±ªº±Ô­z¥[¨ì¶}¾÷³]©wÀÉ¤¤¡^

{\ttfamily /usr/sbin/dhcpd}

¦pªG¡A§A·Q­n½T©w¹B§@¬O§_¤@¤Á¥¿±`¡A§AÀ³¸Ó¥ý¶}±Ò°£¿ù¼Ò¦¡¡A¨Ã§â¦øªA¾¹©ñ¨ì¡§¹õ«e¡¨
¡]foreground¡^¨Ó°õ¦æ¡C¬°¦¹¡A§A¥i¥H¿é¤J

{\ttfamily /usr/sbin/dhcpd -d -f}

µM«á¡A¶}±Ò§A¥ô¦ó¤@­Ó¥Î¤áºÝ¾÷¾¹¡A¨Ã¹î¬Ý¦øªA¾¹ºÝ¡§¾Þ§@±±¨î¥x¡¨¡]console¡^ªº¿Ã¹õ¡A
§A±N·|¬Ý¨ì¤@¨Ç°£¿ù°T®§³QÅã¥Ü¥X¨Ó¡C





\end{document}
