LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-17-2007, 10:19 PM   #1
Cluracan
LQ Newbie
 
Registered: May 2007
Location: Brisbane, QLD, AU
Distribution: Gentoo, LFS, Slackware, (K)ubuntu
Posts: 18

Rep: Reputation: 0
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.
 
Old 05-19-2007, 05:00 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,533

Rep: Reputation: 148Reputation: 148
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.
 
Old 05-20-2007, 07:03 AM   #3
Cluracan
LQ Newbie
 
Registered: May 2007
Location: Brisbane, QLD, AU
Distribution: Gentoo, LFS, Slackware, (K)ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
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

Last edited by Cluracan; 05-20-2007 at 07:05 AM.
 
Old 05-20-2007, 02:43 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,533

Rep: Reputation: 148Reputation: 148
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.
 
Old 05-20-2007, 02:51 PM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,238

Rep: Reputation: 121Reputation: 121
What are the contents of /etc/resolv.conf after dhcpcd fails?
 
Old 05-20-2007, 04:23 PM   #6
Cluracan
LQ Newbie
 
Registered: May 2007
Location: Brisbane, QLD, AU
Distribution: Gentoo, LFS, Slackware, (K)ubuntu
Posts: 18

Original Poster
Rep: Reputation: 0
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?
 
  


Reply

Tags
boot, dhcp, install, networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcp vs. dhcpcd merchtemeagle Slackware 5 04-20-2006 02:40 PM
tg3 module problems with broadcom 5705 LAN controller mdw10 Linux - Hardware 0 10-08-2004 04:21 AM
tg3 module problems with broadcom 5705 LAN controller mdw10 Linux - Networking 0 10-08-2004 03:47 AM
Problems receiving DHCP address WadeH Linux - Networking 8 01-20-2003 12:53 PM
DHCPCD - can we get IP address of it? lintadsl Linux - Networking 5 11-04-2002 11:54 AM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration