Revision 2 as of 2010-10-30 14:24:13

Clear message

Network Bridge with a Tap!

Introduction

I was trying to get my Qemu XP VPC to have assigned IP from router to allow my Verizon Media Manger app to gain access to the network as it does not support forwarding. I created a set-up with the help of several posts in several locations (*to be noted later*.)

First Section

First, install the apps:

sudo apt-get install uml-utilities bridge-utils

Second Section

Second, Edit the /etc/network/interfaces file to match what you require, but my example shows my set-up for 1 ethernet (eth0,) 1 bridge (br0,) and one tap (tap0.)

Subsection

Your device names may be different, but the principle remains the same:

auto lo iface lo inet loopback

# Bridge between eth0 and tap0

auto br0

iface br0 inet dhcp

pre-up tunctl -t (tap device ""ex:tap0"") -u (tap owner) -g (owner group name)

pre-up ifconfig eth0 down (Brings down ethernet)

pre-up brctl addbr br0 (Adds bridge)

pre-up brctl addif br0 eth0 (Adds eth0 to bridge)

pre-up brctl addif br0 tap0 (Adds tap0 to bridge)

pre-up ifconfig tap0 up (Bring tap0 up)

pre-up ifconfig eth0 0.0.0.0 (Puts eth0 in promiscuous mode)

up chmod 0666 /dev/net/tun (Changes permissions on tap device to user/ owner)

post-down ifconfig eth0 down (Brings down eth0 )

post-down ifconfig tap0 down (Brings down tap0)

post-down ifconfig br0 down (Brings down br0)

post-down brctl delif br0 eth0 (Removes bridge between br0 & eth0)

post-down brctl delif br0 tap0 (Removes bridge between br0 & tap0)

post-down brctl delbr br0 (Removes bridge)

Subsection

That's it. The device is brought up and down with the system.

External Links

The links that follow are where I got all opf the info used to make this to do:


CategoryNetworking