Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-28-2002, 07:29 PM   #1
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

/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, 08:08 PM   #2
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


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, 11:04 PM   #3
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, 11:58 PM   #4
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, 05:28 PM   #5
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.


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

All times are GMT -5. The time now is 04:10 AM.

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