Solved

I can NOT get a DHCP address in centos

Posted on 2011-09-16
5
772 Views
Last Modified: 2012-06-22
after i freshly installed a centos i was able to issue the command "dhclient eth0" and i was able to get an ip address from my dhcp server , now that i have edited the configuration of the ethernet adapter and enter in the line BOOTPROTO=dhcp and reboot i do not get an ip address ds
0
Comment
Question by:NAMEWITHELD12
  • 3
5 Comments
 
LVL 21

Accepted Solution

by:
Papertrip earned 300 total points
ID: 36553132
Probably because ONBOOT="no".  Unless you ran 'ifconfig eth0 up' after booting, then the adapter is not up.

Try that ifconfig command, if that works then DHCP is fine, then change ONBOOT to yes.
0
 
LVL 21

Assisted Solution

by:Papertrip
Papertrip earned 300 total points
ID: 36553136
Or better yet just remove ONBOOT entirely, along with NM_CONTROLLED.  Did you install from the minimal ISO by chance?

Is there a specific reason you don't want eth0 to come up at boot?
0
 
LVL 21

Assisted Solution

by:Papertrip
Papertrip earned 300 total points
ID: 36553154
Was curious about that NM_CONTROLLED, as I have never seen that used before.  Those 2 options appear to be new defaults for 6.0 from the quick research I did.

That slightly changes my answer, since I don't know what has changed in the network init script in 6.0 ... I guess now is a good time to ask, are you running 6.0?

So imo do what I said about removing ONBOOT and NM_CONTROLLED entirely.  If that does not work, then put them back in but change onboot to yes and nm to no.

Why not just leave them in there and change the values?  A good approach to take for these sorts of things is if the defaults do what you want, then no need to explicitly state them in the config.  Keep your configs nice and clean and not-confusing :)

Let me know how it works out.
0
 
LVL 2

Assisted Solution

by:ind_selva
ind_selva earned 100 total points
ID: 36555734
To configure dhcp client manually
/etc/sysconfig/network file contains this entry
NETWORKING=yes
/etc/sysconfig/network-script/ifcfgh-eth0 contains minimum this entry
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

save it and restart the network service.
0
 
LVL 19

Assisted Solution

by:jools
jools earned 100 total points
ID: 36593800
I've just done a fresh install on Centos 6 for a Desktop install with added services and for some reason the onboot no is some sort of default.

Just change it to yes and run service network restart and you should be ok.
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question