The opensuse wiki has a little tutorial on how to configure network bridging with virtualbox
However, the scenario used in the tutorial is based on a machine with 2 nics.
- One used for the normal network connection of the machine
- the other used for the bridging configuration
This is the best setup because your virtual machine networking does not interfere with you normal network traffic.
For people that are using only a single nic (most laptop users) this is my scenario.
before config:
eth0 with static ip 128.1.5.55/16
after config
eth0 with static ip 0.0.0.0 (to enable bridging)
br0 with static ip 128.1.5.55/16 (the bridge is used for normal traffic also)
vbox0 for vbox bridging
this is my eth0 config
cat /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IFPLUGD_PRIORITY='20'
#IPADDR='128.1.5.55/16'
IPADDR='0.0.0.0'
MTU=''
NAME='NetXtreme BCM5755M Gigabit Ethernet PCI Express'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='ifplugd'
USERCONTROL='no'
PREFIXLEN=''
So you can see i commented out the normal ip and changed it to 0.0.0.0
The I created the br0 interface and gave it my fixed IP
#ifcfg-br0
STARTMODE='auto'
BOOTPROTO='static'
IPADDR='128.1.5.55/16'
USERCONTROL='no'
BRIDGE='yes'
BRIDGE_PORTS='eth0'
BRIDGE_AGEINGTIME='20'
BRIDGE_FORWARDDELAY='0'
BRIDGE_HELLOTIME='2'
BRIDGE_MAXAGE='20'
BRIDGE_PATHCOSTS='3'
BRIDGE_PORTPRIORITIES=
BRIDGE_PRIORITY=
BRIDGE_STP='on'
Then you must restart your network stack
/etc/rc.d/network restart
if you run ifconfig you will see the new br0 interface with the static ip.
br0 Link encap:Ethernet HWaddr 00:1C:23:1B:15:91
inet addr:128.1.5.55 Bcast:128.1.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63031 errors:0 dropped:0 overruns:0 frame:0
TX packets:5755 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24480648 (23.3 Mb) TX bytes:730056 (712.9 Kb)
eth0 Link encap:Ethernet HWaddr 00:1C:23:1B:15:91
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:225996 errors:0 dropped:0 overruns:0 frame:0
TX packets:5763 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:122868191 (117.1 Mb) TX bytes:759601 (741.7 Kb)
Interrupt:17
And finally you have to create the vbox-interface
VBoxAddIF vbox0 localuser br0
That’s It.