LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-27-2003, 02:36 PM   #1
raid517
Member
 
Registered: Feb 2002
Posts: 393

Rep: Reputation: 30
Seven days to install an OS!


Ok one last stab at it maybe. Everything in Gentoo linux is working properly for me now. The last remaining issue is my network connection.

When I boot the Gentoo live CD I see a message saying:

Code:
Network device eth0
eth1 detected, DHCP broadcasting for IP
The connection then completes sucessfuly.

However when I boot Gentoo properly, I do not see this message and it hangs for some 3 minutes or so trying to bring up eth0. Then it simply fails.

So from that I gathered that (perhaps mistakenly) Gentoo was really using eth1 and not eth0 as I originally thought. So I opted to try to make eth1 default:

Code:
cd /etc/init.d
cp net.eth0 net.eth1
Code:
rc-update add net.eth1 deault.
Then:

Code:
dhcp eth1
Code:
Error cant open /etc/dhcp/dhcp.conf
No such file or directory
So I looked in that directory and found the file was missing but that there was a sample file called dhcp.conf.sample. So I renamed it to dhcp.conf.

Now When I run dhcp on either of my network cards I get a message saying:

Code:
You need to add a ddns-update-style statement to dhcp.conf
However I have abolutely no idea what this means - and on the whole I'm really just guessing here without being fully clear what I'm doing.

When the system boots it gives me an error message saying

Code:
Error starting needed service. 

Netmount was not started.

Please ensure that /etc/conf.d/net has $iface_eth0 set.
However doing this and/or adding eth1 as default produces the same error exept on this instance it mentions eth1.

So I added both to the/etc/conf.d/net file at the same time.

eg

Code:
$iface_eth0 set.face
$iface_eth1 set.face
Now it just says it can''t start eth0 or eth1.

It would be trully horrible to come this far and to have spent all this time only not be able to get on the net.

I really hope someone can help me work this out and finally let me get on with enjoying this OS. If you have any views at all to share, please feel free to comment.

Regards,

Q

Ps

I should point out that my network driver 8139too is definately loaded.
 
Old 06-27-2003, 03:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you don't want to be using dhcp (the program) that will be running a dhcp SERVER, and you're only using a client, which will obtain it's address via dhcpcd, dhcpx, pump or other client commands.

please post the contents ont net.eth0 and eth1. do you have two nic's in the system? it'll always start with eth0...

gentoo rocks btw.
 
Old 06-27-2003, 04:42 PM   #3
raid517
Member
 
Registered: Feb 2002
Posts: 393

Original Poster
Rep: Reputation: 30
As requested here is the output of ifconfig.

Code:
eth0      Link encap:Ethernet  HWaddr 00:20:ED:85:4A:F6  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:10 Base address:0xb000
When I did ifconfig for eth1 though it spat out an error saying "no device found." the obvious question is, have I loaded a driver for that nic? Well maybe I would if I knew what it was. Unfortunately someone gave it to me a year or so ago, and I wasn't too clear about what it was then - as it came in a rather anaymous anti-static bag. In anycase I, not sure which is relevant here. The Gebtoo Linux live CD seems to think my my second nic is called eth 1 (the on board one and the one I always connected with in the past). While my installed Gentoo version doesn't even think I have another bic, hence it is only able so far to see eth0. To be clear (if that is possible) I have never connected to the net via my add-on pci nic, only with the onboard one built into my KT400A motherboard. So since it is a Realtek based nic and since the live CD (and the couple of other linux distros I have used) use the Realtek 8139too driver, I dont think worryng about my additional ethernet card is likely to prove very useful. If I removed my PCI nic, I would assume that eth_xyz would default to eth0 on both the live CD and in my installed gentoo version. (Sorry I'm just working that out in my own head here.) So it might only cloud the issue by concentrating on my second (largely unused) ethernet card.

As requested, below you will find the output of /init.d/eth0 and 1.

If you spot anything that might make sence, please be sure to let me know.

eth0

Code:
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.28 2003/03/16 08:03:19 azarah Exp $

#NB: Config is in /etc/conf.d/net


# For pcmcia users. note that pcmcia must be added to the same
# runlevel as the net.* script that needs it.
depend() {
	use hotplug pcmcia
}

checkconfig() {
	if [ -z "${iface_IFACE}" ]
	then
		eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set"
		return 1
	fi
}

setup_env() {
	# No reason to check these multiple times in the file
	iface_IFACE="$(eval echo \$\{iface_${IFACE}\})"
	dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${IFACE}\})"
	inet6_IFACE="$(eval echo \$\{inet6_${IFACE}\})"
	alias_IFACE="$(eval echo \$\{alias_${IFACE}\})"
	status_IFACE="$(ifconfig | gawk -v IFACE="${IFACE}" '/Link/ { if ($1 == IFACE) print "up" }')"
}

start() {
	local retval=0

	setup_env
	checkconfig || return 1
	
	ebegin "Bringing ${IFACE} up"
	if [ "${iface_IFACE}" != "dhcp" ]
	then
		/sbin/ifconfig ${IFACE} ${iface_IFACE} >/dev/null || {
			retval=$?
			eend ${retval} "Failed to bring ${IFACE} up"
			return ${retval}
		}
		# ifconfig do not always return failure ..
		/sbin/ifconfig ${IFACE} &> /dev/null || {
			retval=$?
			eend ${retval} "Failed to bring ${IFACE} up"
			return ${retval}
		}
	else
		# Check that eth0 was not brough up by the kernel ...
		if [ "${status_IFACE}" != "up" ]
		then
			/sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || {
				retval=$?
				eend ${retval} "Failed to bring ${IFACE} up"
				return ${retval}
			}
		fi
	fi
	eend 0

	if [ -n "${alias_IFACE}" ]
	then
		local x=""
		local num=0
		local aliasbcast=""
		local aliasnmask=""

		ebegin "  Adding aliases"
		for x in ${alias_IFACE}
		do
			aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"
			if [ -n "${aliasbcast}" ]
			then
				aliasbcast="broadcast ${aliasbcast}"
			fi

			aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"
			if [ -n "${aliasnmask}" ]
			then
				aliasnmask="netmask ${aliasnmask}"
			fi
		
			ebegin "    ${IFACE}:${num}"
			/sbin/ifconfig ${IFACE}:${num} ${x} \
				${aliasbcast} ${aliasnmask} >/dev/null
			num=$((num + 1))
			eend 0
		done
		save_options "alias" "${alias_IFACE}"
	fi

	if [ -n "${inet6_IFACE}" ]
	then
		local x=""
		ebegin "  Adding inet6 addresses"
		for x in ${inet6_IFACE}
		do
			ebegin "    ${IFACE} inet6 add ${x}"
			/sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null
			eend 0
		done
		save_options "inet6" "${inet6_IFACE}"
	fi
	
	if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ]
	then
		ebegin "  Setting default gateway"
		# First delete any existing routes if it was setup by kernel ..
		/sbin/route del default dev ${gateway%/*} &>/dev/null
		/sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \
			netmask 0.0.0.0 metric 1 >/dev/null || {
			
			local error=$?
			ifconfig ${IFACE} down &>/dev/null
			eend ${error} "Failed to bring ${IFACE} up"
			stop
			return ${error}
		}
		eend 0
	fi

	# Enabling rp_filter causes wacky packets to be auto-dropped by
	# the kernel
	if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ]
	then
		echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter
	fi
}

stop() {
	local myalias="$(get_options alias)"
	local myinet6="$(get_options inet6)"

	setup_env

	ebegin "Bringing ${IFACE} down"

	# Also down the inet6 interfaces
	if [ -n "${myinet6}" ]
	then
		local x=""
		for x in ${myinet6}
		do
			/sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null
		done
	fi
	
	# Do some cleanup in case the amount of aliases change
	if [ -n "${myalias}" ]
	then
		local x=""
		local num=0
		for x in ${myalias}
		do
			/sbin/ifconfig ${IFACE}:${num} down >/dev/null
			num=$((num + 1))
		done
	fi

	if [ "${iface_IFACE}" = "dhcp" ]
	then
		local count=0
		while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ]
		do
			# Give dhcpcd time to properly shutdown
			sleep 1
			count=$((count + 1))
		done
		if [ "${count}" -ge 9 ]
		then
			eerror "Timed out trying to stop dhcpcd"
		fi
	else
		/sbin/ifconfig ${IFACE} down >/dev/null
	fi
	eend 0
}


# vim:ts=4
eth1

Code:
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.28 2003/03/16 08:03:19 azarah Exp $

#NB: Config is in /etc/conf.d/net


# For pcmcia users. note that pcmcia must be added to the same
# runlevel as the net.* script that needs it.
depend() {
	use hotplug pcmcia
}

checkconfig() {
	if [ -z "${iface_IFACE}" ]
	then
		eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set"
		return 1
	fi
}

setup_env() {
	# No reason to check these multiple times in the file
	iface_IFACE="$(eval echo \$\{iface_${IFACE}\})"
	dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${IFACE}\})"
	inet6_IFACE="$(eval echo \$\{inet6_${IFACE}\})"
	alias_IFACE="$(eval echo \$\{alias_${IFACE}\})"
	status_IFACE="$(ifconfig | gawk -v IFACE="${IFACE}" '/Link/ { if ($1 == IFACE) print "up" }')"
}

start() {
	local retval=0

	setup_env
	checkconfig || return 1
	
	ebegin "Bringing ${IFACE} up"
	if [ "${iface_IFACE}" != "dhcp" ]
	then
		/sbin/ifconfig ${IFACE} ${iface_IFACE} >/dev/null || {
			retval=$?
			eend ${retval} "Failed to bring ${IFACE} up"
			return ${retval}
		}
		# ifconfig do not always return failure ..
		/sbin/ifconfig ${IFACE} &> /dev/null || {
			retval=$?
			eend ${retval} "Failed to bring ${IFACE} up"
			return ${retval}
		}
	else
		# Check that eth0 was not brough up by the kernel ...
		if [ "${status_IFACE}" != "up" ]
		then
			/sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || {
				retval=$?
				eend ${retval} "Failed to bring ${IFACE} up"
				return ${retval}
			}
		fi
	fi
	eend 0

	if [ -n "${alias_IFACE}" ]
	then
		local x=""
		local num=0
		local aliasbcast=""
		local aliasnmask=""

		ebegin "  Adding aliases"
		for x in ${alias_IFACE}
		do
			aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"
			if [ -n "${aliasbcast}" ]
			then
				aliasbcast="broadcast ${aliasbcast}"
			fi

			aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"
			if [ -n "${aliasnmask}" ]
			then
				aliasnmask="netmask ${aliasnmask}"
			fi
		
			ebegin "    ${IFACE}:${num}"
			/sbin/ifconfig ${IFACE}:${num} ${x} \
				${aliasbcast} ${aliasnmask} >/dev/null
			num=$((num + 1))
			eend 0
		done
		save_options "alias" "${alias_IFACE}"
	fi

	if [ -n "${inet6_IFACE}" ]
	then
		local x=""
		ebegin "  Adding inet6 addresses"
		for x in ${inet6_IFACE}
		do
			ebegin "    ${IFACE} inet6 add ${x}"
			/sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null
			eend 0
		done
		save_options "inet6" "${inet6_IFACE}"
	fi
	
	if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ]
	then
		ebegin "  Setting default gateway"
		# First delete any existing routes if it was setup by kernel ..
		/sbin/route del default dev ${gateway%/*} &>/dev/null
		/sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \
			netmask 0.0.0.0 metric 1 >/dev/null || {
			
			local error=$?
			ifconfig ${IFACE} down &>/dev/null
			eend ${error} "Failed to bring ${IFACE} up"
			stop
			return ${error}
		}
		eend 0
	fi

	# Enabling rp_filter causes wacky packets to be auto-dropped by
	# the kernel
	if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ]
	then
		echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter
	fi
}

stop() {
	local myalias="$(get_options alias)"
	local myinet6="$(get_options inet6)"

	setup_env

	ebegin "Bringing ${IFACE} down"

	# Also down the inet6 interfaces
	if [ -n "${myinet6}" ]
	then
		local x=""
		for x in ${myinet6}
		do
			/sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null
		done
	fi
	
	# Do some cleanup in case the amount of aliases change
	if [ -n "${myalias}" ]
	then
		local x=""
		local num=0
		for x in ${myalias}
		do
			/sbin/ifconfig ${IFACE}:${num} down >/dev/null
			num=$((num + 1))
		done
	fi

	if [ "${iface_IFACE}" = "dhcp" ]
	then
		local count=0
		while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ]
		do
			# Give dhcpcd time to properly shutdown
			sleep 1
			count=$((count + 1))
		done
		if [ "${count}" -ge 9 ]
		then
			eerror "Timed out trying to stop dhcpcd"
		fi
	else
		/sbin/ifconfig ${IFACE} down >/dev/null
	fi
	eend 0
}


# vim:ts=4
It looks to me that the eth1 is just an exact clone of the last activity on eth0 - since eth1 does not yet exist to the gentoo kernel. (Nor I suspect is it relevant).

So what do you see?

Q

Last edited by raid517; 06-27-2003 at 04:46 PM.
 
Old 06-27-2003, 11:15 PM   #4
ikw38
Member
 
Registered: Nov 2002
Location: Dallas
Distribution: RedHat 8
Posts: 270

Rep: Reputation: 30
Even though I gave up on Gentoo months ago I ran across a simular problem using SuSE - for some strange reason it kept wanting to defualt to eth1 instead of eth0 for net connection.
I had to disable the on board lan which was coming up as eth1 and delete both cards in the net config. After this I configure the eth0 as defualt with the old eth1 disabled- then I was able to get my net connection with no problem.
Later I reactivated the second card and things were cool then.

What version of Gentoo are you using?
I tried for two weeks to get going and the live install just kept failing on me. Did not like any of NIC and I even had one there gurus to help me and he was stumped....

Later,
ikw38
 
Old 06-28-2003, 07:37 AM   #5
raid517
Member
 
Registered: Feb 2002
Posts: 393

Original Poster
Rep: Reputation: 30
No eth1 isn't relevant here. Since Gentoo can only see eth0. The live CD sees both eth1 and eth0, but gentoo itself only recognises one ethernet card (the Realtek 8139xx serieswhich is covered by the 8139too driver) then in real terms only eth0 is relevant to this issue. Mmm I thought mentioning a second ethernet card could be confusing... Lets just say its safe to disregard eth1 in this matter. eth0 is the only issue at hand with my full Gentoo install.

So if you have any ideas at all, or if anyone knows how to trouble shoot networking issues in linux (i.e. do things in a precise and logical order) then I would be very keen to know.

Your advice is most welcome.

Q
 
  


Reply



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
Backing up took 3 days Diagmato Linux - Hardware 9 12-04-2005 07:21 AM
having one of THOSE DAYS ! qwijibow General 3 11-10-2004 04:13 AM
4 days and counting tomank Linux - Newbie 7 04-06-2004 10:22 AM
once in how often? twice in two days!? andzerger Linux - Security 1 02-20-2004 05:45 AM
Been trying to install Red Hat 7.0 for the past 3 days w/o success, HELP!!! jayman626 Linux - Software 6 07-16-2001 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration