... à partir de la doc de VirtualBox et brut de décoffrage !!!
NOTE :
(fonctionne ... mais warning à corriger)
à tester
- Code:
#! /bin/sh
#virtualbox/2.0.2/UserManual
#http://www.virtualbox.org/wiki/Downloads
### Param locaux
MASQ="255.255.255.0"
ETH0="172.16.0.140"
GW="172.16.0.4"
USERVB="root"
###################
modprobe bridge
modprobe tun
#Create a new bridge with this command:
brctl addbr br0
#Remove the IP address configuration from the existing network device (e.g.
#eth0) with:
ifconfig eth0 0.0.0.0
#Add your network adapter to the bridge:
brctl addif br0 eth0
#run ifconfig br0 x.x.x.x netmask x.x.x.x and use the
#values that you noted down previously.
ifconfig br0 $ETH0 netmask $MASQ
route add default gw $GW
#To create a permanent host interface called vbox0 (all host interfaces created in
#this way must be called vbox followed by a number) and add it to the network
#bridge created above, use the following command (see chapter 6.8.1.5, Host
#Interface Networking utilities for Linux, page 85 for more details):
#VBoxAddIF vbox0 <user> br0
#Replace <user> with the name of the user who is supposed to be able to use the
#new interface.
VBoxAddIF vbox0 $USERVB br0
#To create a temporary TAP interface which will disappear when the host system is
#restarted, use the VBoxTunctl command. The following example creates the interface
#vbox0 for the user <user>:
#VBoxTunctl -t vbox0 -u <user>
##VBoxTunctl -t vbox0 -u $USERVB
#If you have installed the bridge utilities (see the preceding sections), you can add
#this temporary interface to an Ethernet bridge using the command
##brctl addif br0 vbox0
#ifconfig
NOTE :
(fonctionne ... mais warning à corriger)
à tester
- Code:
root@inspiron:~# mc
root@inspiron:~/WORK.CRS# ./bridge
VirtualBox host networking interface creation utility, version 2.0.2
(C) 2005-2007 Sun Microsystems, Inc.
All rights reserved.
Creating the permanent host networking interface "vbox0" for user vénérable grand maitre.
root@inspiron:~/WORK.CRS#