# [solved]Bridging not working across qemu guests.

## dE_logics

This is what I'm doing -- 

```
modprobe tun;ip tuntap add mode tap veth;ip a add fc00::1001/124 dev veth;ip link set dev veth up

qemu-system-x86_64 -machine accel=kvm,kernel_irqchip=on,mem-merge=on -drive file=centos7.qcow,id=centos,if=ide,media=disk,cache=unsafe,aio=native,index=0 -vnc :2 -no-acpi -device e1000,id=ethnet,vlan=0 -net tap,ifname=veth,script=no,downscript=no,vlan=0 -m 512

modprobe tun;ip tuntap add mode tap veth0;ip a add fc00::1003/124 dev veth0;ip link set dev veth0 up

qemu-system-x86_64 -machine accel=kvm,kernel_irqchip=on,mem-merge=on -drive file=centos7_2.qcow,id=centos,if=ide,media=disk,cache=unsafe,aio=native,index=0 -vnc :2 -no-acpi -device e1000,id=ethnet,vlan=0 -net tap,ifname=veth0,script=no,downscript=no,vlan=0 -m 512

ensure to change default IP in VM2.

ip a del fc00::1003/124 dev veth0

ip a del fc00::1001/124 dev veth

ip link set dev veth down

ip link set dev veth0 down

brctl addbr br

brctl stp br off

brctl addif br veth veth0

ip link set dev veth up

ip link set dev veth0 up

ip link set promisc on dev veth0

ip link set promisc on dev veth

ip link set dev br up

ip a add fc00::1001/124 dev br
```

The host can connect to both the VMs, and the VMs can ping it back, BUT the VMs cannot connect to each other. They claim "destination unreachable"; that means routes are present.

I've tried with both CentOS and system rescue CD.

----------

## szatox

I'm using stuff like this:

configure bridge during boot (a snippet from my netifrc config). You can do that manually, but I didn't want it bothering me:

 *Quote:*   

> config_vn0="10.0.1.1/24"
> 
> brctl_vn0="setfd 0
> 
> sethello 10
> ...

 

and launch each vm with a script containing this:

 *Quote:*   

> add_ifaces ()
> 
> {
> 
> i=1
> ...

 

run it as:

 name=<machine name>  add_interfaces <bridge1> [brigde2] [bridge3....]

It creates interfaces, attaches them to the bridges and generates a string to be appended to qemu's command line

You can add options for virtio drivers as well. And it's not going to be any different for ipv6

----------

## dE_logics

$2 is not used anywhere.

```
sudo /sbin/brctl addif $1
```

no bridge interface named "name=<machine name>" exists.

----------

## dE_logics

The 2 VMs had the same IP address.

----------

