After much trial and error, I have been able to identify a reasonably
straightforward way to get bridged (Host Interface) networking for my Fedora 9
VirtualBox host. Perhaps these steps are applicable to other distributions.
Note: this setup is for a host using a static IP address,
192.168.1.100 in this case. Adjust the IP address
to conform to your environment (it should be the same
as your eth0 IP address before attempting to install
VirtualBox). If you are using DHCP, then set the
bootproto line below to "BOOTPROTO=dhcp" and omit the
IPADDR, NETMASK, GATEWAY & BROADCAST lines.
prereqs:
# yum install bridge-utils dkms
install:
# rpm -Uvh VirtualBox-1.6.2_31466_fedora9-1.x86_64.rpm
# usermod -aG vboxusers joeuser
configure bridged networking:
# echo \
"DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.100 # same IP as host machine
NETMASK=255.255.255.0 # subnet mask for LAN
GATEWAY=192.168.1.1 # default gateway for LAN
BROADCAST=192.168.1.255
DELAY=0
STP=off" > /etc/sysconfig/network-scripts/ifcfg-br0
# chmod 755 /etc/sysconfig/network-scripts/ifcfg-br0
# echo "BRIDGE=br0" >> /etc/sysconfig/network-scripts/ifcfg-eth0
# service network restart
# system-config-firewall
- go to "Trusted Interfaces" and select 'br0'
- apply (firewall should restart)
# iptables -S | grep br0
- you should see this output:
-A INPUT -i br0 -j ACCEPT
-A FORWARD -i br0 -j ACCEPT
# VBoxAddIF vbox0 joeuser br0
# service vboxnet restart
- this step may not be necessary
check network configuration:
# ifconfig
br0 Link encap:Ethernet HWaddr 00:12:34:AA:78:9D
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1062535 errors:0 dropped:0 overruns:0 frame:0
TX packets:926744 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:456746305 (435.5 MiB) TX bytes:318274360 (303.5 MiB)
eth0 Link encap:Ethernet HWaddr 00:BB:CC:22:93:3D
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:2526558 errors:0 dropped:27333247610996 overruns:0 frame:0
TX packets:2137215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1154838062 (1.0 GiB) TX bytes:584888820 (557.7 MiB)
Interrupt:17 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9097848 errors:0 dropped:0 overruns:0 frame:0
TX packets:9097848 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1193563138 (1.1 GiB) TX bytes:1193563138 (1.1 GiB)
vbox0 Link encap:Ethernet HWaddr 00:FF:29:D8:37:BD
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:399 errors:0 dropped:0 overruns:0 frame:0
TX packets:6030 errors:0 dropped:213 overruns:472 carrier:0
collisions:0 txqueuelen:500
RX bytes:73037 (71.3 KiB) TX bytes:551265 (538.3 KiB)
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 br0
link-local * 255.255.0.0 U 0 0 0 br0
default 192.168.1.1 0.0.0.0 UG 0 0 0 br0
to add a 2nd virtual adapter for a 2nd bridged VM:
# VBoxAddIF vbox1 joeuser br0
# service vboxnet restart
- this step may not be necessary
_______________________________________________
vbox-users mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-users