Problems getting DHCP address with dhcpcd using tg3 driver
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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? 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.
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.
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
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.