Using a DHCP client with Linux 2.2 on RedHat 5.2

Simon Josefsson, jas@pdc.kth.se


If you have upgraded your RedHat 5.2 system to the new kernel and where using DHCP I guess you've noticed that DHCP no longer works. Theese are the steps I took to have the system working again.

  1. Compile and install the Linux 2.2 kernel.

  2. Make a copy of the old dhcpcd binary, in case you wish to downgrade to Linux 2.0.



  3. Fetch DHCPCD and compile it.

    There is probably a RPM somewhere for this, if someone knows a link to it I'll add it here.

  4. Make a copy of the old ifup and ifdown script, in case you wish to downgrade to Linux 2.0.



  5. Apply this patch to /sbin/ifup:

    --- /sbin/ifup-2.0      Thu Oct 15 18:07:52 1998
    +++ /sbin/ifup  Sat Feb  6 19:05:24 1999
    @@ -100,17 +100,11 @@
         rm -f ${TMPFILE}
     elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
         echo -n "Using DHCP for ${DEVICE}... "
    -    IFNAME=${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
    +    if dhcpcd ${DEVICE}; then
    +       IPSETUP=yes
    +    else
            echo "failed."
            exit 1
    -    else
    -       rm -f /var/run/dhcp-wait-${DEVICE}.pid
    -       echo "done."
    -       IPSETUP=yes
         fi
     fi
     
          
    In case you aren't able to apply the above patch, here is the complete file. Put it in /sbin/ifup.

  6. Apply this patch to /sbin/ifdown:

    --- /sbin/ifdown-2.0    Sun Feb 21 19:27:15 1999
    +++ /sbin/ifdown        Sun Feb 21 19:29:24 1999
    @@ -42,8 +42,7 @@
     fi
     
     if [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
    -       if [ -f /var/run/dhcpcd-${DEVICE}.pid ]; then
    -               kill `cat /var/run/dhcpcd-${DEVICE}.pid`
    +       if dhcpcd -k; then
                    rm -f /var/run/dhcpcd-${DEVICE}.pid
                    exit 0
            fi
          
    In case you aren't able to apply the above patch, here is the complete file. Put it in /sbin/ifdown.

  7. The file /etc/sysconfig/network-script/ifdhcpc-done is no longer needed, if you never want to revert back to Linux 2.0 you can safely delete it.

That's it.

Credits to Peter Tillemans for finding out about having to patch ifdown too.


Last modified: Sun Feb 21 19:32:57 MET 1999