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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
05-06-2003, 02:35 PM
|
#1
|
Member
Registered: Apr 2003
Distribution: Slackware!
Posts: 73
Rep:
|
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
|
|
|
05-06-2003, 02:59 PM
|
#2
|
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251
Rep:
|
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.
|
|
|
05-06-2003, 04:55 PM
|
#3
|
Member
Registered: Apr 2003
Distribution: Slackware!
Posts: 73
Original Poster
Rep:
|
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
|
|
|
05-06-2003, 06:19 PM
|
#4
|
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251
Rep:
|
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?
|
|
|
05-06-2003, 08:59 PM
|
#5
|
Member
Registered: Apr 2003
Distribution: Slackware!
Posts: 73
Original Poster
Rep:
|
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
|
|
|
05-06-2003, 10:00 PM
|
#6
|
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251
Rep:
|
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.
|
|
|
05-06-2003, 11:16 PM
|
#7
|
Member
Registered: Apr 2003
Distribution: Slackware!
Posts: 73
Original Poster
Rep:
|
hehe, yes masta!
thanks
kierse
|
|
|
All times are GMT -5. The time now is 08:12 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|