LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2011, 11:52 AM   #1
nuancechuck
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Rep: Reputation: 0
Cent 6.0 Losing IP assigned by dhcp everytime I reboot


Hi,
I just built a Cent 6.0 box, it is set for DHCP. Everytime I reboot It doesn't receive an address. To fix I just have to go into network settings and hit apply. I have worked with Windows OS for years but am new to Linux. Does anyone know why this would happen and the solution to this?
Thanks!
Chuck
 
Old 08-22-2011, 02:12 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

Welcome to LQ!!!

We need to check whether NIC is configured to get IP at the time of Boot. Please paste the output of the following command:

Code:
cat /etc/sysconfig/network-scripts/ifcfg-eth0

Last edited by T3RM1NVT0R; 08-22-2011 at 02:23 PM.
 
Old 08-23-2011, 09:05 AM   #3
nuancechuck
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Output from cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0

Hi and thanks,
Thare was no file called ifcfg-eth0 but there was one called ifcfg-Auto_eth0. Here is the output from that file:
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=yes
NAME="Auto eth0"
UUID=3de80abd-c464-49ad-94d6-68344619dd33
ONBOOT=yes
DEVICE=Auto_eth0
USERCTL=no
HWADDR=00:1A:A0:BE:66:9B
PEERDNS=yes
PEERROUTES=yes
 
Old 08-23-2011, 03:16 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Alright, from the output you pasted it is configured to start at boot as it says ONBOOT=yes. However, I am not quite convinced that there is no file with the name ifcfg-eth0. If this file is not there then there should be a file eth1 or something similar. What is the output if you type:

Code:
ifconfig
If the output of the above command shows Auto_eth0 then we will look forward for editing the file.

We also have to make sure that the NetworkManager service is configured to start at boot. This service is responsible for loading dhclient which in turn gets you an IP address from dhcp service.

You can check this service status using:

Code:
chkconfig NetworkManager status
If it shows that the service is configured to start on all run levels (i.e. 2,3,4,5) then it is ok else you can enable it by running the following command:

Code:
chkconfig NetworkManager on
 
Old 08-23-2011, 10:23 PM   #5
jraz
Member
 
Registered: Feb 2011
Location: TEMPE, AZ
Distribution: Linux Mint LMDE
Posts: 52

Rep: Reputation: 5
Does it have to be DHCP? Can it have a static address? If no static is available, can you set a reservation on the MAC address in the DHCP server? Also there is a check box in the lower left making the config available to all users. Just a shot in the dark on the last bit.

I set reservations in my router at home. Nothing gets connected for my network without one. Of course it is small and easy to manage. At work I use reservations for printers and other devices. I could use static IP's but often they get moved or replaced. Re-entering a MAC is much easier to set and manage.
 
Old 08-24-2011, 04:18 PM   #6
nuancechuck
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
strange

Hi, Sorry to be a pain.
I am able to run chkconfig NetworkManager on and chkconfig NetworkManager off but when I try chkconfig NetworkManager status it justy gives me:

[Usage: chkconfig [--list] [--type <typy>] [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig --override <name>
chkconfig [--level] <levels> [--type <type>] <on|off|reset|reset priorities>


Also Here is a ls of the /etc/sysconfig/network-scripts directory:
-rw-r--r--. 1 root root 221 Aug 24 03:52 ifcfg-Auto_eth0
-rw-r--r--. 1 root root 254 Sep 1 2010 ifcfg-lo
lrwxrwxrwx. 1 root root 20 Jul 14 05:13 ifdown -> ../../../sbin/ifdown
-rwxr-xr-x. 1 root root 627 Sep 1 2010 ifdown-bnep
-rwxr-xr-x. 1 root root 5059 Sep 1 2010 ifdown-eth
-rwxr-xr-x. 1 root root 781 Sep 1 2010 ifdown-ippp
-rwxr-xr-x. 1 root root 4246 Sep 1 2010 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 Jul 14 05:13 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 1481 Sep 1 2010 ifdown-post
-rwxr-xr-x. 1 root root 1064 Sep 1 2010 ifdown-ppp
-rwxr-xr-x. 1 root root 651 Sep 1 2010 ifdown-routes
-rwxr-xr-x. 1 root root 1367 Sep 1 2010 ifdown-sit
-rwxr-xr-x. 1 root root 1431 Sep 1 2010 ifdown-tunnel
lrwxrwxrwx. 1 root root 18 Jul 14 05:13 ifup -> ../../../sbin/ifup
-rwxr-xr-x. 1 root root 13454 Sep 1 2010 ifup-aliases
-rwxr-xr-x. 1 root root 859 Sep 1 2010 ifup-bnep
-rwxr-xr-x. 1 root root 9944 Sep 1 2010 ifup-eth
-rwxr-xr-x. 1 root root 11971 Sep 1 2010 ifup-ippp
-rwxr-xr-x. 1 root root 10679 Sep 1 2010 ifup-ipv6
lrwxrwxrwx. 1 root root 9 Jul 14 05:13 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 727 Sep 1 2010 ifup-plip
-rwxr-xr-x. 1 root root 954 Sep 1 2010 ifup-plusb
-rwxr-xr-x. 1 root root 2364 Sep 1 2010 ifup-post
-rwxr-xr-x. 1 root root 4154 Sep 1 2010 ifup-ppp
-rwxr-xr-x. 1 root root 1712 Sep 1 2010 ifup-routes
-rwxr-xr-x. 1 root root 3490 Sep 1 2010 ifup-sit
-rwxr-xr-x. 1 root root 2482 Sep 1 2010 ifup-tunnel
-rwxr-xr-x. 1 root root 3770 Sep 1 2010 ifup-wireless
-rwxr-xr-x. 1 root root 4508 Sep 1 2010 init.ipv6-global
-rwxr-xr-x. 1 root root 1125 Sep 1 2010 net.hotplug
-rw-r--r--. 1 root root 9966 Sep 1 2010 network-functions
-rw-r--r--. 1 root root 29835 Sep 1 2010 network-functions-ipv6

I'm liking linux stuff though far more interesting than windows.

I do not have the option of a static as another group here gives them out and I'm just trying to learn this so thats not good enough to get one.

Thanks!
Chuck
 
Old 08-25-2011, 02:10 AM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

Sorry it was my mistake it is not chkconfig NetworkManager status. It should be chkconfig --list NetworkManager.

If your NetworkManager is showing as on on all the run levels then take a backup of: /etc/sysconfig/network-scripts/ifcfg-Auto_eth0. When I say backup just copy it somewhere and then make the following changes:

TYPE=Ethernet
HWADDR=00:1A:A0:BE:66:9B
BOOTPROTO=dhcp
ONBOOT=yes
DEVICE=Auto_eth0
USERCTL=no

Save the file and exit. Reboot the system and check if you get IP from DHCP or not.

If NetworkManager is showing as off then do chkconfig NetworkManager on

Last edited by T3RM1NVT0R; 08-25-2011 at 02:12 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. kublador Linux - Networking 14 05-16-2006 06:33 AM
Nvidia Drivers lost everytime I reboot? vidski Debian 2 01-17-2005 12:38 AM
What's my DHCP assigned IP and where is it? Buckyjunior Linux - Networking 7 02-27-2004 01:29 PM
ut2003 requires hard reboot. .everytime. Seraph Linux - Software 0 02-10-2004 12:34 PM
losing connections always when reboot in DHCP helsinkiboy Linux - Networking 1 06-13-2003 07:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration