I am using VirtualBox 4.3, I have installed centos 6.3. I have two adpaters attached.

1) NAT

2) Host-Only

I want to be able to setup a cluster of 3 machines which can talk to each other and also be able to connect to the internet. However, When I just used NAT with dhcp on to test connectivity to internet, It was working fine. But when i have added Host-only adapter and set up static IP on it, The internet connection got messed up. Please, help me if i am doing anything wrong.

config files that i have changed

NAT Adapter

/etc/sysconfig/network-scripts/ifcfg-eth0 enter image description here

Host-Only Adapter


enter image description here

When I have turned off IPtables and disabled selinux. When i try to ping www.google.com I am getting unknown host

I have tried adding nameserver to resolv.conf and also DNS to eth0 (as "DNS", "DNS0").

Thanks in advance

1 Answer 1


You don't have a GATEWAY line for the NAT adapter.

I'd also recommend that you use Bridged for the Internet adapter. It creates a lot fewer problems. I would only use NAT for a guest OS that didn't have effective inbound security, so I wanted to rely on the host OS's firewall and such.

Once you do that, you won't need the host-only adapter. The bridged guest OSes will be able to see each other then, for the same reason normal hosts on your LAN can see each other. In general, you only want to use host-only networking when creating a VM that will only talk to the host OS, or to other VMs. (e.g. A test VM that gets set up once and then never updated.) Once you decide to let the VMs see out to the wider network, it really isn't doing anything useful for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .