Solved

I can NOT get a DHCP address in centos

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
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.

773 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