Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I can NOT get a DHCP address in centos

Posted on 2011-09-16
5
Medium Priority
?
806 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 21

Accepted Solution

by:
Papertrip earned 1200 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 1200 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 1200 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 400 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 400 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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

660 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