Size: 2497
Comment:
|
← Revision 9 as of 2011-05-10 21:07:43 ⇥
Size: 2481
Comment: iproute2
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
{{{ | |
Line 15: | Line 15: |
}}} | |
Line 18: | Line 19: |
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.) | 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.) |
Line 22: | Line 23: |
{{{ auto iface lo inet loopback }}} |
|
Line 23: | Line 27: |
auto iface lo inet loopback |
== Bridge == |
Line 27: | Line 29: |
== Bridge == |
{{{ |
Line 35: | Line 36: |
pre-up ifconfig eth0 down ('''Brings down ethernet''') | pre-up ip link set dev eth0 down ('''Brings down ethernet''') |
Line 43: | Line 44: |
pre-up ifconfig tap0 up ('''Bring tap0 up''') pre-up ifconfig eth0 0.0.0.0 ('''Puts eth0 in promiscuous mode''') |
pre-up ip link set dev tap0 up ('''Bring tap0 up''') |
Line 49: | Line 48: |
post-down ifconfig eth0 down ('''Brings down eth0''' ) | post-down ip link set dev eth0 down ('''Brings down eth0''' ) |
Line 51: | Line 50: |
post-down ifconfig tap0 down ('''Brings down tap0''') | post-down ip link set dev tap0 dpwn ('''Brings down tap0''') |
Line 53: | Line 52: |
post-down ifconfig br0 down ('''Brings down br0''') | post-down ip link set dev br0 down ('''Brings down br0''') |
Line 60: | Line 59: |
}}} | |
Line 69: | Line 69: |
The links that follow are where I got all opf the info used to make this to do: | The links that follow are where I got all of the info used to make this to do: |
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:
<https://help.ubuntu.com/community/BridgingNetworkInterfaces>
<http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/>