LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-10-2012, 07:58 AM   #1
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Rep: Reputation: Disabled
Virtual Box Centos 6.2 x86 Internet Access Issue.


Dear All.

This is my very first post, so thank you to anyone that may be able to help.

I am running a new install of Centos 6.2 x86 on Oracle Virtual Box on Windows 7 host. I have other VM installs namely, Linux server 6.0 and Fedora - these work fine.

Problem:
When server boots up I have no internet access unless I do the following:

# dhclient -v eth0

I also note that /etc resolv.conf is <empty>

Q1. What is the problem here?
Q2. What does the command 'dhclient -v eth0' do? I just found it on the web.
Q3. What can I do to resolve this when the server boots?

Any help or further explanation would be highly appreciated as I am about 3 months into learning Linux.

Best regards - Daily Oliver..
 
Old 02-10-2012, 11:29 AM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 561

Rep: Reputation: 42
Do you have a dhcp server on your network?
 
Old 02-10-2012, 11:36 AM   #3
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
Hi edit
vi /etc/sysconfig/network-script/ifcfg-eth0
ONBOOT=yes
BOOTPROTO=dhcp



and that is should bring the network up when ever you reboot the system, and make sure you not running network manager
to be sure run
chkconfig NetworkManager off
chkconfig network on
 
Old 02-10-2012, 12:00 PM   #4
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks to you both, for such quick replies..

Do you have a dhcp server on your network?

This is an Oracle Virtual Box (virtual machine) install of Centos 6.2 x86 server running on windows 7 host (PC) - I use a bridged adapter to access the wifi card on my pc. All other Linux VM's can access web in this way - the bridged adapter allows my home router to assign the Virtual Machine (Centos Server) with an ip within the numeric range of my router for example 192.168.51.2

Does this help?

Thanks again
 
Old 02-11-2012, 12:15 PM   #5
cbtshare
Member
 
Registered: Jul 2009
Posts: 561

Rep: Reputation: 42
That was what I was wondering if the adapter is bridged.Since youve used vm for other linux VM's already I would assume you tried the following commands:

Quote:
ifdown eth0
(or whatever device your using)
Quote:
ifup eth0
(if you dont get an ipaddress, is there any entry in
Quote:
tail /var/log/message
Quote:
ifconfig
(to see if your getting an ip address)
 
Old 02-13-2012, 06:04 AM   #6
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi and thanks to you all for your replies.

I have opened

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="YES"
ONBOOT="no"

S0....?

I am a bridged adapter on PC/wifi card if you could please advise what to write it would be very helpful as I do not understand what the entries stand for?? Should I add the following -??

DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=dhcp
 
Old 02-13-2012, 11:23 AM   #7
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
Hi,
if you doing Bridge on the etho then you need to create bridge config file
cp ifcfg-eth0 ifcfg-br0
vi ifcfg-eth0
DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=none
BRIDGE=br0

vi ifcfg-br0

DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=
NETMASK=
GATEWAY=

and give it the ip address you want assign


service network restart

Last edited by saifelyzal; 02-13-2012 at 11:29 AM.
 
Old 02-14-2012, 05:37 AM   #8
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi - thanks for all your replies


1- tried adding this to ifcfg-eth0 = not worked

DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=dhcp

2- tried <below> = not worked

cp ifcfg-eth0 ifcfg-br0
vi ifcfg-eth0
DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=none
BRIDGE=br0

vi ifcfg-br0

DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.2.73
NETMASK=
GATEWAY=

service network restart

could this be due to syntax for example
ifcfg-eth0 = ONBOOT="YES"
ifcfg-br0 = ONBOOT=yes

and so on?

thanks to all - I have had to revert to orig settings

DEVICE="eth0"
HWADDR="08:00:27:63:B03"
NM_CONTROLLED="YES"
ONBOOT="no"

and continued to use # dhclient -v eth0 on the command line - full circle

any others ideas or suggestions would be very much appreciated, unless I am missing something??

thanks again - daily oliver..

Last edited by dailyoliver; 02-14-2012 at 05:38 AM. Reason: edit
 
Old 02-14-2012, 06:52 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
check the virtual box setting whether your network card is connected after getting powered on.

and make sure the network adapter is made to bridge networking with replicate environment
 
Old 02-16-2012, 05:52 AM   #10
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for all the help...

I don't know what the problem is - the only thing that works is if I run:

# dhclient -v eth0

on the command line on boot

Could I add this somewhere else to start automatically?

Thanks in advance for any suggestions - DO
 
Old 02-16-2012, 06:12 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
In CentOS I don't think you need to use " "



Code:
ifcfg-eth0 (for dhcp)
DEVICE=eth0
BOOTPROTO=dhcp
TYPE=Ethernet
HWADDR=08:00:27:63:B03
ONBOOT=yes
or even better use GUI
Code:
#system-config-network
and follow the instructions to activate eth0 for dhcp also make sure your resolv.conf is properly configured in case it does not gets nameserver from DHCP

Code:
#service network restart

Last edited by deep27ak; 02-16-2012 at 06:13 AM.
 
1 members found this post helpful.
Old 02-16-2012, 06:34 AM   #12
dailyoliver
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi deep27ak

Thank you very much!

I added <below> to the file ---> /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=dhcp
TYPE=Ethernet
HWADDR=08:00:27:63:B03
ONBOOT=yes

any it works, thank you very much, well appreciated...

Daily Oliver!
 
Old 02-16-2012, 06:36 AM   #13
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
Glad to Help
 
Old 08-16-2012, 07:55 AM   #14
Ankou
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
Thanks, Just wanted to say I found this post helpful. I had the same problem and after editing ifcfg-eth0 it all worked.
 
Old 09-21-2012, 03:46 AM   #15
pouya7525
LQ Newbie
 
Registered: Sep 2012
Posts: 6

Rep: Reputation: Disabled
something ridiculous I noticed is you should enable NIC when you are installing centos. so when people miss that part the NIC is disabled on boot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Centos 6 vlc and Virtual Box installation issues aliabbass Linux - Server 1 09-28-2011 12:28 PM
Centos version to work on Virtual Box? paulfoel Linux - Newbie 5 03-11-2011 01:26 PM
problem while installing virtual box in centos 5.4 rajanmaharjan Linux - Newbie 6 06-28-2010 01:09 PM
Virtual Box and loading CentOS 5.3 enzymezero Linux - Newbie 3 08-25-2009 08:58 AM
An Virtual Box issue Agloval Linux - Software 4 07-17-2009 02:46 AM


All times are GMT -5. The time now is 08:04 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration