UML tun/tap bridging

OK, have been working on this for days, and find that the main UML site is wrong, wrong, wrong. Here is the scoop to do tun/tap over the linux bridge.

1. Make a bridge on the host, I used br0 as an that is what was used on the original doc. You only need one, I think. But you can use whatever you want (br1, br2, br3, ...).

host# brctl addbr br0

2. Now add the real ethernet interface device (eth0) to the brdge group. Make sure that is does not have an IP address, cause we are just riding on top of it. The bridge interface (br0) will have the IP.

host# ifconfig eth0 up
host# brctl addif br0 eth0
host# ifconfig br0 up

3. Start your tap interface.

host# modprobe tun
host# ifconfig tap0 up
host# brctl addif br0 tap0

I have about 5 (tap0 -> tap4) running on my system, and just do this command for each one.

4. Activate Spanning Tree Protocol on the bridge

host# brctl stp br0 on

5. Run your uml session with "eth0=tuntap,tap0,fe:fd:f0:00:00:01" remember no ip!

host# /home/uml/linux eth0=tuntap,tap0,fe:fd:f0:00:00:01

I use fe:fd: this almost guarantees that I won''t repeat the same MAC on two systems.

6. In your uml bring up the the eth0 interface

uml# ifconfig eth0 up
Use dhcp to get an ethernet address.

You should get a perfectly working ethernet bridge so your UML can behave like a real box on the LAN.


Post a Comment

Popular posts from this blog

Using Windows 2012 NFS with VMware ESX