Solved

I can NOT get a DHCP address in centos

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now