DevOps Monkey Goodness

How To Enable Internet Access On Centos 6.4 Virtual Box

This one took me a little while to work out being a Linux noob so hopefully this will help someone else out if not at least me again when I forget!

Configure VirtualBox Internet Connection (Static IP) On Centos 6

  1. In VirtualBox make sure you have configured the adapter in “bridged” mode:
     
  2. Make sure you select the correct network card in the dropdown – for me I had to change it from “hamanchi” 
  3. In a Centos terminal run:
     nano /etc/sysconfig/network-scripts/ifcfg-eth0 
  4. Ensure the following settings are set (change IP values from your Windows host  using ipconfig /all):
    DEVICE=eth0
    IPADDR=10.55.25.123
    NETMASK=255.255.252.9
    GATEWAY=10.55.27.123
    ONBOOT=yes
    BOOTPROTO=static
    DNS1=10.55.1.1
    DNS2=10.55.1.2
    USERCTL=no
    NM_CONTROLLED=yes
    NOZEROCONF=yes
     
  5. You can also change the network settings using system-config-network
  6. Restart the network
    service network restart (/etc/init.d/network restart)
  7. Ensure you can ping a site and if required browse the internet using Firefox, on my setup I found that I could ping sites but not browse.  In this case ensure that the network is connected:

     
  8. I’m not sure if there’s a better way but this worked for me:
    – right click on the network icon -> “Edit Connections” and configure the network as required:
    – Edit
    – Rename “auto eth0” to “System eth0”
    – Configure your IP settings
     
  9. Restart the network (as root)
    # service network restart

No Comments Yet

Leave a Reply