Network card settings for VirtualBox on Linux

Once you have installed VirtualBox, you need to configure the Network

sudo apt-get install uml-utilities bridge-utils

Change the user (user) and the network card (physique) (ethx) used.


# Set your machine in VirtualBox to use “Host Interface”, and set
# Interface name to “tap1”. Run this script every time you require the bridge set up,
# before you start your virtual machine.


USERNAME=user # login name of HOST system
DHCP=1 # set to 1 to use dynamic ip for bridge
IP_ADDRESS= # static ip address of bridge (only used if DHCP set to 0)

tunctl -t tap1 -u $USERNAME
brctl addbr br0
ifconfig eth0 promisc
brctl addif br0 eth0

if [ DHCP = 1 ]; then
dhclient br0
ifconfig br0 $IP_ADDRESS

brctl addif br0 tap1
ifconfig tap1 up
chmod 0666 /dev/net/tun

Leave a Reply