LinuxQuestions.org
Visit Jeremy's Blog.
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 03-28-2002, 06:29 PM   #1
papasasha
LQ Newbie
 
Registered: Mar 2002
Posts: 7

Rep: Reputation: 0
ifconfig and dhcpcd - scripted


Redhat 7.2, kernel 2.4.17, iptables compiled in. DSL service through a hub. No authentication (hostname, user, MAC address, whatever) required.

I can manually call ifconfig eth0 up and then dhcpcd to connect. No problem.

My simple script

#!/bin/sh
/sbin/ifconfig eth0 up
/sbin/dhcpcd eth0

does not connect me. Ifconfig tells me that it loaded eth0, but didn't find me an IP address. No blinkies, no nothing. The one-two combo I mentioned above gets me a connection inside 10 seconds every time. The scripted dhcpcd timed out. After I try the script, running ifconfig / dhcpcd myself from the command line does not work, either. After a reboot everything's okay again.

Any ideas?
 
Old 03-28-2002, 07:08 PM   #2
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
Have you tried manually editing the /etc/sysconfig/network-scripts/ifcfg-eth0 file to setup dhcp on boot. Here is what mine looks like

DEVICE=eth0
IPADDR=
NETMASK=
BROADCAST=
ONBOOT=yes
BOOTPROTO=dhcp
NAME=3c509

If that isn't working then what NIC card are you trying to use. I have used both PCI and ISA this way and it all seems to work fairly simply.
 
Old 03-28-2002, 10:04 PM   #3
papasasha
LQ Newbie
 
Registered: Mar 2002
Posts: 7

Original Poster
Rep: Reputation: 0
It's an integrated NIChip on a SiS 735 AMD mainboard. Like I said, the NIC itself works fine, and dhcpcd works when I call ifconfig and dhcpcd separately from the command line. I'm connected via dhcpcd right now, enjoying the wonders of X.

I've tried what you suggest. All I get is a long delay and no result. Leads me to believe that it doesn't want to run from a script, init or otherwise, so I wonder what I've got set wrong to cause this.

I don't have the NAME parameter set. But why would that make things more difficult from a script, rather than from a manual program call?
 
Old 03-28-2002, 10:58 PM   #4
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
It seems that it just wants to be lame. Just to make sure but did you check the /etc/modules.conf file to make sure that you had your alias setup correctly for the NIC. If that doesn't help then I don't have anything else to add. This is a really wierd situation.
 
Old 03-29-2002, 04:28 PM   #5
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
Try putting a "-d" option on your dhcpcd line and run it again. Then check your system log to see what happened.

Also, could it be a timing issue? Maybe put a "sleep 10" between the ifconfig and dhcpcd lines.
 
  


Reply


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
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
tying "dhcpcd" into "ifconfig" up and down Riddick Linux - Software 8 09-10-2005 07:14 PM
Scripted email doctorwebbox Linux - Software 12 05-19-2005 08:40 AM
Scripted Install donaldsolberg Mandriva 1 10-15-2004 08:50 AM
eth0 removed from ifconfig after dhcpcd eth0 johnklvr Linux - Networking 3 01-15-2004 08:21 PM

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

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