home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Enter 1999 June / enter_06_1999.iso / doc / HOWTO / mini / DHCPcd < prev    next >
Text File  |  1998-10-14  |  25KB  |  991 lines

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