auto-addm new tap device to existing bridge ...

Mario Lobo mlobo at
Sun Nov 23 09:48:44 PST 2008

On Sunday 23 November 2008 02:22:02 Marc G. Fournier wrote:
> Is this possible?
> I'm using qemu, and when I start it up, it auto-create a tap device if one
> isn't available ... but, having that tap device not attached to the bridge
> that does exist doesn't help much ... if there some flag I can set, or
> sysctl value, that will have the new tap device attach itself to an
> existing bridge device?
> thanks ...

in /etc/rc.conf, add:

autobridge_interfaces="bridge0"   <-- whatever you called your bridge
autobridge_bridge0="tap0 tap1 [tapn..]"

forgot to add this:

Create a qemu-ifup script like this:

# qemu-ifup
/sbin/ifconfig $1 up
TEST=`ifconfig -a | grep member | grep $1`
if [ "$TEST" == "" ]; then
   /sbin/ifconfig bridge0 addm $1

Mario Lobo
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE)

More information about the freebsd-questions mailing list