LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problems getting DHCP address with dhcpcd using tg3 driver (https://www.linuxquestions.org/questions/linux-networking-3/problems-getting-dhcp-address-with-dhcpcd-using-tg3-driver-554794/)

Cluracan 05-17-2007 10:19 PM

Problems getting DHCP address with dhcpcd using tg3 driver
 
I've built up my LFS v6.2 system using kernel version 2.6.16.49, and with static IP it works fine. However, when I try to change it from static to DHCP (using dhcpcd v2.0.8), I get the following messages at boot:
Code:

...
Bringing up the eth0 interface...
Starting dhcpcd on the eth0 interface...tg3: eth0: Link is up at 100 Mbps, full duplex.
tg3: eth0: Flow control is off for TX and off for RX.
Error, timed out waiting for a valid DHCP server response
...

After login, if I run dhcpcd -t 10 -d eth0 I get:
Code:

Info, MAC address = 00:15:60:a2:21:47
Debug, broadcasting DHCP_DISCOVER
tg3: eth0: Link is up at 100 Mbps, full duplex.
tg3: eth0: Flow control is off for TX and off for RX.
Error, timed out waiting for a valid DHCP server response

I've got another Windows-based PC with VMware Workstation on it, with same setup on a virtual machine, and on that network, it gets a DHCP address fine.

From these messages, it looks like perhaps the link is coming up AFTER it tried to send the DHCP_DISCOVER? :confused: If so, how can I fix that timing, or maybe get it to not reset the link when it starts DHCP? Or is it something else entirely?

Any info or help would be appreciated. If you need any further info, let me know.

Mara 05-19-2007 05:00 PM

From the messages it looks that you're right and it starts with DHCP_DISCOVER before the interface is up. You should change your script to either wait a while after setting up intercase or checking ifconfig status of the interface until it appears.

Cluracan 05-20-2007 07:03 AM

Well, that's what I was thinking, but I don't know how to do that. Is there a way to put a pause into a script? Or how can I tell it not to send the DHCP_DISCOVER until the interface is back up? I know where the various scripts, I'm just not too familiar (yet) with their syntax. I'm still fairly new to Linux, and more familiar with batch files and vbscripts. :-P

Mara 05-20-2007 02:43 PM

Please post your ifconfig.eth0 script (I can't find the template in LFS sources). It should be somewhere in /etc. You may simply add sleep command with time of 10 seconds or so before dhcp client command.

Quakeboy02 05-20-2007 02:51 PM

What are the contents of /etc/resolv.conf after dhcpcd fails?

Cluracan 05-20-2007 04:23 PM

Mara: "ifconfig.eth0" is a folder on my machine, not a script. Inside that folder are two files: dhcpcd and ipv4. These two files aren't scripts, they're config files. They live in /etc/sysconfig/network-devices/ifconfig.eth0/ Maybe the file you are looking for is called "ifup" on my system, so in case it helps, here it is:
Code:

#!/bin/sh
########################################################################
# Begin /etc/sysconfig/network-devices/ifup
#
# Description : Interface Up
#
# Authors    : Nathan Coulson - nathan@linuxfromscratch.org
#              Kevin P. Fleming - kpfleming@linuxfromscratch.org
#
# Version    : 00.00
#
# Notes      : the IFCONFIG variable is passed to the scripts found
#              in the services directory, to indicate what file the
#              service should source to get environmental variables.
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

# Collect a list of configuration files for our interface
if [ -n "${2}" ]; then
        for file in ${@#$1} # All parameters except $1
  do
                FILES="${FILES} ${network_devices}/ifconfig.${1}/${file}"
        done
elif [ -d "${network_devices}/ifconfig.${1}" ]; then
        FILES=`echo ${network_devices}/ifconfig.${1}/*`
else
        FILES="${network_devices}/ifconfig.${1}"
fi

boot_mesg "Bringing up the ${1} interface..."
boot_mesg_flush

# Process each configruation file
for file in ${FILES}; do
        # skip backup files
        if [ "${file}" != "${file%""~""}" ]; then
                continue
        fi

        if [ ! -f "${file}" ]; then
                boot_mesg "${file} is not a network configuration file or directory." ${WARNING}
                echo_warning
                continue
        fi

        (
                . ${file}

                # Will not process this service if started by boot, and ONBOOT
                # is not set to yes
                if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
                        continue
                fi
                # Will not process this service if started by hotplug, and
                # ONHOTPLUG is not set to yes
                if [ "${IN_HOTPLUG}" = "1" -a "${ONHOTPLUG}" != "yes" -a "${HOSTNAME}" != "(none)" ]; then
                        continue
                fi

                if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then
                        if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then
                                if ip link show ${1} > /dev/null 2>&1; then
                                        link_status=`ip link show ${1} 2> /dev/null`
                                        if [ -n "${link_status}" ]; then
                                                if ! echo "${link_status}" | grep -q UP; then
                                                        ip link set ${1} up
                                                fi
                                        fi
                                else
                                        boot_mesg "Interface ${1} doesn't exist." ${WARNING}
                                        echo_warning
                                        continue
                                fi
                        fi
                        IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} up
                else
                        boot_mesg "Unable to process ${file}.  Either" ${FAILURE}
                        boot_mesg " the SERVICE variable was not set,"
                        boot_mesg " or the specified service cannot be executed."
                        echo_failure
                        continue
                fi
        )
done

# End /etc/sysconfig/network-devices/ifup

If that doesn't help, let me know what else I can give.

Quakeboy02:
Code:

# Begin /etc/resolv.conf

domain client.org
nameserver 192.168.0.1

# End /etc/resolv.conf

This is the manual config I gave it for static IP addressing. Obviously dhcpcd hasn't overwritten it, nor has it created the ntp.conf or yp.conf files. Since it hasn't managed to get an IP address, would you expect it to write anything?


All times are GMT -5. The time now is 01:24 AM.