Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I've done my share of investigating this problem...

I just recently created a CentOS 6 VM on my LinuxMint box using VirtualBox. I left all the recommended values the same upon creation (8GB HDD, 512MB RAM, blah blah blah...). But it DOESN'T connect to the internet! When I try to ping an external network (google.com) it doesn't recognize the host:

ping: unknown host google.com

and when I try to ping my internal IP of my host box it says that:

connect: Network is unreachable

(perhaps it can see my host network, just doesn't know a route to it?)

I've cleared my iptables, used every single given network adapter VirtualBox offers, and used both NAT and Bridged Adapter modes. I also reaped Google of all that I could mentally find.

When I ifconfig it only shows the lo interface (loopback), unless I manually enable the eth0 interface via the ifcfg-eth0 file (set ONBOOT="yes") and restart. But when I enable the eth0 interface, it doesn't show an IP; just the MAC and IPv6 one. I don't think its the host's internet or link to the Guest OS at all... I have a WinXP VM set up and it can access the internet.

Perhaps the answer is more obvious than I think?

share|improve this question
    
If no arguments are given, ifconfig displays the status of the currently active interfaces. -a displays the status of all interfaces, even those that are down. –  Sachin Divekar Nov 26 '11 at 6:04
    
If you provide information about how you are accessing internet from the host XP machine, then we might provide the solution easily. –  Sachin Divekar Nov 26 '11 at 6:06

1 Answer 1

up vote 5 down vote accepted

Try dhclient -v eth0 - this forces the interface to get an IP via DHCP and this may not be happening for some reason.

Once you have an IP, try ping 8.8.8.8 - if this works but ping www.google.com doesn't, you have a DNS issue (check your resolv.conf).

share|improve this answer
    
I noticed the IP is in a different format than that it would normally be in. Does this introduce any security flaws? –  snnth Nov 26 '11 at 3:30
    
@nonplus It's not clear what you mean. –  David Schwartz Nov 26 '11 at 8:37
    
Does it look like this - fe80::20f:1fff:fe15:fa73 ? That's an IP version 6 (IPv6) address. As far as security issues, you need a separate firewall setup for IPv4 (iptables) and IPv6 (ip6tables) if you need to or are interested in traffic filtering/manipulation from that system. If you have an external firewall don't worry about it. –  ultrasawblade Nov 26 '11 at 17:05
    
thanks same probably, and worked here as well. It seems after reseting the interface (ifup/down) it's not initiating a dhcp request. –  monkut Feb 9 '12 at 3:04
    
hmmm... I set /etc/sysconfig/network-scripts/ifcfg-eth0 to be dhcp, but it's not taking effect on boot. Manually running the command here works, but how can get it to be set to dhcp on boot? –  monkut Feb 10 '12 at 2:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.