Configuring Redhat Linux 5.1 for RoadRunner

David Fox, UCSD Cognitive Science

Configuring redhat 5.0 or 5.1 for Roadrunner is quite simple. Use the "Interfaces" tab of the netcfg program to set up eth0 (or whatever ethernet device you are connecting to the modem) to use the dhcp protocol. Don't enter any IP number or netmask, but select "activate at boot time" if you wish. Then insert the following code after the first line of /etc/sysconfig/network-scripts/ifdhcpc-done:
  PATH=/bin:/sbin:/usr/local/sbin
  if [ -f /var/run/rrlogin.pid ]
  then
        kill `cat /var/run/rrlogin.pid`
        rm /var/run/rrlogin.pid
  fi
  rrlogin rr_login_name rr_password
(Substuting your own login and password.) Now use netcfg to activate the interface. Voila, you should now be connected to the internet.

Note that the changes to /etc/sysconfig/network-scripts/ifdhcpc-done will be silently overwritten if you upgrade the initscripts package, which will probably happen if you upgrade to a later version of Redhat. Also note that you should restrict the file permissions on ifdhcpc-done now that it contains your password.


Commentary

Below is the portion of /etc/sysconfig/network-scripts/ifup that starts the road runner ethernet interface:
  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
        echo "failed."
        exit 1
    else
        rm -f /var/run/dhcp-wait-${DEVICE}.pid
        echo "done."
        IPSETUP=yes
    fi
  fi
Note that it starts the dhcpcd daemon which runs the script /etc/sysconfig/network-scripts/ifdhcpc-done as soon as it gets the IP address. The daemon runs in the background, so the ifup script continues and puts its PID into a temporary file. It then starts a subprocess that waits up to 30 seconds for itself to be killed by the ifdhcpc-done script. The ifdhcpc-done file contains the following by default:
  #!/bin/sh -x

  SLEEPPIDFILE=/var/run/dhcp-wait-${IFNAME}.pid

  if [ ! -f $SLEEPPIDFILE ]; then
    # the parent must have timed out already -- we can't do much about
    # it now
    echo "DHCP configured but ifup timed out"
    #exit 0
  fi

  # get the pid of the process which is waiting for this to complete
  SLEEPPID=`cat $SLEEPPIDFILE`
  rm -f $SLEEPPIDFILE
  kill $SLEEPPID

  if [ -f /etc/dhcpc/resolv.conf ]; then
        echo "setting up resolv.conf" >> /tmp/dhcplog
        cp /etc/dhcpc/resolv.conf /etc
  fi
We need to Phil Karn's code at the beginning of this script to kill any rrlogin process that is already running and start a new rrlogin process:
  PATH=/bin:/sbin:/usr/local/sbin
  if [ -f /var/run/rrlogin.pid ]
  then
        kill `cat /var/run/rrlogin.pid`
        rm /var/run/rrlogin.pid
  fi
  rrlogin rr_login_name rr_password
The ifdhcpc-done file belongs to the initscripts package, and it is not a config file - upgrading or re-installing the initscripts package will overwrite your changes silently. Also note that your password is contained in this file, which is installed world readable and considered world readable by the RPM database. Therefore, you should probably update initscripts to version 3.67 first:
  rpm -Uvh ftp://ftp.redhat.com/updates/5.1/i386/initscripts-3.67-1.i386.rpm

If you still have trouble...

...and you decide to contact me, please answer all of the following questions to the best of your ability in your message:
  1. Did you edit /etc/sysconfig/network-scripts/ifdhcpc-done and fill in your own user name and password?
  2. Did you compile and install the rrlogin program?
  3. Is the dhcpcd package installed? What does "rpm -q dhcpcd" print?
  4. Did any messages appear in the system log when the system attempted to configure your connection?
  5. Did the modem's PC light come on?
  6. Are you using a 3com 3C509 network card?
  7. What is in /etc/dhcpc?
  8. Did you run netcfg and change your card's configuration protocol to dhcp? Did you check "activate interface at boot time"?