Click to See Complete Forum and Search --> : DHCP setup on Boot, instead of manual config...HOWTO???


LittleGreenGecko
05-05-2002, 03:57 AM
Can anyone point me in the right direction, or tell me how to setup a dhcp setting so that when my computer boots, every time, it sets up eth0 with dhcpcd??

DMR
05-05-2002, 06:45 AM
First, you need to have a DHCP client daemon installed; dhcpcd and pump are the two most common. You then need to tell your system that eth0 should use DHCP- this can be done via a GUI utility (exactly which utility depends on your distro), or by hand-hacking a couple of network config files. In Redhat and Mandrake, the files, and what they should contain, are as follows:

/etc/sysconfig/network should have the entries:
NETWORKING=yes
GATEWAYDEV=eth0

/etc/sysconfig/network-scripts/ifcfg-eth0 should have:

DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"

LittleGreenGecko
05-05-2002, 04:42 PM
I understand what you said, and I did that exactly. I made sure that it was uncommented. I also saw a line in that file which stated what the gateway was, and I left that line uncommented as well, as it was correct. On the DHCP thing, it would establish eth0 with the right stats, but it never said it was "UP" when I ran "ifconfig eth0"..... and the emerge commands would error out, cuz they cant get outa my network.

I decided that, since I have the option.... I would kinda like to add my computer as a static route. Now, I notice upon bootup that it states that it is "Bringing Lo UP", which as we all know is local loopback, or 127.1.1.1... I think.... Anyway, how can I make it so that right after it brings Lo up, it brings eth0 up with the following information?

myIP=192.168.0.2
Gateway IP=192.168.0.1

If anyone has a spare "net" file which defines eth0 interface in this mannor, it would be greatly appreciated if you would post it here so that I know what exactly it should look like.

LittleGreenGecko
05-05-2002, 04:44 PM
I wish that there was a standard way of doing this.... I am running gentoo, and it seems different that your suggestion in the fact that it has

/etc/conf.d/net

script which sets up the interfaces.

I made sure that what you said was in there, but it didn't work.

mdwatts
05-05-2002, 05:46 PM
It does help if you mention what distro you are using whenever you post a question.

The setup/config files for Gentoo are quite different from other distros and much of what others suggest here will not work with Gentoo.

Have you read through their installation docs or faq's?

They do have a usergroup that could possibly have the question already asked and answered. I would suggest you give that a try.

Sorry as I don't have the url for their usergroup list available right now as I only have it bookmarked at work. The Gentoo homepage has it listed.

LittleGreenGecko
05-05-2002, 05:49 PM
I did already post a question in their forum, but I thought that it was best to post it twice, as the answers here are usually not as biased, as the ones you will see in a particular distro's help forum.

LittleGreenGecko
05-05-2002, 07:53 PM
thats ok, I found it in the docs at gentoo, the thing is is that I need to add the interface script to the START and STOP lists, and I didn't do that.

Thanks
Sean