VirtualBox Networking
NAT
This is easy. You don't have to do anything. Your VM will receive a NAT'ed IP address. For example if your host machine has IP address 10.0.0.100, your VM will receive an IP on a different subnet, eg 10.0.2.15.
You won't be able to access your VMs from your host machine.
Host Interface
- Set up the bridge in /etc/sysconfig/network-scripts/ifcfg-br0:
DEVICE=br0 TYPE=Bridge BOOTPROTO=static ONBOOT=yes NETMASK=255.255.255.0 IPADDR=10.0.0.14 GATEWAY=10.0.0.1
- Attach your interface to the bridge in /etc/sysconfig/network-scripts/ifcfh-eth0:
DEVICE=eth0 BOOTPROTO=none HWADDR=00:13:72:26:3D:08 ONBOOT=yes TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes BRIDGE=br0
- Create the vbox interface attached to this bridge:
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001372263d08 no eth0
pan0 8000.000000000000 no
# VBoxAddIF vbox0 david br0
VirtualBox host networking interface creation utility, version 1.6.4
(C) 2005-2007 Sun Microsystems, Inc.
All rights reserved.
Creating the permanent host networking interface "vbox0" for user david.
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001372263d08 no eth0
vbox0
pan0 8000.000000000000 no
- Assign this interface to the VM in "Host Interface Settings"
