Why the default eth0 interface is down by default on CentOS?

I am already a little bit familiar with Linux distros like Debian or Ubuntu (yeah, very similar) but I wanted to try Red Hat based - CentOS 6.2 . I have installed it on my Windows 7 host in virtualBox and tried to play with it a little.

I have same across a small problem, namely : the default eth0 interface is down by default. I use the option with NAT ( the virtual machine is 'behind' the host ). Even if I bring the interface up with

ifconfig eth0 up it does not work right away. I get this after bringing the interface up:

What should be done more to configure the network on CentOS machine?enter image description here

P.S. Sorry for screenshot but I do not know how to get the text out of the VirtualBox.

shareimprove this question

1
There is no eth1 on your screenshot... Btw, try to run DHCP on your interface: dhclient eth0. – pbm Apr 17 '12 at 18:58

@pbm 1) I changed eth1 to eth0 in the description. 2) dhclient eth0 worked :) thanks. How can I make it default - run like this after reboot ? – Patryk Apr 17 '12 at 19:18

I'm not sure, but check out this blog post: blog.malaya-digital.org/… – pbm Apr 17 '12 at 19:49
1
If you find exact solution post it as answer... – pbm Apr 17 '12 at 19:50

2 Answers

up vote 8 down vote accepted

Edit /etc/sysconfig/network-scripts/ifcfg-eth0. Change the ONBOOT line's value to yes.

In your future installs, pay more attention. You blew past an option in the network configuration section that let you tell it to bring the interface up on boot. This on-boot option is off by default in EL6 now, whereas in previous versions, it was on by default.

As to why this is, I'd guess security reasons. It gives you a chance to tighten things down a bit from the default setup before bringing up the network interface for the first time.

shareimprove this answer


You didn't mention what version of CentOS you are using. If I'm not mistaken, 6.x uses NetworkManager by default.

I rarely install X windows on my servers, so NetworkManager is just a pain for me. I disable it and enable the standard 'network' service.

chkconfig NetworkManager off
chkconfig network on

service NetworkManager stop
service network start

To enable DHCP on the interface, run system-config-network, edit the appropriate device, save, and restart the network service. Alternately, you can edit /etc/sysconfig/network-scripts/ifcfg-eth0 and add

ONBOOT=yes
BOOTPROTO=dhcp

Save changes and restart the network service.



From:http://unix.stackexchange.com/questions/36705/why-the-default-eth0-interface-is-down-by-default-on-centos



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值