Solved

I can NOT get a DHCP address in centos

Posted on 2011-09-16
5
781 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux redhat 7.2 10 113
how to include conditional log rotate in liunx. 17 106
Time Sync Best Practice 13 74
VMware machine is not booting 6 129
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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

752 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