[SOLVED] help getting eth0 to run at startup

Issues related to configuring your network
Post Reply
pogipants
Posts: 4
Joined: 2011/07/23 17:37:41
Contact:

[SOLVED] help getting eth0 to run at startup

Post by pogipants » 2011/07/23 23:05:30

So... after a minimal install of CentOS 6, I already love it more than OpenSuse and Ubuntu (yummm).

My only problem is that when the server is turned on, it does not start its network interface card (eth0).

I have already configured the file at [b]/etc/sysconfig/networking/ifcfg-eth0[/b] to [i]ONBOOT=yes[/i] and [i]BOOTPROTO=dhcp[/i].

All I have to do to get logged in through SSH is to do [i]ifconfig eth0 up[/i] and it works instantly.

So what i did was make this script below, and added it to startup with [i]chkconfig --add eth0-init[/i]

[b]eth0-init[/b]
[code]
#!/bin/bash
#chkconfig: 345 99 10
#description: startup ethernet interface
ifconfig eth0 up
[/code]

How can I fix this? Is there another way? I'm certain it should just start automatically.

EDIT: Looks like it actually did startup but it took like forever. Can anyone let me know what the numbers after chkconfig mean? I assume 345 are run levels.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: help getting eth0 to run at startup

Post by pschaff » 2011/07/24 13:20:01

Wrong approach. You should not have to add a startup script. [url=http://wiki.centos.org/FAQ/General?highlight=%28TUV%29#head-d29a2b7e61ffc544973098f9dd49fe4663efba50]TUV[/url] has decreed that networks shall be managed by NetworkManager by default. Please see [url=http://wiki.centos.org/FAQ/CentOS6#head-b67e85d98f0e9f1b599358105c551632c6ff7c90]CentOS-6 FAQ #2. Why does my Ethernet not work unless I log in and explicitly enable it?[/url]

pogipants
Posts: 4
Joined: 2011/07/23 17:37:41
Contact:

Re: help getting eth0 to run at startup

Post by pogipants » 2011/07/27 01:40:46

So... are you saying that the only way I can fix my problem is to use a graphical program--NetworkManager?

I was under the impression that having a non-X server it was more secure. If I make the default run level 3 but have a gui installed is that still accomplishing the same thing?

Sorry, I've just been brainwashed that a GUI is a nono.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: help getting eth0 to run at startup

Post by pschaff » 2011/07/27 13:21:35

I've been brainwashed into using the GUI :-) but your opinion is widely shared. I'm certain you can manage without the GUI, but someone else could best advise you on that as I've gotten spoiled by using EL on the desktop for many years. You still should not need a startup script of your own, but just proper configuration of network and/or NetworkManager services, and setting of parameters in /etc/sysconfig/network-scripts/ifcfg-ethX.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

[SOLVED] help getting eth0 to run at startup

Post by gerald_clark » 2011/07/27 14:12:32

What's wrong with system-config-network-tui ?

pogipants
Posts: 4
Joined: 2011/07/23 17:37:41
Contact:

Re: help getting eth0 to run at startup

Post by pogipants » 2011/07/27 18:40:40

[quote]
gerald_clark wrote:
What's wrong with system-config-network-tui ?[/quote]

I actually have tried that! Maybe i'll try that again without the scripts. If not then i'll install a gui.

pogipants
Posts: 4
Joined: 2011/07/23 17:37:41
Contact:

Re: help getting eth0 to run at startup

Post by pogipants » 2011/07/28 00:01:31

thanks gerald and pschaff! after installing NetworkManager and re-running system-config-network-tui it now works! thanks for alleviating this headache!

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: [SOLVED] help getting eth0 to run at startup

Post by AlanBartlett » 2011/07/28 00:47:13

Thank you for reporting back with details of your success.

For posterity, and on your behalf, this thread is marked [SOLVED].

Post Reply

Return to “CentOS 6 - Networking Support”