LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-06-2003, 01:35 PM   #1
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Rep: Reputation: 15
ethernet card not being setup on startup


Hey everyone

I'm having a problem that I'm sure is quite simple. When the computer starts up it doesn't initialize the ethernet card. I have to call "dhcpcd eth0" at the shell prompt before I get a network connection. I have tried running netconfig and it seems to set everything up ok but I still get the problem.

I'm running slackware 9.0 and the network card is a RealTek 8201

Thanks
kierse
 
Old 05-06-2003, 01:59 PM   #2
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
need to add the command 'dhcpcd eth0' to one of the rc.inet scripts in /etc/rc.d. do a grep on those scripts though as there may already be an entry in one of them (commented out of course) for dhcpcd.
 
Old 05-06-2003, 03:55 PM   #3
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
I looked in the rc.inet1 file and found the line where it calls dhcpcd, here is the code:

# Edit these values to set up your first Ethernet card (eth0):
IPADDR="127.0.0.1" # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth0 using DHCP:
USE_DHCP=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
#DHCP_HOSTNAME="CCHOSTNUM-A"

# Edit the next line to point to your gateway:
GATEWAY="" # REPLACE with YOUR gateway!

# You shouldn't need to edit anything below here.

# Set up the loopback interface:
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# Set up the eth0 interface:
if [ "$USE_DHCP" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth0 by contacting a DHCP server..."
# Add the -h option to the DHCP hostname:
if [ ! "$DHCP_HOSTNAME" = "" ]; then
DHCP_HOSTNAME="-h $DHCP_HOSTNAME"
fi
/sbin/dhcpcd -t 10 ${DHCP_HOSTNAME} -d eth0
elif [ ! "$IPADDR" = "127.0.0.1" -a ! "$IPADDR" = "" ]; then # set up IP statically:
# Determine broadcast and network addresses from the IP address and netmask:
BROADCAST=`/bin/ipmask $NETMASK $IPADDR | cut -f 1 -d ' '`
NETWORK=`/bin/ipmask $NETMASK $IPADDR | cut -f 2 -d ' '`
# Set up the ethernet card:
echo "Configuring eth0:"
echo "ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}"
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
# If that didn't succeed, give the system administrator some hints:
if [ ! $? = 0 ]; then
echo "Your eth0 card was not initialized properly. Here are some reasons why this"
echo "may have happened, and the solutions:"
echo "1. Your kernel does not contain support for your card. Including all the"
echo " network drivers in a Linux kernel can make it too large to even boot, and"
echo " sometimes including extra drivers can cause system hangs. To support your"
echo " ethernet, either edit /etc/rc.d/rc.modules to load the support at boot time,"
echo " or compile and install a kernel that contains support."
echo "2. You don't have an ethernet card, in which case you should run netconfig"
echo " and configure your machine for loopback. (Unless you don't mind seeing this"
echo " error...)"
fi
fi # set up eth0

When I dmesg looking for anything with eth0 this is what I get:

eth0: Realtek RTL8201 PHY transceiver found at address 1.
eth0: Using transceiver found at address 1 as default
eth0: SiS 900 PCI Fast Ethernet at 0xd000, IRQ 10, 00:0a:e6:79:fc:fa.
eth0: Media Link On 100mbps full-duplex

As far as I can tell, no text is outputted from the rc.inet1 file, its like it isn't called

any ideas?
Kierse
 
Old 05-06-2003, 05:19 PM   #4
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
if its not being called you can check the /etc/inittab file. Look up some info online for details (or manpage it) but this is what decides what gets executed when. I'll take a look at the scripts on my laptop (my slack system) and see what I can see too. maybe inet0 calls inet1?
 
Old 05-06-2003, 07:59 PM   #5
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
ok, I was able to get rc.inet1 called by adding it rc.local which is the last thing called on startup, but I shouldn't have to do this. I am loggin in as root at the moment could that be the problem? I don't have any idea why its not calling the rc.inet1 script file.

Here is the execution trail:

on Startup /etc/inittab is called and the following line is executed:

# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M

then in rc.M, the following line is executed:

# Initialize the networking hardware:
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi

then in rc.inet1, the following is executed:

# If your provider requires a DHCP hostname, uncomment and edit below:
USE_DHCP=yes
...
..
.
# Set up the eth0 interface:
if [ "$USE_DHCP" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth0 by contacting a DHCP server..."
# Add the -h option to the DHCP hostname:
if [ ! "$DHCP_HOSTNAME" = "" ]; then
DHCP_HOSTNAME="-h $DHCP_HOSTNAME"
fi
/sbin/dhcpcd -t 10 ${DHCP_HOSTNAME} -d eth0
elif more stuff.....

What seems to be happening (if I have understood everything correctly) is that the if statement
if [ "$USE_DHCP" = "yes" ];
is failing and the script drops to the elif clause which is wrong!

Does anyone have any ideas?
Kierse
 
Old 05-06-2003, 09:00 PM   #6
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
take control... you know you want to use DHCP so take out the if statement... keep a backup copy of the script incase you break anything ... or just put the dhcpcd command into rc.local.
 
Old 05-06-2003, 10:16 PM   #7
kierse
Member
 
Registered: Apr 2003
Distribution: Slackware!
Posts: 73

Original Poster
Rep: Reputation: 15
hehe, yes masta!

thanks
kierse
 
  


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
ethernet card setup problem linetnew Linux - Networking 2 10-12-2005 07:59 PM
activating ethernet card on startup Dakkar Linux - Newbie 1 10-13-2004 10:39 AM
modules.conf tv card setup not loaded on startup jimdaworm Slackware 10 02-28-2004 10:44 AM
setup ethernet card m_rajkarnikar Linux - Hardware 3 09-20-2003 12:27 PM
isapnp ethernet card setup hank@$3800 Linux - General 15 12-24-2001 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:27 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