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*.)

Install

First, install the apps:

sudo apt-get install uml-utilities bridge-utils

Edit Configurations

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.)

Loopback

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

auto iface lo inet loopback

Bridge

# 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 ip link set dev 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 ip link set dev tap0 up   ('''Bring tap0 up''')

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

post-down ip link set dev eth0 down   ('''Brings down eth0''' )

post-down ip link set dev tap0 dpwn   ('''Brings down tap0''')

post-down ip link set dev 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''')

Restart Networking

That's it. The device is brought up and down with the system or just restart the networking service

sudo etc/init.d/networking restart

External Links

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


CategoryNetworking

Network Bridge with a Tap! (last edited 2011-05-10 21:07:43 by vpn-3206)