home *** CD-ROM | disk | FTP | other *** search
/ Freelog 2 / Freelog002.iso / Linux / Slackware / docs / mini / DHCP < prev    next >
Encoding:
Text File  |  1999-02-08  |  25.6 KB  |  1,057 lines

  1.   DHCP mini-HOWTO (DHCPd/DHCPcd)
  2.   Vladimir Vuksan, vuksan@veus.hr
  3.   v2.5, 18 September 1998
  4.  
  5.   This document attempts to answer basic questions on how to setup your
  6.   Linux box to serve as a DHCP server or a DHCP client.
  7.   ______________________________________________________________________
  8.  
  9.   Table of Contents
  10.  
  11.  
  12.   1. Introduction
  13.  
  14.      1.1 Standard Disclaimer
  15.      1.2 New Versions of this Document
  16.      1.3 Feedback
  17.      1.4 Contributors
  18.      1.5 Copyright Information
  19.  
  20.   2. DHCP protocol
  21.  
  22.   3. Client Setup
  23.  
  24.      3.1 Downloading Client Daemon
  25.      3.2 Slackware setup
  26.      3.3 RedHat 5.0 and up setup
  27.      3.4 RedHat 4.x and Caldera OpenLinux 1.1 setup
  28.      3.5 Debian 1.3.1 setup
  29.      3.6 LinuxPPC and MkLinux setup
  30.      3.7 Token Ring networks
  31.      3.8 Tying it all together
  32.      3.9 Various notes
  33.      3.10 Troubleshooting
  34.  
  35.   4. DHCP Server Setup
  36.  
  37.      4.1 DHCP server for UNIX
  38.      4.2 Network Configuration.
  39.      4.3 Options for DHCPd
  40.      4.4 Starting the server
  41.  
  42.  
  43.   ______________________________________________________________________
  44.  
  45.  
  46.  
  47.   1.  Introduction
  48.  
  49.  
  50.  
  51.  
  52.   1.1.  Standard Disclaimer
  53.  
  54.   No liability for the contents of this documents can be accepted.  Use
  55.   the concepts, examples and other content at your own risk.  As this is
  56.   a new edition of this document, there may be errors and inaccuracies,
  57.   that may of course be damaging to your system.  Proceed with caution,
  58.   and although this is highly unlikely, I don't take any responsibility
  59.   for that.
  60.  
  61.   Also bear in mind that this is NOT official information.  Much content
  62.   in this document are assumptions, which appear to work for people. Use
  63.   the information at your own risk.
  64.  
  65.  
  66.  
  67.   1.2.  New Versions of this Document
  68.  
  69.   New versions of this document will be periodically posted to
  70.   comp.os.linux.answers.  They will also be added to the various
  71.   anonymous FTP sites who archive such information, including:
  72.  
  73.  
  74.  
  75.   In addition, you should generally be able to find this document on the
  76.   Linux Documentation Project page via:
  77.  
  78.  
  79.  
  80.  
  81.   1.3.  Feedback
  82.  
  83.   Feedback is most certaintly welcome for this document.  Without your
  84.   submissions and input, this document wouldn't exist. So, please post
  85.   your additions, comments and criticisms to vuksan@veus.hr.
  86.  
  87.  
  88.  
  89.   1.4.  Contributors
  90.  
  91.   This document has been modified from the original version by Paul
  92.   Makeev.
  93.  
  94.   The following people have contributed to this mini-HOWTO.
  95.  
  96.   ╖  Heiko Schlittermann
  97.  
  98.   ╖  Jonathan Smith
  99.  
  100.   ╖  Dan Khabaza
  101.  
  102.   ╖  Hal Sadofsky
  103.  
  104.   ╖  Henrik Stoerner
  105.  
  106.   ╖  Paul Rossington
  107.  
  108.  
  109.  
  110.   1.5.  Copyright Information
  111.  
  112.   This document is copyrighted (c)1998 Vladimir Vuksan and distributed
  113.   under the following terms:
  114.  
  115.  
  116.  
  117.   ╖  Linux HOWTO documents may be reproduced and distributed in whole or
  118.      in part, in any medium physical or electronic, as long as this
  119.      copyright notice is retained on all copies. Commercial
  120.      redistribution is allowed and encouraged; however, the author would
  121.      like to be notified of any such distributions.
  122.  
  123.   ╖  All translations, derivative works, or aggregate works
  124.      incorporating any Linux HOWTO documents must be covered under this
  125.      copyright notice.  That is, you may not produce a derivative work
  126.      from a HOWTO and impose additional restrictions on its
  127.      distribution. Exceptions to these rules may be granted under
  128.      certain conditions; please contact the Linux HOWTO coordinator at
  129.      the address given below.
  130.  
  131.   ╖  If you have questions, please contact the Linux HOWTO coordinator
  132.      at
  133.      linux-howto@sunsite.unc.edu
  134.  
  135.  
  136.  
  137.  
  138.   2.  DHCP protocol
  139.  
  140.  
  141.   DHCP is Dynamic Host Configuration Protocol. It is used to control
  142.   vital networking parameters of hosts (running clients) with the help
  143.   of a server. DHCP is backward compatible with BOOTP. For more
  144.   information see RFC 2131 (old RFC 1531) and other. (See Internet
  145.   Resources section at the end of the document). You can also read DHCP
  146.   FAQ (http://web.syr.edu/ jmwobus/comfaqs/dhcp.faq.html).
  147.  
  148.  
  149.   This mini-HOWTO covers both the DHCP _SERVER_ daemon as well as DHCP
  150.   _CLIENT_ daemon. Most people need the client daemon which is used by
  151.   workstations to obtain network information from a remote server. The
  152.   server daemon is used by system administrators to distribute network
  153.   information to clients so if you are just a regular user you need the
  154.   _CLIENT_ daemon.
  155.  
  156.  
  157.   3.  Client Setup
  158.  
  159.   3.1.  Downloading Client Daemon
  160.  
  161.  
  162.   2.0.x kernels
  163.  
  164.  
  165.   No matter what distribution you are using you will need to download
  166.   the DHCP client daemon for Linux. The package you need to download is
  167.   called dhcpcd and the current version is 0.70. You can read the
  168.   description of the package here.
  169.   (ftp://sunsite.unc.edu/pub/Linux/system/network/daemons/dhcpcd-0.70.lsm)
  170.  
  171.  
  172.  
  173.   2.1.x kernels
  174.  
  175.  
  176.  
  177.   Due to changes in ipv4 network package in 2.1.x kernels (e.g. way it
  178.   sets the defaults for several fields) dhcpcd doesn't work properly.
  179.   Most users don't run experimental kernels so this shouldn't be a
  180.   problem. If you do you should try dhcpcd 1.3.6  which is a modified
  181.   version that has been written by Sergei Viznyuk  sergei@phystech.com
  182.   in order to avoid mentioned problems. You can fetch it at:
  183.  
  184.  
  185.  
  186.  
  187.   ╖
  188.  
  189.   ╖
  190.  
  191.  
  192.   3.2.  Slackware setup
  193.  
  194.  
  195.   You can download the latest copy of the DHCPcd from any sunsite mirror
  196.   or following:
  197.  
  198.  
  199.   ╖
  200.  
  201.  
  202.   ╖
  203.  
  204.  
  205.   ╖   (Primary site in Japan)
  206.  
  207.  
  208.  
  209.   Download the latest version of dhcpcd.tar.gz
  210.  
  211.  
  212.   ╖  Unpack it
  213.  
  214.  
  215.  
  216.      tar -zxvf dhcpcd-0.70.tar.gz
  217.  
  218.  
  219.   ╖  cd into the directory and make dhcpcd
  220.  
  221.  
  222.      cd dhcpcd-0.70
  223.  
  224.      make
  225.  
  226.  
  227.   ╖  Install it (you have to run the following command as root)
  228.  
  229.  
  230.      make install
  231.  
  232.  
  233.   This will create the directory /etc/dhcpc where DHCPcd will store the
  234.   DHCP information and dhcpcd file will be copied into /usr/sbin.
  235.  
  236.   In order to make the system initialize using DHCP during boot type:
  237.  
  238.   cd /etc/rc.d
  239.  
  240.   mv rc.inet1 rc.inet1.OLD
  241.  
  242.  
  243.   This will move the old network initialization script into
  244.   rc.inet1.OLD.  You now need to create the new rc.inet1 script.
  245.   Following code is all you need:
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.   ______________________________________________________________________
  266.   #!/bin/sh
  267.   #
  268.   # rc.inet1      This shell script boots up the base INET system.
  269.  
  270.   HOSTNAME=`cat /etc/HOSTNAME` #This is probably not necessary but I
  271.                                #will leave it in anyways
  272.  
  273.   # Attach the loopback device.
  274.   /sbin/ifconfig lo 127.0.0.1
  275.   /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
  276.  
  277.   # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the
  278.   # eth0 interface. If you're only using loopback or SLIP, don't include the
  279.   # rest of the lines in this file.
  280.  
  281.   /usr/sbin/dhcpcd
  282.   ______________________________________________________________________
  283.  
  284.  
  285.  
  286.   Save it and reboot your computer.
  287.  
  288.  
  289.  
  290.   When you are finished go the ``last step''
  291.  
  292.  
  293.   3.3.  RedHat 5.0 and up setup
  294.  
  295.  
  296.   DHCPcd configuration under RedHat 5.0+ is really easy. All you need to
  297.   do is start the Control Panel by typing
  298.  
  299.  
  300.  
  301.   control-panel
  302.  
  303.  
  304.  
  305.   Then select "Network Configuration" and under ethernet (usually eth0)
  306.   interface define DHCP as your protocol. Other parameters should be
  307.   left blank.
  308.  
  309.  
  310.  
  311.   When you are finished go the ``last step''
  312.  
  313.  
  314.  
  315.   3.4.  RedHat 4.x and Caldera OpenLinux 1.1 setup
  316.  
  317.  
  318.   DHCPcd is included in the standard RedHat distribution as an RPM and
  319.   you can find it on your distribution's CD-ROM in RPMS directory or you
  320.   can download it from:
  321.  
  322.  
  323.  
  324.  
  325.  
  326.   and install it with
  327.  
  328.   rpm -i dhcpcd-0.6-2.i386.rpm
  329.  
  330.  
  331.   Alternatively you can compile your own version by following the steps
  332.   outlined in the Slackware.
  333.  
  334.  
  335.  
  336.   This information was provided to me by nothing nothing@cc.gatech.edu
  337.  
  338.  
  339.   ______________________________________________________________________
  340.   Removed my static ip and name from /etc/resolv.conf. However, I
  341.   did leave in the search line and my two nameserver lines (for some reason my
  342.   dhcpcd never creates a /etc/dhcpc/resolv.conf, so I have to use a static
  343.   /etc/resolv.conf).
  344.  
  345.   In /etc/sysconfig/network I removed the HOSTNAME and GATEWAY
  346.   entries. I left the other entries as is
  347.   (NETWORKING, DOMAINNAME, GATEWAYDEV).
  348.  
  349.   In /etc/sysconfig/network-scripts/ifcfg-eth0 I removed the IPADDR,
  350.   NETMASK, NETWORK, and BROADCAST entries. I left DEVICE and ONBOOT as is.
  351.   I changed the BOOTPROTO line to BOOTPROTO=dhcp.
  352.  
  353.   Save the file. Reboot your computer.
  354.   ______________________________________________________________________
  355.  
  356.  
  357.  
  358.   When you are finished go the ``last step''
  359.  
  360.  
  361.  
  362.   3.5.  Debian 1.3.1 setup
  363.  
  364.  
  365.   There is a deb package of DHCPcd at
  366.  
  367.  
  368.  
  369.  
  370.  
  371.   or you can follow the Slackware installation instructions.  To unpack
  372.   the deb package type
  373.  
  374.   dpkg -i /where/ever/your/debian/packages/are/dhcpd*deb
  375.  
  376.  
  377.  
  378.   It appears that there isn't a need for any DHCPcd configuration
  379.   because:
  380.  
  381.   From: Heiko Schlittermann (heiko@os.inf.tu-dresden.de)
  382.  
  383.  
  384.  
  385.   The dhcpcd package installs it's startup script as usual for debian
  386.   packages in /etc/init.d/<package_name>, here as /etc/init.d/dhcpcd,
  387.   and links this to the various /etc/rc?.d/ directories.
  388.  
  389.  
  390.  
  391.   The contents of the /etc/rc?.d/ dirs is then executed at boot time.
  392.  
  393.  
  394.  
  395.   If you don't reboot after installing you should consider starting the
  396.   daemon manually:
  397.   /etc/init.d/dhcpcd start
  398.  
  399.  
  400.   When you are finished go the ``last step''
  401.  
  402.  
  403.   3.6.  LinuxPPC and MkLinux setup
  404.  
  405.  
  406.   Following section has been written by R. Shapiro
  407.  
  408.  
  409.  
  410.   Versions 0.65 and 0.70 of Yoichi Hariguchi's dhcpcd should work
  411.   properly for both variants of linux on ppc, with the following
  412.   caveats:
  413.  
  414.  
  415.  
  416.   * If you want, or need, to build the executable from sources, note
  417.   that the ppc linux compilers assume that 'char' is 'unsigned char'
  418.   while the Hariguchi sources assume 'char' is 'signed char'. To build
  419.   from sources you must edit the Makefile so that CFLAGS includes the
  420.   option "-fsigned-char".
  421.  
  422.  
  423.  
  424.   * The current stable release of linuxppc [aka linux-pmac] is 2.1.24
  425.   and requires the 2.1 patch (http://www.cro.net/ vuksan/dhcppatch).
  426.   Both the DR2.1 and DR3.0 releases of mklinux use a 2.0 kernel (2.0.33)
  427.   and do not require this patch, although it's harmless to apply it.
  428.   Note that the dhcpcd rpm on the linuxppc cd-rom does not include the
  429.   2.1 patch and therefore will not work with the linux on that cd! It
  430.   will work with mklinux however.
  431.  
  432.  
  433.  
  434.   * In the linuxppc 2.1 kernels, you'll see a router warning shortly
  435.   after dhcpcd starts up.  You can ignore this.
  436.  
  437.  
  438.  
  439.   * The Hariguchi dhcpcd takes awhile, about 30 seconds, to make its
  440.   initial connection to the server and to set up routing.  In the 2.1
  441.   linuxppc kernels, the warning mentioned above is an indication that
  442.   the routing is ready. In mklinux, you'll have to keep checking netstat
  443.   -r to find out.
  444.  
  445.  
  446.  
  447.   As far as Viznyuk's version of dhcpcd is concerned I have a Viznyuk
  448.   dhcpcd (v1.3.7) executable that works in recent linuxppc kernels:
  449.   2.1.102, 103, 115, and 119 have been tested.  It's possible to build
  450.   this from sources, but I don't know the details.  The Viznyuk dhcpcd
  451.   doesn't work in 2.1.24, but in that kernel the patched Hariguchi
  452.   dhcpcd works.  The Hariguchi dhcpcd can be built easily from sources.
  453.  
  454.  
  455.  
  456.   Short summary:
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.   ______________________________________________________________________
  464.   2.1.24:   Hariguchi: yes if patched (easy to build); Viznyuk: no
  465.   2.1.102+: Hariguchi: no; Viznyuk: yes (tricky to build)
  466.   ______________________________________________________________________
  467.  
  468.  
  469.  
  470.  
  471.  
  472.   Once dhcpcd is installed, do the following in addition to the
  473.   resolv.conf issue mentioned in ``last step''.
  474.  
  475.  
  476.  
  477.  
  478.   ╖  Delete or rename /etc/sysconfig/network-scripts/ifcfg-eth0
  479.  
  480.   ╖  Remove everything from /etc/sysconfig/network except NETWORKING
  481.      and, if you have a fixed symbolic name, HOSTNAME
  482.  
  483.  
  484.  
  485.   If you want a precompiled 0.70 dhcpcd for linuxppc 2.1 kernels, send
  486.   mail to reshapiro@mediaone.net.
  487.  
  488.  
  489.  
  490.  
  491.   3.7.  Token Ring networks
  492.  
  493.  
  494.   If you are trying to run dhcpcd on the Token Ring Network it will not
  495.   work.  This is the solution provided to me by Henrik Stoerner
  496.   (henrik_stoerner@olicom.dk)
  497.  
  498.  
  499.  
  500.   The problem is that dhcpcd only knows about Ethernet cards. If it
  501.   finds a Token-Ring card, it refuses to do anything with it and reports
  502.   "interface is not ethernet".
  503.  
  504.  
  505.  
  506.   The solution is to apply a simple patch to the dhcpcd sources. I have
  507.   put up a small web page with the patch, RedHat RPM-files and a
  508.   precompiled binary at
  509.  
  510.  
  511.  
  512.   The patch has been sent to the dhcpcd maintainer, so hopefully it will
  513.   be included in a future release of dhcpcd.
  514.  
  515.  
  516.   3.8.  Tying it all together
  517.  
  518.  
  519.   After your machine reboots your network interface should be
  520.   configured.  Type:
  521.  
  522.   ifconfig
  523.  
  524.   You should get something like this
  525.  
  526.  
  527.  
  528.  
  529.   ______________________________________________________________________
  530.   lo        Link encap:Local Loopback
  531.             inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
  532.             UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
  533.             RX packets:302 errors:0 dropped:0 overruns:0 frame:0
  534.             TX packets:302 errors:0 dropped:0 overruns:0 carrier:0 coll:0
  535.  
  536.   eth0      Link encap:Ethernet  HWaddr 00:20:AF:EE:05:45
  537.             inet addr:24.128.53.102  Bcast:24.128.53.255  Mask:255.255.254.0
  538.             ^^^^^^^^^^^^^^^^^^^^^^^
  539.             UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
  540.             RX packets:24783 errors:1 dropped:1 overruns:0 frame:1
  541.             TX packets:11598 errors:0 dropped:0 overruns:0 carrier:0 coll:96
  542.             Interrupt:10 Base address:0x300
  543.   ______________________________________________________________________
  544.  
  545.  
  546.  
  547.  
  548.  
  549.   If you have some normal number under inet. addr you are set. If you
  550.   see 0.0.0.0 don't despair, it is a temporary setting before dhcpcd
  551.   acquires the IP address. If even after few minutes you are seeing
  552.   0.0.0.0 please check out  ``troubleshooting''.  DHCPcd is a daemon and
  553.   will stay running as long as you have your machine on. Every three
  554.   hours it will contact the DHCP server and try to renew the IP address
  555.   lease. It will log all the messages in the syslog (on Slackware
  556.   /var/adm/syslog, RedHat/OpenLinux /var/log/syslog).
  557.  
  558.   One final thing. You need to specify your nameservers. There are two
  559.   ways to do it, you can either ask your provider to provide you with
  560.   the addresses of your name server and then put those in the
  561.   /etc/resolv.conf or DHCPcd will obtain the list from the DHCP server
  562.   and will build a resolv.conf in /etc/dhcpc.  I decided to use DHCPcds
  563.   resolv.conf by doing the following:
  564.  
  565.  
  566.   Back up your old /etc/resolv.conf
  567.  
  568.   mv /etc/resolv.conf /etc/resolv.conf.OLD
  569.  
  570.   If directory /etc/dhcpc doesn't exist create it
  571.  
  572.   mkdir /etc/dhcpc
  573.  
  574.   Make a link from /etc/dhcpc/resolv.conf to /etc/resolv.conf
  575.  
  576.   ln -s /etc/dhcpc/resolv.conf /etc/resolv.conf
  577.  
  578.  
  579.   If that doesn't work try this (fix suggested by nothing@cc.gatech.edu
  580.   with a little amendment by Henrik Stoerner)
  581.  
  582.  
  583.  
  584.  
  585.   This last step I had to perform only because my dhcpcd doesn't create
  586.   an /etc/dhcpc/resolv.conf.  In /etc/sysconfig/network-scripts/ifup I
  587.   made the following changes (which are a very poor hack, but they work
  588.   for me):
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.   ______________________________________________________________________
  596.   elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
  597.       echo -n "Using DHCP for ${DEVICE}... "
  598.       /sbin/dhcpcd -c /etc/sysconfig/network-scripts/ifdhcpc-done ${DEVICE}
  599.       echo "echo \$$ > /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh
  600.  
  601.       if [ -f /var/run/dhcp-wait-${DEVICE}.pid ]; then
  602.           ^^^^
  603.           echo "failed."
  604.           exit 1
  605.   ______________________________________________________________________
  606.  
  607.  
  608.  
  609.   I changed to:
  610.  
  611.  
  612.   ______________________________________________________________________
  613.   elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
  614.       echo -n "Using DHCP for ${DEVICE}... "
  615.       /sbin/dhcpcd
  616.       echo "echo \$$ > /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh
  617.  
  618.       if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ]; then
  619.           ^^^^^^
  620.          echo "failed."
  621.          exit 1
  622.   ______________________________________________________________________
  623.  
  624.  
  625.  
  626.  
  627.  
  628.   Notice the ! (bang) in if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ];
  629.  
  630.  
  631.  
  632.  
  633.  
  634.   Now sit back and enjoy :-).
  635.  
  636.   3.9.  Various notes
  637.  
  638.  
  639.   Following step(s) are not necessary but might be useful to some people
  640.  
  641.   a)  If you need network connectivity only occasionally you can start
  642.   dhcpcd from the command line (you have to be root to do this) with:
  643.  
  644.  
  645.   /usr/sbin/dhcpcd
  646.  
  647.   When you need to down (turn off) the network type
  648.  
  649.   /usr/sbin/dhcpcd -k
  650.  
  651.  
  652.  
  653.   3.10.  Troubleshooting
  654.  
  655.  
  656.   If you have followed the steps outlined above and you are unable to
  657.   access the network there are several possible explanations:
  658.  
  659.  
  660.  
  661.   I. Your network card is not configured properly.
  662.  
  663.  
  664.   During the boot up process your Linux will probe your network card and
  665.   should say something along these lines:
  666.  
  667.  
  668.   ______________________________________________________________________
  669.   eth0: 3c509 at 0x300 tag 1, 10baseT port, address  00 20 af ee 11 11, IRQ 10.
  670.   3c509.c:1.07 6/15/95 becker@cesdis.gsfc.nasa.gov
  671.   ______________________________________________________________________
  672.  
  673.  
  674.  
  675.   If a message like this doesn't appear your ethernet card might not be
  676.   recognized by your Linux system. If you have a generic ethernet card
  677.   (a NE2000 clone) you should have received a disk with DOS utilities
  678.   that you can use to set up the card. Try playing with IRQs until Linux
  679.   recognizes your card (IRQ 9,10,12 are usually good).
  680.  
  681.  
  682.  
  683.   II. Your DHCP server supports RFC 1541
  684.  
  685.  
  686.   Try running dhcpcd by typing
  687.  
  688.   dhcpcd -r
  689.  
  690.   Use ifconfig to check if your network interface is configured (wait
  691.   few seconds for the configuration process, initally it will say
  692.   Inet.addr=0.0.0.0)
  693.  
  694.   If this solves your problem add the "-r" flag to the boot up scripts
  695.   ie. instead of /sbin/dhcpcd you will have /sbin/dhcpcd -r
  696.  
  697.  
  698.  
  699.   III. During bootup I get error message "Using DHCP for eth0 ...
  700.   failed" but my system works fine.
  701.  
  702.  
  703.  
  704.   You are most likely using RedHat and you haven't followed instructions
  705.   carefully :-). You are missing the ! (bang) in one of the if
  706.   statements.  Jump ``here'' and check how to fix it.
  707.  
  708.  
  709.  
  710.   IV. My network works for few minutes and then stops responding
  711.  
  712.  
  713.  
  714.   There are some reports of gated (gateway daemon) screwing up routing
  715.   on Linux boxes which results in problem described above. Check if
  716.   gated is running
  717.  
  718.  
  719.  
  720.   ps -auxww | grep gate
  721.  
  722.  
  723.  
  724.   If it is try removing it with RedHat's RPM manager or removing the
  725.   entry in /etc/rc.d/
  726.  
  727.   V. My ethernet card is recognized during boot up but I still get "NO
  728.   DHCPOFFER" message in my logs. I also happen to have a PCMCIA ethernet
  729.   card.
  730.  
  731.  
  732.  
  733.   You need to make sure that you have the 10BaseT port ("phone" plug) on
  734.   your network card activated. Best way to verify it is to check what
  735.   kind of connector your card is configured for during bootup e.g.
  736.  
  737.  
  738.   ______________________________________________________________________
  739.   eth0: 3c509 at 0x300 tag 1, 10baseT port, address  00 20 af ee 11 11, IRQ 10.
  740.                               ^^^^^^^^^^^^
  741.   3c509.c:1.07 6/15/95 becker@cesdis.gsfc.nasa.gov
  742.   ______________________________________________________________________
  743.  
  744.  
  745.  
  746.  
  747.  
  748.   I have received reports of laptop users having this kind of problems
  749.   due to the PCMCIA utilities (specifically ifport) that would set the
  750.   connector type to 10Base2 (thinnet). You have to make sure you use
  751.   10BaseT for your connection. If you are not reconfigure the card and
  752.   restart the computer.
  753.  
  754.  
  755.  
  756.   VI. My DHCP client broadcasts requests but no one answers (Contributed
  757.   by Peter Amstutz)
  758.  
  759.  
  760.  
  761.   On some systems, you need to include some hostname for your machine as
  762.   part of the request.  With dhcpcd, do this with 'dhcpcd -h foohost'
  763.   Probably the hostname wanted will be your account username on the
  764.   network.
  765.  
  766.  
  767.  
  768.   VII. I have followed all the steps but still my machine is not able to
  769.   connect
  770.  
  771.  
  772.  
  773.   The cable modem will usually memorize the ethernet address of your
  774.   network card so if you connect a new computer or switch network cards
  775.   you will somehow have to "teach" your cable modem to recognize the new
  776.   computer/card. Usually you can turn of the modem and bring it back up
  777.   while computer is on or you will have to call tech support and tell
  778.   them that you have changed a network card in the computer.
  779.  
  780.  
  781.  
  782.   You have firewall rules (ipfwadm rules) that disallow port 67/68
  783.   traffic used by DHCP to distribute configuration info. Check your
  784.   firewall rules carefully.
  785.  
  786.  
  787.  
  788.   VIII. I have MediaOne Express service and I still can't connect.
  789.  
  790.  
  791.  
  792.  
  793.   It appears that MediaOne has been using adding some things to DHCP
  794.   that shouldn't be there. Supposedly this is not a problem anymore but
  795.   if you experience outages check for these things. If you are (un)lucky
  796.   to have Windows NT on your machine if you go into Event Viewer you
  797.   will see a warning like this.
  798.  
  799.  
  800.   DHCP received an unknown option 067 of length 005. The raw option data
  801.   is given  below.
  802.  
  803.   0000: 62 61 73 69 63            basic
  804.  
  805.  
  806.   If this is the problem go to
  807.  
  808.   and either download a binary or get the source for the change.
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.   4.  DHCP Server Setup
  819.  
  820.   4.1.  DHCP server for UNIX
  821.  
  822.   There are several DHCP servers available for U*X-like OSes, both
  823.   commercial and free. One of the more popular free DHCP servers is Paul
  824.   Vixie/ISC DHCPd. Currently the latest version is 1.0 (suggested for
  825.   most users) but 2.0 is in beta testing.  You can get them from
  826.  
  827.  
  828.  
  829.  
  830.   After you download it you need to unpack it. After you do cd into the
  831.   distribution directory and type:
  832.  
  833.   ./configure
  834.  
  835.   It will take some time to configure the settings. After it is done
  836.   type:
  837.  
  838.   make
  839.  
  840.   and
  841.  
  842.   make install
  843.  
  844.  
  845.  
  846.  
  847.   4.2.  Network Configuration.
  848.  
  849.  
  850.   When done with installation type ifconfig -a. You should see something
  851.   like this:
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.   ______________________________________________________________________
  860.   eth0      Link encap:10Mbps Ethernet  HWaddr 00:C0:4F:D3:C4:62
  861.             inet addr:183.217.19.43  Bcast:183.217.19.255  Mask:255.255.255.0
  862.             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  863.             RX packets:2875542 errors:0 dropped:0 overruns:0
  864.             TX packets:218647 errors:0 dropped:0 overruns:0
  865.             Interrupt:11 Base address:0x210
  866.   ______________________________________________________________________
  867.  
  868.  
  869.  
  870.  
  871.  
  872.   If it doesn't say MULTICAST you should reconfigure your kernel and add
  873.   multicast support. On most systems you will not need to do this.
  874.  
  875.  
  876.  
  877.   Next step is to add route for 255.255.255.255. Quoted from DHCPd
  878.   README:
  879.  
  880.  
  881.  
  882.   "In order for dhcpd to work correctly with picky DHCP clients (e.g.,
  883.   Windows 95), it must be able to send packets with an IP destination
  884.   address of 255.255.255.255.  Unfortunately, Linux insists on changing
  885.   255.255.255.255 into the local subnet broadcast address (here, that's
  886.   192.5.5.223).  This results in a DHCP protocol violation, and while
  887.   many DHCP clients don't notice the problem, some (e.g., all Microsoft
  888.   DHCP clients) do.  Clients that have this problem will appear not to
  889.   see DHCPOFFER messages from the server."
  890.  
  891.  
  892.  
  893.   Type:
  894.  
  895.   route add -host 255.255.255.255 dev eth0
  896.  
  897.   If you get a message
  898.  
  899.   "255.255.255.255: Unknown host"
  900.  
  901.   You should try adding the following entry to your /etc/hosts file:
  902.  
  903.   255.255.255.255 all-ones
  904.  
  905.   Then, try:
  906.  
  907.   route add -host all-ones dev eth0
  908.  
  909.   or
  910.  
  911.   route add -net 255.255.255.0 dev eth0
  912.  
  913.   eth0 is of course the name of the network device you are using.  If it
  914.   differs change appropriately.
  915.  
  916.  
  917.  
  918.  
  919.   4.3.  Options for DHCPd
  920.  
  921.  
  922.   Now you need to configure DHCPd. In order to do this you will have to
  923.   create or edit /etc/dhcpd.conf.
  924.  
  925.   Most commonly what you want to do is assign IP addresses randomly.
  926.   This can be done with settings as follows
  927.  
  928.  
  929.  
  930.  
  931.   ______________________________________________________________________
  932.   default-lease-time 600;
  933.   max-lease-time 7200;
  934.   option subnet-mask 255.255.255.0;
  935.   option broadcast-address 192.168.1.255;
  936.   option routers 192.168.1.254;
  937.   option domain-name-servers 192.168.1.1, 192.168.1.2;
  938.   option domain-name "mydomain.org";
  939.  
  940.   subnet 192.168.1.0 netmask 255.255.255.0 {
  941.      range 192.168.1.10 192.168.1.100;
  942.      range 192.168.1.150 192.168.1.200;
  943.   }
  944.   ______________________________________________________________________
  945.  
  946.  
  947.  
  948.  
  949.  
  950.   This will result in DHCP server giving a client an IP address from the
  951.   range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It
  952.   will lease an IP address for 600 seconds if the client doesn't ask for
  953.   specific time frame. Otherwise the maximum (allowed) lease will be
  954.   7200 seconds. The server will also "advise" the client that it should
  955.   use 255.255.255.0 as its subnet mask,  192.168.1.255 as its broadcast
  956.   address, 192.168.1.254 as the router/gateway and 192.168.1.1 and
  957.   192.168.1.2 as its DNS servers.
  958.  
  959.  
  960.  
  961.   You can also assign specific IP addresses based on clients ethernet
  962.   address e.g.
  963.  
  964.  
  965.   ______________________________________________________________________
  966.   host haagen {
  967.      hardware ethernet 08:00:2b:4c:59:23;
  968.      fixed-address 192.168.1.222;
  969.   }
  970.   ______________________________________________________________________
  971.  
  972.  
  973.  
  974.  
  975.  
  976.   This will assign IP address 192.168.1.222 to a client with ethernet
  977.   address 08:00:2b:4c:59:23.
  978.  
  979.  
  980.  
  981.   You can also mix and match e.g. you can have certain clients getting
  982.   "static" IP addresses (e.g. servers) and others being alloted dynamic
  983.   IPs (e.g. mobile users with laptops). There are a number of other
  984.   options e.g. wins server addresses, time server etc., if you need any
  985.   of those options please read the dhcpd.conf man page.
  986.  
  987.  
  988.  
  989.  
  990.  
  991.   4.4.  Starting the server
  992.  
  993.  
  994.   You can now invoke the DHCP server. Simply type (or include in the
  995.   bootup scripts)
  996.  
  997.   /usr/sbin/dhcpd
  998.  
  999.   If you want to verify that everything is working fine you should first
  1000.   turn on the debugging mode and put the server in foreground. You can
  1001.   do this by typing
  1002.  
  1003.   /usr/sbin/dhcpd -d -f
  1004.  
  1005.   Then boot up one of your clients and check out the console of your
  1006.   server.  You will see a number of debugging messages coming up.
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.